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 installIf you want to use YARN or NPM remember to remove
pnpm-lock.yamland useyarn installornpm installinstead.
Create the database MYSQL with the production database and test database.
Create a
.envfile with the content of the.env.examplefile. 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:testnpm run prepareIf 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-pushpnpm start:devpnpm testpnpm test:coverageCheck out
package.jsonfor more options.
You can use the .http files on http-requests folder to test out requests.