/Backend_IC_Fisio

Sistema realizado em Nestjs, postgres e docker para IC25 do Ehealth do Inatel onde foi criado um sistema para controle de pacientes de fisioterapeutas

Primary LanguageTypeScript

Backend_IC_Fisio

Sistema realizado em Nestjs, postgres e docker para IC25 do Ehealth do Inatel onde foi criado um sistema para controle de pacientes de fisioterapeutas

Table of Contents

Features

  • Database (typeorm).
  • Seeding.
  • Config Service (@nestjs/config).
  • Mailing (nodemailer, @nestjs-modules/mailer).
  • Sign in and sign up via email.
  • Admin, ISP and User roles.
  • I18N (nestjs-i18n).
  • File uploads. Support local and Amazon S3 drivers.
  • Swagger.
  • E2E and units tests.
  • Docker.
  • Pacient Module (CRUD)
  • Session Module (CRUD)

Quick run

git clone GIT_REPO
cd GIT_REPO
cp env-example .env
#config it
docker compose up -d

Comfortable development

Change DATABASE_HOST=postgres to DATABASE_HOST=localhost

Change MAIL_HOST=maildev to MAIL_HOST=localhost

Run:

docker compose up -d postgres maildev redis
yarn

yarn migration:run

yarn seed:run

yarn start:dev

Links

Database utils

Generate migration

yarn migration:generate -- src/database/migrations/CreateNameTable

Run migration

yarn migration:run

Revert migration

yarn migration:revert

Drop all tables in database

yarn schema:drop

Run seed

yarn seed:run

Tests

# e2e tests
sudo ./test-e2e.sh

Tests in Docker

docker compose -f docker-compose.ci.yaml --env-file env-example -p ci up --build --exit-code-from api && docker compose -p ci rm -svf

Test benchmarking

docker run --rm jordi/ab -n 100 -c 100 -T application/json -H "Authorization: Bearer USER_TOKEN" -v 2 http://<server_ip>:3000/api/v1/users