Simple api to practice some MySQL (triggers, procedures, views, etc.), tests, architecture and check out some technologies like Pnpm, Fastify, Pactum, Yup and more.
npm i -g pnpm
pnpm install
If you want to use YARN or NPM remember to remove
pnpm-lock.yaml
and useyarn install
ornpm install
instead.
Create the database MYSQL with the production database and test database.
Create a
.env
file with the content of the.env.example
file. Remember to change the database names if you are using other databases.
Execute the migrations on the databases. (Migrations are executed by default when you run the application too, but not the tests)
npm run migration:run
npm run migration:run:test
npm run prepare
If you are on linux (and maybe MacOS) remember to give the execution permission to husky scripts
chmod +x .husky/pre-commit
chmod +x .husky/pre-push
pnpm start:dev
pnpm test
pnpm test:coverage
Check out
package.json
for more options.
You can use the .http files on http-requests
folder to test out requests.