A boilerplate for Express.js that can be used to develop your future apps in Node.js!
The application requires the following software installed on your machine. Other server versions should also work but the using the provided ones guarantees the application will start correctly.
- Node.js -
18.x.x
- pnpm -
7.x
- Docker -
20.x.x
- Docker Compose -
2.15.x
- MySQL database - persistent application storage.
- Docker - used as runtime environment for application containers.
Router
- it is responsible for persisting application paths and routing the traffic to the proper code component.Controller
- a piece of code that keeps the logic of the application.Handler
- parses input data and handles sending a response.Repository
- handles sending queries to database.Driver
- abstraction that allows using various DB solutions without any changes on Repository level.Migrator
- sets up the database structure.
- Pull the repository -
git clone [email protected]:elszczepano/expressjs-boilerplate.git && cd expressjs-boilerplate
. - Start the application -
docker-compose up --build
. If you run the application for the first time, containers will need to be pulled or built. - Visit
http://localhost:8000/hello
to confirm the application works correctly.
- Pull the repository -
git clone [email protected]:elszczepano/expressjs-boilerplate.git && cd expressjs-boilerplate
. - Install dependencies -
pnpm install --filter ./
. - Run tests -
npm test
.
If you want to contribute do not hesitate to create an issue or a pull request!