This is a simple asp.net core using .net 8.
The web api "steals" 25 images from thecatapi.com and saves them locally on your drive. Ideally you would use azure blob storage (or something similar) to ensure you won't have issues with disc limitations and the images would be publibcly available. However, for the sake of this test and simplicity it's not using any cloud service. The images ares served as static files and no specific controller exists.
| Project | Description |
|---|---|
| Natech.Caas.API | Contains everything related to the Web API, i.e. validators, requests and Main(). This package is combines all the other projects and it's the starting point |
| Natech.Caas.Core | Contains services that hold the main functionality of the project. It uses the Natech.Caas.Database project |
| Natech.Caas.Dtos | Data Transfer Objects for Natech.Caas.API |
| Natech.Caas.TheCatApi | All code related to integrating to thecatapi.com, it includes dtos, a client and config definition |
| Natech.Caas.API.IntegrationTests | A few integration tests that verify the functionality of the API, using an In-Memory database |
| Natech.Caas.Core.UnitTests | A few unit tests for the code that has most of the logic i.e. Natech.Caas.Core |
Starting the project will execute the already created migrations
NOTE: you will find in the project 2 docker-compose files, I've worked on this on a mac hence the existence of a second file.
- docker-compose
- .net 8
docker-compose up -d
dotnet run --project src/Natech.Caas.APIRuns all tests in the project
dotnet testdotnet ef migrations add InitialCreate --project ../Natech.Caas.Database --startup-project .dotnet ef migrations update --project ../Natech.Caas.Database --startup-project .- Use IOptions in CatService