Skip to content

sebavidal10/lokr-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lokr Server

A modern, robust API Boilerplate built with Express and MongoDB.

Features

  • 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.

Project Structure

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

Getting Started

Prerequisites

  • Node.js (v14+)
  • MongoDB

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd lokr-server
  2. Install dependencies:

    npm install
  3. Setup environment variables:

    cp .env.example .env
    # Edit .env with your configuration

Running the Server

# Development mode
npm start

# Test mode
npm test

API Documentation

The server includes interactive API documentation powered by Swagger. Once the server is running, you can access it at:

http://localhost:3000/api-docs

Postman Collection

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.

License

ISC

About

API Boilerplate in Express & MongoDB

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors