{"id":20633154,"url":"https://github.com/marcoscostadev/minimal-api-docker-tdd","last_synced_at":"2025-04-15T19:06:59.073Z","repository":{"id":185349046,"uuid":"673345804","full_name":"MarcosCostaDev/minimal-api-docker-TDD","owner":"MarcosCostaDev","description":"This project is a participant in the first Rinha de Backend competition. Please note that this code is not intended for production use; it has been highly optimized for the competition. It has employed the best techniques to handle 3K to 7K records per second using two instances of a web app, database, cache with only 3GB of RAM and 1 unit of CPU. ","archived":false,"fork":false,"pushed_at":"2023-08-29T23:31:59.000Z","size":578,"stargazers_count":10,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-15T19:06:53.264Z","etag":null,"topics":["rinha-de-backend"],"latest_commit_sha":null,"homepage":"https://github.com/zanfranceschi/rinha-de-backend-2023-q3","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MarcosCostaDev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-01T12:25:14.000Z","updated_at":"2024-07-04T13:45:01.000Z","dependencies_parsed_at":"2023-08-01T15:47:24.754Z","dependency_job_id":"6397860e-55d9-43fe-a329-31f23ec88542","html_url":"https://github.com/MarcosCostaDev/minimal-api-docker-TDD","commit_stats":null,"previous_names":["marcoscostadev/minimal-api-docker-tdd"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcosCostaDev%2Fminimal-api-docker-TDD","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcosCostaDev%2Fminimal-api-docker-TDD/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcosCostaDev%2Fminimal-api-docker-TDD/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcosCostaDev%2Fminimal-api-docker-TDD/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarcosCostaDev","download_url":"https://codeload.github.com/MarcosCostaDev/minimal-api-docker-TDD/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249135808,"owners_count":21218365,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rinha-de-backend"],"created_at":"2024-11-16T14:18:59.820Z","updated_at":"2025-04-15T19:06:59.039Z","avatar_url":"https://github.com/MarcosCostaDev.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Minimal API with Docker and TDD\n\nGithub: [@MarcosCostaDev](https://github.com/MarcosCostaDev) | Twitter/X: [@MarcosCostaDev](https://twitter.com/MarcosCostaDev)\n\nProject Url [https://github.com/MarcosCostaDev/minimal-api-docker-TDD](https://github.com/MarcosCostaDev/minimal-api-docker-TDD)\n\n### Technologies\n  - CSharp (C#)\n  - .NET Core (.NET 7)\n  - Swagger\n  - xUnit (Test framework)\n  - Docker / Docker compose (container orchestrator)\n  - Redis (Distributed Cache)\n  - Nginx (Load balancer)\n  - Postgres (Database)\n\n### Requirements\n  - [Docker](https://docs.docker.com/engine/install/)\n\n### How to run\n  - Open the `./src` folder\n  - Open a `terminal` / `bash` and execute `docker-compose up`\n  - **API** will be available in the URL `http://localhost:9999`\n  - **Swagger** will be available in the  URL `http://localhost:9999/swagger`\n  - API Endpoints available\n     - `GET /ping` health check, return `pong` if the API is up.\n     - `POST /pessoas` for creating a record in the table `People` using the format message below\n        ```json\n        {\n            \"apelido\" : \"josé 12\",\n            \"nome\" : \"José Roberto\",\n            \"nascimento\" : \"2012-03-08T00:00:00\",\n            \"stack\" : [\"C#\", \"Node\", \"Oracle\"]\n        }\n        ``` \n     - `GET /pessoas/[id]` for retrieving a record of a person created using replacing `[id]` with the `person id`.\n     - `GET /pessoas/t=[your search]` for retrieving records that contain the words informed, replace `[your search]` with your actual search.\n     - `GET /contagem-pessoas` for retrieving the number of people created.\n\n### Learn more\n\n#### Running on Visual Studio\n\nThe project originally was created using Visual Studio 2022 Community Edition, but you can download its [most recent version](https://visualstudio.microsoft.com/vs/community/) and you need to download the [Visual Studio Container tools](https://learn.microsoft.com/en-us/visualstudio/containers/overview?view=vs-2022) for executing the project.\n\n#### xUnit and integration tests\n\nThe integration test runs on docker containers that simulate this project in \"Production\".\n\n#### Stress Test with the Postman\n\nAfter 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.\n\n1. Download [Postman](https://www.postman.com/downloads/) and install it.\n2. Go to import collection and select the file `./test/stress/RinhaBackEnd.postman_collection.json`\n3. After importing the collection to the postman, right-click on the \"RinhaBackEnd\" collection, and select `Run Collection`, the `Runner Window` will be shown.\n4. Right side, adjust the order of execution: place the `POST /pessoas` above the `GET /pessoas/:id` this will avoid trying to get a person that does not exist.\n5. Left side of the Runner window, select `performance`, and use the configuration you want.\n6. Click on run.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcoscostadev%2Fminimal-api-docker-tdd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcoscostadev%2Fminimal-api-docker-tdd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcoscostadev%2Fminimal-api-docker-tdd/lists"}