KarbonTODO is a task management application with a custom authentication system integrated with Auth0 for Google OAuth. Users can create, update, delete, and prioritize tasks, with a responsive UI and secure backend.
Website link - https://karbon-todo-frontend.onrender.com
Video link - https://drive.google.com/file/d/1-x5MXPfWvCI-rFxSFTHn4aBBNMz4QIQt/view?usp=sharing
Documentation - https://drive.google.com/file/d/1vzjl_z1qBVg4sppBUvEUAAThkSyxQ_So/view?usp=sharing
- React.js: UI framework
- Tailwind CSS (Vite): Styling with custom theme
- Auth0: Handles Google OAuth and custom login/logout
- Axios: API requests
- React Router: Page navigation
- React Toastify: Notifications
- React Icons: UI icons
- Express.js: API framework
- Mongoose: MongoDB ORM
- JWT: Token-based authentication
- Bcryptjs: Password hashing
- Nodemon: Development server auto-restart
- Cookie-Parser: Cookie handling
- CORS: Cross-origin resource sharing
- MongoDB: NoSQL database for user and todo data
- Custom Login/Signup: Users provide email and password, stored in MongoDB with bcrypt-hashed passwords.
- Auth0 Integration: Google OAuth uses
user.email
anduser.sub
(as password). Backend appends "Auth0Google" to the email (e.g.,user@example.com
becomesuser@example.comAuth0Google
) to avoid conflicts with custom login. - Logout: Clears JWT cookie and redirects (Auth0 or standard).
- Node.js: v16 or higher
- MongoDB: Cloud (MongoDB Atlas) or local instance
- Auth0 Account: For Google OAuth setup
- Git: For cloning the repository
-
Clone Repository
git clone <repository-url> cd karbontodo/backend
-
Install Dependencies
npm install
-
Configure Environment Variables Create a
.env
file in thebackend
directory:PORT=8000 NODE_ENVIRONMENT=development MONGODB_URL=mongodb+srv://<user>:<pass>@cluster0.vdangk5.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0 JWT_SECRET=<your-secret-key>
-
Run Backend
npm run dev
- Server runs on
http://localhost:8000
.
- Server runs on
-
Navigate to Frontend
cd ../frontend
-
Install Dependencies
npm install
-
Configure Auth0 Update
src/index.jsx
with your Auth0 credentials:<Auth0Provider domain="dev-lmm83bwhrqtim6qx.us.auth0.com" clientId="gcY1UYPUQscuShXwMN0ZrYEc31jkuvZr" authorizationParams={{ redirect_uri: window.location.origin }} >
-
Run Frontend
npm run dev
- Frontend runs on
http://localhost:5173
.
- Frontend runs on
- MongoDB Atlas: Create a cluster, get the connection string, and add it to
.env
(MONGODB_URL
). - Local MongoDB: Ensure MongoDB is running locally and update the connection string accordingly.
- Create an Auth0 account and application.
- Enable Google OAuth in Auth0 dashboard.
- Set callback URL to
http://localhost:5173
. - Add Auth0
domain
andclientId
tosrc/index.jsx
.
- Frontend:
src/components
: Navbar, TodoItemsrc/Context
: AuthContext, UserContextsrc/pages
: Home, Login, SignUpsrc/assets
: Todo icon
- Backend:
controllers
: Auth, todo, and user logicmodels
: User and Todo schemasroutes
: API endpointsmiddleware
: JWT authenticationconfig
: Database connection and JWT generation
- Start MongoDB (if local).
- Run backend (
npm run dev
inbackend
). - Run frontend (
npm run dev
infrontend
). - Open
http://localhost:5173
in a browser. - Use Login/Signup or Google OAuth to access the app.
- Signup/Login: Create an account or log in (standard or Google).
- Tasks: Add, edit, delete, or mark tasks as completed. Set priority (Low, Medium, High).
- High-Priority View: See high-priority tasks in a dedicated section.
- Logout: Clears session and redirects to home.
- Ensure CORS is configured for
http://localhost:5173
in backend. - JWT tokens are stored in HTTP-only cookies with a 7-day expiry.
- Auth0 Google login appends "Auth0Google" to email to prevent conflicts.