Skip to content

Latest commit

 

History

History
106 lines (70 loc) · 2.37 KB

README.md

File metadata and controls

106 lines (70 loc) · 2.37 KB

simple-subway-node-api

Description

Simple api to practice some MySQL (triggers, procedures, views, etc.), tests, architecture and check out some technologies like Pnpm, Fastify, Pactum, Yup and more.

Technologies

Environment, language and database

Frameworks

Linters and formatters

Test tools

Other tools

Installation

npm i -g pnpm

pnpm install

If you want to use YARN or NPM remember to remove pnpm-lock.yaml and use yarn install or npm install instead.

Environment Configuration

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

Husky and lint staged Configuration

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

Running the application

pnpm start:dev

Running the tests

pnpm test

with coverage

pnpm test:coverage

Check out package.json for more options.

Manually testing the requests

You can use the .http files on http-requests folder to test out requests.