This repo contains Inner Circle Time API.
This repo and its infrastructure tailored for VSCode/GitHub Codespaces Dev Container centric development experience in Docker to achieve better isolation of the environment as well as its cross-platform support out of the box. For instance, Visual Studio for Mac support stops at .NET 8, thus, we needed something else rather than native Visual Studios for Mac and Windows. We decided to give a shot to VSCode since we use it intensively in other stacks already.
Full info about Inner Circle .NET related code conventions, patterns, decisions, and reasoning can be found here.
More info about the Inner Circle project and its related repos can be found here: inner-circle-documentation.
- Install Docker Desktop (Windows, macOS) or Docker Engine (Linux)
Note: It seems like there is Docker Engine for Linux (https://docs.docker.com/desktop/setup/install/linux/ubuntu/).
- Install Visual Studio Code.
- Install Visual Studio Code Dev Containers Extension.
Open this repo's folder in VSCode/Codespaces, it might immediately propose you to re-open it in a Dev Container or you can click on Remote Explorer, find plus button and choose the Open Current Folder in Container option and wait when it is ready.
When your Dev Container is ready, the VS Code window will be re-opened. Open a new terminal in this Dev Container which will be executing the commands under this prepared Linux container where we have already pre-installed and pre-configured Inner Circle APIs .NET related dependencies.
dotnet run --project ./Api
To run xUnit unit and integrational tests execute the following script in Terminal:
dotnet test --verbosity detailed
To run xUnit unit tests execute the following script in Terminal:
dotnet test --verbosity detailed --filter "Type=Unit"
To run xUnit integrational tests execute the following script in Terminal:
dotnet test --verbosity detailed --filter "Type=Integration"
To run Karate E2E tests execute the following script in Terminal:
java -jar /karate.jar .
Full docs and useful snippets about migrations in this infrastructre setup are available here.
To add a new migration with the domain changes execute the following script in Terminal:
dotnet ef migrations add <YOUR_NEW_MIGRATION_NAME> --startup-project ./Api/Api.csproj --project ./Application/Application.csproj --context AppDbContext --verbose
To apply pending migrations execute the following script in Terminal:
dotnet ef database update --startup-project ./Api/Api.csproj --project ./Application/Application.csproj --context AppDbContext --verbose
| Service Name | Api in Dev Container/Codespaces | Api in IDE | Api in Docker Compose | Db in Docker Compose | MockServer in Docker Compose | PgAdmin in Docker Compose |
|---|---|---|---|---|---|---|
| inner-circle-time-api | 4507 | 5507 | 6507 | 7507 | 8507 | 9507 |
Full docs about the allocated ports, reasoning, and the other services bindings in this infrastructre setup are available here.
You can go to Ports tab in the Terminal parent panel to find available services.
The most useful is PgAdmin http://localhost:9507 (password is postgres).
You can fetch OpenApi endpoints and types contract using this URL http://localhost:4507/api/swagger/openapi/v1.json. Swagger UI is accessible at http://localhost:4507/api/swagger/index.html.
However, UI doesn't support requests execution, this requires adding Auth dialog to pass a token. It is a bit trickier starting from .NET 9 due to the change in support of Swagger packagies family Swashbuckle, read here and there about that more.
You can see db diagram here