A Task Manager API built with Node.js, Express, and MongoDB.
- User Authentication: Register, log in, and manage user sessions with JWT
- Task Management: Create, read, update, and delete tasks
- Password Reset: Send password reset links and reset passwords securely
- API Documentation: Swagger UI for comprehensive API documentation
- Error Handling: Centralized error handling for consistent responses
- Validation: Input validation using Joi
- Environment Configuration: Manage sensitive data with
.envfiles
-
Clone the repository:
git clone https://github.com/MonubiJustin/Task-Manager-App.git cd Task-Manager-App -
Install dependencies:
npm install
-
Set up your environment variables (see Environment Variables)
-
Start the server:
npm start
Create a .env file in the root directory and add the following variables:
PORT=3000
MONGO_URI=your_mongodb_connection_string
SECRET_KEY=your_jwt_secret_key
RESEND_API_KEY=your_resend_api_key
BASE_URL=http://localhost:3000-
Start the server:
npm start
-
Access the API:
Visithttp://localhost:3000 -
Development (with live reloading):
npm install -g nodemon nodemon app.js
- API documentation is available via Swagger.
- After starting the server, visit:
http://localhost:3000/api-docs
- Register a User:
POST /api/v1/users/register - Login a User:
POST /api/v1/users/login - Get Current User:
GET /api/v1/users/me - Create a Task:
POST /api/v1/tasks - Get All Tasks:
GET /api/v1/tasks
Task-Manager-App/
├── public/ # Frontend static files
├── routes/ # API route definitions
├── models/ # Mongoose models
├── middleware/ # Custom middleware
├── controller/ # Route handlers (controllers)
├── validators/ # Joi validation schemas
├── startup/ # Initialization logic (e.g., DB, Swagger)
├── app.js # Main application entry point
├── package.json # Project metadata and dependencies
└── README.md # Project documentation
- Node.js: JavaScript runtime for building the backend
- Express: Web framework for building RESTful APIs
- MongoDB: NoSQL database for storing user and task data
- Mongoose: ODM for MongoDB
- JWT: Authentication and authorization
- Joi: Input validation
- Swagger: API documentation
- dotenv: Environment variable management