This is a MERN stack application built to manage user authentication, tasks, and other functionality. The application uses React for the frontend, Node.js/Express for the backend, MongoDB as the database, and JWT for secure authentication.
Note: The project was deployed on a free Render server, so after a certain period without active users, the instance is deactivated until a user accesses the site again. Due to this, if you visit the site, it is likely to take 50 seconds or more to load due to Render.com's policies.
- Authentication: User registration, login, and token-based authentication using JWT.
- Task Management: Manage tasks with CRUD operations.
- User Management: Handle user data securely.
- Frontend Integration: React-based client integrated with the backend.
- Secure Routes: Middleware for token validation to protect API endpoints.
- Environment Configuration: Environment variables managed using
dotenv.
- React: For building the user interface.
- Vite: For faster development and build processes.
- Node.js: JavaScript runtime for building the server.
- Express: Web framework for managing APIs.
- JWT: For secure token-based authentication.
- Cookie-Parser: For handling cookies in requests.
- Morgan: For request logging during development.
- MongoDB: NoSQL database for storing user and task data.
- Mongoose: ODM (Object Data Modeling) library for MongoDB.
Ensure you have the following installed:
- Node.js (v14 or higher)
- MongoDB (running locally or on a remote server)
- Install backend dependencies
npm install
- Set up environment variables:
TOKEN_JWT=your_jwt_secret MONGO_URI=your_mongodb_connection_string - Start the backend server
npm run dev
- Navigate to the client directory:
cd client - Install frontend dependencies:
npm install
- Start the development server:
npm run dev
- Development Configuration:
While in development mode, all frontend routes requiring API calls must include the complete backend URL. For example:
const loginUrl = "http://localhost:PORT/login"; // Replace PORT with your backend port number