This is a full-stack application built with the MERN stack (MongoDB, Express, React, Node.js) featuring authentication, user profiles, and a task management system.
- Backend: Node.js, Express, MongoDB, Mongoose, JWT, Bcrypt
- Frontend: React, Vite, TailwindCSS, Axios, React Router, Lucide React
- Authentication: Register and Login with JWT.
- Protected Routes: Dashboard and Profile pages are protected.
- Dashboard: View, Create, Edit, Delete, Search, and Filter tasks.
- Profile: View and Update user profile.
- UI/UX: Responsive design, modern components, loading states, and error handling.
- Node.js installed
- MongoDB installed and running (or use MongoDB Atlas)
- Navigate to the backend directory:
cd backend - Install dependencies:
npm install
- Create a
.envfile based on.env.example:Updatecp ../.env.example .env
MONGO_URIif needed. - Start the server: The server will run on
npm run dev
http://localhost:5000.
- Navigate to the frontend directory:
cd frontend - Install dependencies:
npm install
- Start the development server: The app will run on
npm run dev
http://localhost:5173.
- POST /api/auth/register: Register a new user.
- POST /api/auth/login: Login user and get token.
- GET /api/auth/user: Get current user data.
- GET /api/profile/me: Get current user profile.
- PUT /api/profile: Update user profile.
- GET /api/tasks: Get all tasks (supports
searchandstatusquery params). - POST /api/tasks: Create a new task.
- PUT /api/tasks/:id: Update a task.
- DELETE /api/tasks/:id: Delete a task.
To scale this application:
- Backend: Implement horizontal scaling using a load balancer (e.g., Nginx) and run multiple instances of the Node.js server (using PM2 or Docker).
- Database: Use MongoDB sharding and replication for high availability and performance. Index frequently queried fields (like
userandstatusin Tasks). - Frontend: Optimize build with code splitting, lazy loading, and CDN for static assets.
- Caching: Implement Redis for caching frequently accessed data (like user profiles).
MIT