This repository contains complete learning journey, notes, and implementations.
The covers a full backend development roadmap — from fundamentals to production-level topics including MVC architecture, REST API design, authentication, error handling, security, and deployment.
- Node.js architecture, event loop, NPM ecosystem
- Express.js framework fundamentals
- Environment configuration with
.env - Developer setup, VS Code, Postman, MongoDB Atlas
- Proper use of HTTP methods
- Clean URL structures
- Structured JSON responses
- Correct status codes
- Pagination, sorting, filtering
- Schema design
- Data validation
- Virtual fields
- Custom instance & static methods
- CRUD operations
- Relationship modeling
- Create, Read, Update, Delete endpoints
- Advanced search and query filtering
- Pagination & sorting
- Global error handling with
AppError - Custom middleware (logging, validation, etc.)
- User registration and login
- JWT token handling
- Secure cookie-based sessions
- Role-based access (Admin, User)
- Protected routes
- Security middlewares: Helmet, rate-limit, XSS-clean
- CORS setup
- Deployment structure
- Env variable management
- API versioning patterns
| Technology | Purpose |
|---|---|
| Node.js | Server runtime |
| Express.js | Web framework |
| MongoDB (Atlas) | Database |
| Mongoose | ODM for MongoDB |
| JWT | Authentication |
| Bcrypt.js | Password hashing |
| Morgan | Logging |
| Helmet, CORS, XSS-Clean | Security |
| Postman | API testing |
.
├── config/
│ └── db.js
├── controllers/
│ └── productController.js
├── models/
│ └── Product.js
├── routes/
│ └── productRoutes.js
├── middleware/
│ ├── errorHandler.js
│ └── authMiddleware.js
├── utils/
│ └── appError.js
├── app.js
├── server.js
├── .env
└── package.json
# .env
PORT=5000
MONGO_URI=your-mongodb-atlas-uri
JWT_SECRET=your-secret-key
JWT_EXPIRES_IN=7d
``
Running the Server
npm run dev
Production Mode
npm start
``