Github: @MarcosCostaDev | Twitter/X: @MarcosCostaDev
Project Url https://github.com/MarcosCostaDev/minimal-api-docker-TDD
- CSharp (C#)
- .NET Core (.NET 7)
- Swagger
- xUnit (Test framework)
- Docker / Docker compose (container orchestrator)
- Redis (Distributed Cache)
- Nginx (Load balancer)
- Postgres (Database)
- Open the
./srcfolder - Open a
terminal/bashand executedocker-compose up - API will be available in the URL
http://localhost:9999 - Swagger will be available in the URL
http://localhost:9999/swagger - API Endpoints available
GET /pinghealth check, returnpongif the API is up.POST /pessoasfor creating a record in the tablePeopleusing the format message below{ "apelido" : "josé 12", "nome" : "José Roberto", "nascimento" : "2012-03-08T00:00:00", "stack" : ["C#", "Node", "Oracle"] }GET /pessoas/[id]for retrieving a record of a person created using replacing[id]with theperson id.GET /pessoas/t=[your search]for retrieving records that contain the words informed, replace[your search]with your actual search.GET /contagem-pessoasfor retrieving the number of people created.
The project originally was created using Visual Studio 2022 Community Edition, but you can download its most recent version and you need to download the Visual Studio Container tools for executing the project.
The integration test runs on docker containers that simulate this project in "Production".
After you execute the application using Docker-compose up or run it using Visual Studio. You will be able to execute the stress tests for this API using Postman.
- Download Postman and install it.
- Go to import collection and select the file
./test/stress/RinhaBackEnd.postman_collection.json - After importing the collection to the postman, right-click on the "RinhaBackEnd" collection, and select
Run Collection, theRunner Windowwill be shown. - Right side, adjust the order of execution: place the
POST /pessoasabove theGET /pessoas/:idthis will avoid trying to get a person that does not exist. - Left side of the Runner window, select
performance, and use the configuration you want. - Click on run.