Cherry ๐
This project was born to be a scaffold for a new Node REST microservice. It is a simple project that uses the following technologies / tools / architectures:
- Hexagonal Architecture Ready ๐
- Typescript ๐
- Fastify โฉ
- OpenAPI docs ready ๐
- JsonRPC server/client ready ๐ฆ
- SQLite3 with Knex ๐ง
- Tap for tests ๐งช
How to install
- Clone this repository
- Run
npm install
for install all dependencies - Run
npm run db:init
for create the database - Run
npm run start:dev
for start the server in development mode - Have fun ๐
Commands available
- Run
npm run start:dev
to start the server in development mode - Run
npm run start
to start the project in production mode - Run
npm run test
to run the tests - Run
npm run build:${env}
to build the project - Run
npm run db:init
to reset or create the database - Run
npm run db:migrate:latest
to run the latest migrations - Run
npm run db:migrate:reset
to rollback all the migrations
env:
- development
- staging
- production
Using Fastify
Fastify is a web framework highly focused on providing the best developer experience with the least overhead and a powerful plugin architecture. It is inspired by Hapi and Express and as far as we know, it is one of the fastest web frameworks in town. Check out the Fastify documentation.
Using Knex
Knex is a SQL query builder that can be used to build queries for different databases. It is used in this project to build queries for SQLite3, but it can be used for other SQL databases as well. To learn more about Knex, check out the Knex documentation.
Migration
To folders migrations
and seeds
are used to create the database and populate it with data. See the Knex documentation for more information.
Using Tap
Tap is a test framework for Node.js. It is used in this project to run the tests. To learn more about Tap, check out the Tap documentation.
Docker
Build docker image
env:
- development
- staging
- production
`docker build --build-arg env=${env} -t cherry:latest -f Docker/Dockerfile .'