This project is a custom Node.js framework that follows the Model-Controller-Service-Repository (MCSR) pattern. The structure of the project is designed to promote clean, maintainable, and scalable code by separating different concerns into distinct layers.
To get started with this project, clone the repository and install the required dependencies:
git clone [email protected]:nodtech/node-boiler.git
cd node-boiler
npm install
Start the application using the following command:
npm start
Ensure that you have set up the required environment variables in a .env
file in the root directory. Refer to the config/
directory for more information on configuration settings.
Contains configuration files for the application, including database and environment settings.
Holds the controller files that manage incoming HTTP requests, interact with services, and send responses back to the client.
Utility functions and classes that assist in common tasks across the application are stored here.
Custom middleware functions for request processing, such as authentication, authorization, and logging, are placed here.
Database migration files that help in versioning and managing database schema changes are stored in this directory.
Defines the data structures and schemas used by the application to interact with the database.
Handles data access and encapsulates database queries, providing an abstraction layer over the models.
Defines the application's routes and maps them to the appropriate controller actions.
Files for populating the database with initial data or test data are placed here.
Contains the business logic of the application, interacting with models and repositories to process data.
Schema validators and validation logic for incoming request data are located here, ensuring data integrity and correctness.
- Node.js: Built with Node.js version 20.
- PostgreSQL: Uses PostgreSQL as the database.
- Docker: Containerized setup for easy deployment.
- Environment Configuration: Easily configurable via an
.env
file.
Before you start, make sure you have the following installed:
-
Clone the Repository
git clone [email protected]:nodtech/node-boiler.git cd node-boiler
-
Start the application with docker
docker-compose up
-
To see the Available APIs hit this url in browser