O IVehicle API é um dos projetos que desenvolvi durante o bootcamp Full Stack da Digital Innovation One - DIO para a conclusão do módulo de Back-End com C#
- Criar, listar, editar e excluir Administradores
- Criar, listar, editar e excluir Veículos
- Interface Front End neste repositório: IVehicle-Front-End
- Banco de dados Mysql usando Docker
- Entity Framework para a manipulação do banco de dados
- Autenticação com Json Web Token
- Testes usando XUnit do .NET
- Biblioteca Scalar como interface gráfica para as rotas da API
Interface inicial do Scalar
Teste de uma requisição
- Certifique-se que o dotnet na versão 9.0 ou superior está instalado em sua máquina. Use o comando abaixo para verficiar:
dotnet --version
Caso não seja retornada a versão do dotnet, o mesmo não está instalado em sua máquina
1.1 Também certifique-se que o docker está instalado em sua máquina
docker --version
Caso não seja retornada a versão do docker, o mesmo não está instalado em sua máquina
- Clone o projeto para um diretório de sua preferência
git clone git@github.com:Arthur-Llevy/minimal-api.git
- Navege até o projeto
cd ./minimal-api
- Inicialize o banco de dados com o docker
docker compose up --build
Observação a flag "--build" só é necessária na primeira vez que você executa o comando. Da segunda em diante, basta executar "docker compose up".
- Para rodar a api, vá até a pasta /Api
cd ./Api
- Baixe as dependências
dotnet restore
- Inicie o projeto
dotnet watch run
Irá aparecer algo semelhante a mensagem abaixo em seu terminal, contento as portas onde você pode acessar à api
info: Microsoft.Hosting.Lifetime[14] Now listening on: http://localhost:5277 info: Microsoft.Hosting.Lifetime[0] Application started. Press Ctrl+C to shut down. info: Microsoft.Hosting.Lifetime[0] Hosting environment: Development info: Microsoft.Hosting.Lifetime[0] Content root path: /minimal-api/Api
- (Opicional) Acessar a UI do Scalar Navege até a rota
http://localhost:<"porta">/scalar/v1
- Rodar os testes Vá para a pasta ./Tests localizada na raiz do projeto
cd ../Tests
- Baixar dependências
donet restore
- Execute os testes
dotnet test
[ENGLISH]
The IVehicle API is one of the projects I developed during the Full Stack bootcamp at Digital Innovation One - DIO to complete the Back-End with C# module.
- Create, list, edit and delete Administrators
- Create, list, edit and delete Vehicles
- Front End interface in this repository: IVehicle-Front-End
- Mysql database using Docker
- Entity Framework for handling the database
- Authentication with Json Web Token
- Testing using .NET's XUnit
- Scalar library as a graphical interface for API routes
Scalar's initial interface
Testing a request
- Make sure that dotnet version 9.0 or higher is installed on your machine. Use the command below to check:
dotnet --version
If the dotnet version is not returned, it is not installed on your machine
1.1 Also make sure that docker is installed on your machine
docker --version
If the docker version is not returned, it is not installed on your machine
- Clone the project to a directory of your choice
git clone git@github.com:Arthur-Llevy/minimal-api.git
- Navigate to the project
cd ./minimal-api
- Initialize the database with docker
docker compose up --build
Note the "--build" flag is only necessary the first time you run the command. From the second step onwards, just run "docker compose up".
- To run the API, go to the /Api folder
cd ./Api
- Download the dependencies
dotnet restore
- Start the project
dotnet watch run
Something similar to the message below will appear in your terminal, containing the ports where you can access the API
info: Microsoft.Hosting.Lifetime[14] Now listening on: http://localhost:5277 info: Microsoft.Hosting.Lifetime[0] Application started. Press Ctrl+C to shut down. info: Microsoft.Hosting.Lifetime[0] Hosting environment: Development info: Microsoft.Hosting.Lifetime[0] Content root path: /minimal-api/Api
- (Optional) Access the Scalar UI Navigate to the path
http://localhost:<"port">/scalar/v1
- Run the tests Go to the ./Tests folder located in the project root
cd ../Tests
- Download dependencies
donet restore
- Run the tests
dotnet test