Getting Started with Fastify-CLI
This project was bootstrapped with Fastify-CLI.
This project was intended to be a simple implementation of Domain Driven Design according to my knowladge which I learned from Dicky Arinal——albeit an inconsiderable amount. As described in the first part of this README
, this project is built with Fastify framework with node-tap as its test framework. Prisma is also used as its ORM. PostgreSQL is the preferred DB of choice, other than having in memory as well for testing purposes. Swagger 2.0 is used to generate the API docs.
- Copy or move the
.env.example
to.env
and update the value as necessary - Install the packages using your package installer of choice (I uses pnpm, hence the project
lock file
) by running the following codepnpm install
- To run the app as is, you need to make sure your db is set up properly, and the
db.sql
file indb
directory is imported to your db. If you don't want to use the db you can replace the injected repository to use in memory atsrc/plugins/boot.ts
file. - You can access the api at http://localhost:11111.
- Copy or move the
.env.example
to.env
and update the value as necessary - Run the following command to start the docker containers
docker-compose up
- You can access the db at port
5432
of your localhost and the api at http://localhost:3000
In the project directory, you can run (you can run this with npm
as well):
To start the app in dev mode.
Open http://localhost:11111 to view it in the browser.
For production mode
Run the test cases.
Run the test cases and generate coverage report while also opening in at your browser.
To learn Fastify, check out the Fastify documentation.