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
./src
folder - Open a
terminal
/bash
and 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 /ping
health check, returnpong
if the API is up.POST /pessoas
for creating a record in the tablePeople
using 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-pessoas
for 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 Window
will be shown. - Right side, adjust the order of execution: place the
POST /pessoas
above theGET /pessoas/:id
this 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.