Skip to content

Arthur-Llevy/IVehicle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IVehicle API

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#

Funcionalidades

  • Criar, listar, editar e excluir Administradores
  • Criar, listar, editar e excluir Veículos

O que foi implantado

  • 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

Mídias do projeto

Interface inicial do Scalar

Imagem 1

Teste de uma requisição

Imagem 2

Como rodar o projeto

  1. 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

  1. Clone o projeto para um diretório de sua preferência
git clone git@github.com:Arthur-Llevy/minimal-api.git
  1. Navege até o projeto
cd ./minimal-api
  1. 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".

  1. Para rodar a api, vá até a pasta /Api
cd ./Api
  1. Baixe as dependências
dotnet restore
  1. 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   
  1. (Opicional) Acessar a UI do Scalar Navege até a rota
http://localhost:<"porta">/scalar/v1
  1. Rodar os testes Vá para a pasta ./Tests localizada na raiz do projeto
    cd ../Tests
  1. Baixar dependências
    donet restore
  1. Execute os testes
    dotnet test

[ENGLISH]


IVehicle API

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.

Functionalities

  • Create, list, edit and delete Administrators
  • Create, list, edit and delete Vehicles

What has been deployed

  • 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

Project media

Scalar's initial interface

Image 1

Testing a request

Image 2

How to run the project

  1. 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

  1. Clone the project to a directory of your choice
git clone git@github.com:Arthur-Llevy/minimal-api.git
  1. Navigate to the project
cd ./minimal-api
  1. 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".

  1. To run the API, go to the /Api folder
cd ./Api
  1. Download the dependencies
dotnet restore
  1. 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
  1. (Optional) Access the Scalar UI Navigate to the path
http://localhost:<"port">/scalar/v1
  1. Run the tests Go to the ./Tests folder located in the project root
cd ../Tests
  1. Download dependencies
donet restore
  1. Run the tests
dotnet test

Releases

No releases published

Packages

No packages published

Languages