A RESTful Task Manager API built using Node.js, Express.js, MongoDB Atlas, and JWT Authentication.
π Deployed API:
https://task-manager-api-u711.onrender.com
Test the API:
GET /
Response:
"Task Manager API running"β User Registration (Signup)
β User Login
β Password Hashing using bcryptjs
β JWT Authentication
β Protected Routes
β Create Tasks
β View Personal Tasks
β Update Tasks
β Delete Tasks
- Node.js
- Express.js
- MongoDB Atlas
- Mongoose
- JWT (jsonwebtoken)
- bcryptjs
- dotenv
- Render
- Express.js Routing
- Middleware
- MongoDB & Mongoose
- JWT Authentication
- Password Hashing with bcryptjs
- REST API Development
- CRUD Operations
- Environment Variables (.env)
- Git & GitHub
- Cloud Deployment using Render
- Backend Project Structure using Controllers, Routes, Models, and Middleware
task-manager-api
β
βββ config
β βββ db.js
β
βββ controllers
β βββ authController.js
β βββ taskController.js
β
βββ middleware
β βββ verifyToken.js
β
βββ models
β βββ User.js
β βββ Task.js
β
βββ routes
β βββ authRoutes.js
β βββ taskRoutes.js
β
βββ .env.example
βββ .gitignore
βββ README.md
βββ package.json
βββ server.js
git clone https://github.com/dev-chandan-s/task-manager-api.gitnpm installPORT=3000
MONGO_URI=YOUR_MONGODB_CONNECTION_STRING
JWT_SECRET=YOUR_SECRET_KEYnpm startPOST /api/auth/signupPOST /api/auth/loginGET /api/tasksPOST /api/tasksPATCH /api/tasks/:idDELETE /api/tasks/:idThe API is deployed and publicly accessible:
https://task-manager-api-u711.onrender.com
You can test it using Postman, Thunder Client, Insomnia, or any REST client.
Request:
POST https://task-manager-api-u711.onrender.com/api/auth/signupBody:
{
"email": "test@example.com",
"password": "123456"
}Request:
POST https://task-manager-api-u711.onrender.com/api/auth/loginBody:
{
"email": "test@example.com",
"password": "123456"
}Response:
{
"token": "YOUR_JWT_TOKEN"
}Request:
POST https://task-manager-api-u711.onrender.com/api/tasksHeaders:
authorization: YOUR_JWT_TOKEN
Body:
{
"title": "Learn SQL"
}Request:
GET https://task-manager-api-u711.onrender.com/api/tasksHeaders:
authorization: YOUR_JWT_TOKEN
Request:
PATCH https://task-manager-api-u711.onrender.com/api/tasks/:idHeaders:
authorization: YOUR_JWT_TOKEN
Replace :id with an actual task ID.
Request:
DELETE https://task-manager-api-u711.onrender.com/api/tasks/:idHeaders:
authorization: YOUR_JWT_TOKEN
Replace :id with an actual task ID.
- Passwords are hashed using bcryptjs.
- JWT Authentication protects task routes.
- Users can only access their own tasks.
- Sensitive credentials are stored in environment variables.
- Task Categories
- Due Dates
- Task Priorities
- User Profile Management
- Pagination
- Input Validation using Express Validator
- Refresh Tokens
- Swagger API Documentation
- Role-Based Authorization
Chandan Singh
GitHub: https://github.com/dev-chandan-s
Project Repository: https://github.com/dev-chandan-s/task-manager-api