A lightweight ASP.NET Core 9 Razor Pages application that simulates a retail monolith before decomposition.
It includes product listing, shopping cart, checkout, and inventory management — built to demonstrate modernisation and refactoring patterns.
- ASP.NET Core 9 (Razor Pages)
- Entity Framework Core (SQL Server LocalDB)
- Dependency Injection with modular services:
CartServiceCheckoutServiceMockPaymentGateway
- 50 sample seeded products with random inventory
- End-to-end retail flow:
- Products → Cart → Checkout → Orders
- Minimal APIs:
POST /api/checkoutGET /api/orders/{id}
- Health-check endpoint at
/health - Ready for decomposition into microservices
You can run and edit this application in three different ways:
Run the application directly on your local machine with your preferred IDE or editor.
Prerequisites:
- .NET 9 SDK installed (download)
- SQL Server LocalDB (included with Visual Studio) or SQL Server instance
- Your favorite code editor (Visual Studio, VS Code, Rider, etc.)
Steps:
git clone https://github.com/lavann/ads_monotlith_app.git
cd ads_monotlith_app
dotnet restore
dotnet ef database update
dotnet runUse a Docker container with a pre-configured development environment. This ensures consistency across different machines without installing dependencies locally.
Prerequisites:
- Docker Desktop installed and running
- Visual Studio Code with the Dev Containers extension
Steps:
- Clone the repository
- Open the folder in VS Code
- When prompted, click "Reopen in Container" (or use Command Palette:
Dev Containers: Reopen in Container) - VS Code will build and start the dev container with all dependencies pre-installed
- Run
dotnet ef database updateanddotnet runinside the container terminal
Develop entirely in the cloud with zero local setup. Codespaces provides a full VS Code environment in your browser.
Prerequisites:
- GitHub account with Codespaces access
Steps:
- Navigate to the repository on GitHub
- Click the green "Code" button
- Select the "Codespaces" tab
- Click "Create codespace on main"
- Wait for the environment to initialize
- Run
dotnet ef database updateanddotnet runin the integrated terminal
All three environments provide the same development experience with the .NET SDK, C# extension, and all necessary tools pre-configured.
dotnet ef database update
-
If you modify models:
dotnet ef migrations add <MigrationName>dotnet ef database update
-
EF Core uses DesignTimeDbContextFactory (Data/DesignTimeDbContextFactory.cs) with the connection string:
Server=(localdb)\MSSQLLocalDB;Database=RetailMonolith;Trusted_Connection=True;MultipleActiveResultSets=true
At startup, the app automatically runs await AppDbContext.SeedAsync(db); which seeds 50 sample products with random categories, prices, and inventory.
To reseed manually:
dotnet ef database drop -f
dotnet ef database update
dotnet runStart the application:
dotnet runAccess the app at https://localhost:5001 or http://localhost:5000.
| Path | Description |
|---|---|
/ |
Home Page |
/Products |
Product catalogue |
/Cart |
Shopping cart |
/api/checkout |
Checkout API |
/api/orders/{id} |
Order details API |
/health |
Health check endpoint |
You can override the default connection string by setting the ConnectionStrings__DefaultConnection environment variable.
| Variable | Description | Default |
|---|---|---|
ConnectionStrings__DefaultConnection |
Database connection string | LocalDB instance |
ASPNETCORE_ENVIRONMENT |
Environment mode | Development |





