A Web
Node
Application written in
Typescript
and built with
NestJs,
TypeORM,
Angular,
Docker and
JWT
Instituto Federal de Educação, Ciência e Tecnologia de Mato Grosso do Sul (IFMS) Campus Três Lagoas
Tecnologia em Análise e Desenvolvimento de Sistemas (TADS6)
Desenvoltimento Baseado em Frameworks II (DBF-II)
Professor José Roberto
Aluno Mauricio da Silva
# Start the Docker container as a database service
$ docker-compose up
# Execute bash inside the container
$ docker exec -it <container-name> bash
# Exit the container
exit# Log in MySQL database service with the password
> mysql -u root -p
# Databases
> SHOW DATABASES;
> CREATE DATABASE <database-name>;
> USE <database-name>;
# Tables
> SHOW TABLES;
> DESCRIBE <table-name>;
# Selects
> SELECT * FROM <table-name>;
# Exit
> exit# Create a new NestJS project
$ nest new <project-name>
# Run
$ npm run start:dev
# Generate schematics:
$ nest g controller <component-name> --no-spec
$ nest g service <component-name> --no-spec
$ nest g module <component-name> --no-spec
$ nest g class <component-name> --no-spec
# Generate a new CRUD resource
$ nest g resource <component-name> --no-spec
# Install TypeORM Framework
$ npm install --save @nestjs/typeorm typeorm mysql2
# Install Validator and Transformer
$ npm install --save class-validator class-transformer
# Install Passport
$ npm install --save @nestjs/passport passport passport-local
$ npm install --save-dev @types/passport-local
# Install JWT
$ npm install --save @nestjs/jwt passport-jwt
$ npm install --save-dev @types/passport-jwt
# Alternative
$ npm install --save passport passport-jwt @nestjs/jwt @nestjs/passport# Create a new Angular project
$ ng new <project-name>
# Run
$ ng serve --open
# Generate a new component
$ ng generate component <path|component-name> --skip-tests
$ ng g c <path|component-name> --skip-tests
# Generate a new module
$ ng generate module <path|component-name> --flat
$ ng g m <path|component-name> --flat
# Add a Material:
$ ng add @angular/material
# Add the ESLint
$ ng add @angular-eslint/schematics