A template for building .NET microservices with best practices and common patterns.
- Initialize Application
- API Interfaces
- Monitoring Tools
- Deployment
- Technologies and References
- License
Follow these steps to initialize the application on your local machine.
First, make sure the init.sh script has executable permissions
chmod +x init.sh
Then build the application using
./init.sh build
Start the application with
./init.sh start
Alternatively, run the application in watch mode
./init.sh watch
From PowerShell or Command Prompt run build command
.\init.cmd build
Start the application
.\init.cmd start
Alternatively run the application in watch mode
.\init.cmd watch
Use the following command to start the application in Docker container.
docker-compose --env-file .env.docker up --build -d
- Local host url: http://localhost:8000/swagger
- Docker host url: http://localhost:8080/swagger
- Local host url: http://localhost:8000/scalar
- Docker host url: http://localhost:8080/scalar
Enable real‑time metrics, logs, and health checks for the application by following the step‑by‑step setup guide. Click for Guide
- Install the EF Core CLI tool (dotnet-ef)
dotnet tool install --global dotnet-ef
This command adds the EF Core command-line tools to your system globally.
- Verify the installation
dotnet ef --version
If you see a version number, the tool has been installed successfully.
- Create a new migration
dotnet ef migrations add InitialMigration --context DataContext --project src/Infra
- --context DataContext: Specifies which DbContext to use when generating the migration.
- --project src/Infra: Specifies the project folder where the migration files will be created.
- Apply the migration to the database
dotnet ef database update --context DataContext --project src/Infra
This command applies the latest migration to the database.
Service may be in sleep mode on the first request. You may need to wait for a few seconds. Live Demo Url
solution-template is licensed under the MIT license.