A modern, robust API Boilerplate built with Express and MongoDB.
- Authentication: JWT-based authentication with Refresh Token support.
- Modern Architecture: Clean separation of concerns (Routes, Controllers, Models, Validations).
- Logging: Integrated with Winston for structured logging.
- Documentation: Swagger UI for interactive API exploration.
- Development: Hot-reloading with
nodemon. - Validation: Request body validation using
joi.
src/
├── api/
│ ├── controllers/ # Request handlers
│ ├── models/ # Mongoose schemas
│ ├── routes/ # API endpoints
│ ├── validations/ # Joi validation schemas
│ ├── middlewares/ # Custom Express middlewares
│ └── services/ # External services (EMAILS, etc.)
├── config/ # Configuration files (DB, Passport, Logger)
└── index.js # Entry point
- Node.js (v14+)
- MongoDB
-
Clone the repository:
git clone <repository-url> cd lokr-server
-
Install dependencies:
npm install
-
Setup environment variables:
cp .env.example .env # Edit .env with your configuration
# Development mode
npm start
# Test mode
npm testThe server includes interactive API documentation powered by Swagger. Once the server is running, you can access it at:
http://localhost:3000/api-docs
A Postman collection is included in the root directory: lokr-server.postman_collection.json. You can import this into Postman to quickly test all available endpoints.
ISC