A Node.js + Express + MongoDB backend for managing blog content — with authentication, file uploads, and tag management.
blog-api is a REST API backend built with Node.js, Express, and MongoDB, designed to handle user authentication, content management, and media uploads for a blog platform. The server includes:
- JWT-based authentication for secure user sessions
- CRUD operations for blog posts with validation
- File upload handling with
multerfor image management - Tag-based content discovery for popular tags
- Input validation using
Joifor data integrity - CORS support for cross-origin requests
This project serves as the backend for a modern blog application, emphasizing security, scalability, and maintainability.
| Technology | Purpose |
|---|---|
| Node.js (ESM) | JavaScript runtime environment |
| Express | Web framework for routing and middleware |
| MongoDB + Mongoose | NoSQL database and ODM |
| Multer | File upload middleware |
| CORS | Cross-origin resource sharing |
| JWT | Authentication and session management |
| Joi | Input validation and sanitization |
- Node.js >= 18
- MongoDB (local instance or MongoDB Atlas)
- A
.envfile with environment variables (see Configuration)
- Clone the repository:
git clone <repository-url> cd blog-api