This is a REST Web API created with c# and the .NET framework that uses PostgresSQL as the database and swaggerUI for testing the API. The Todo App is deployed via Docker containers.
- GET: get all the todos
- POST: Add todo by adding Name and Id
- PUT: To update a todo
- DELETE: To delete a todo
- .NET
- PostgresSql
- Docker
- SwaggerUI
- Docker and Docker Desktop installed Docker Desktop
- .NET SDK 8+ .NET SDK
- An IDE (for example vsCode)
- PostgresSQL installed PostgresSQL
- Optional pgadmin to get a visual Database
Clone the reposetory
git clone <Repo URL>
Create a .env file in the root directory with
POSTGRES_PASSWORD = YOUR_POSTGRES_PASSWORD
Build the project using the docker compose file
docker compose up --build -d
After building the project test it by going to
http://localhost:8080/swagger
Alternativ if you want to change the port go to the docker-compose.yml file and change the port number
If you have done everthing correctly you should see this page
Here you can test the API with GET, POST, PUT and DELETE
Note: this requires that pgadmin is installed
Create a new server in pgadmin and use these settings:
- Name: AppDb
- host/adress: localhost
- Port: 5433
- Username: postgres
- Password: same password as in you .env file
This should connect to the database.
To see the tables go to Databases -> AppDb -> Schemas -> tables - right click on Todos and click view data
Then you should see something like this: