CoffeePOS is a Point of Sale (POS) system for coffee shops, built with C# (.NET 8) on WinForms, using AntdUI for the interface and PostgreSQL for data storage.
The project follows a clear layered structure (UI -> Service -> Repository), includes dedicated modules for Cashier and Admin roles, supports background queue-based PDF printing, and uses Serilog for logging.
- Copy configuration files:
copy src/CoffeePOS/appsettings.example.json src/CoffeePOS/appsettings.json
copy src/Migrator/appsettings.example.json src/Migrator/appsettings.json- Update required values in both appsettings.json files:
- ConnectionStrings:DefaultConnection
- ThirdPartyServices:ImgBB_ApiKey (if image upload is used)
- Run migration and start the app:
./scripts/run.ps1 migrate
./scripts/run.ps1 dev- Sign in with default seeded accounts:
- Admin: admin / admin123
- Cashier: cashier / 123123
- CoffeePOS
- Platform: .NET 8 WinForms (Windows)
- UI framework: AntdUI
- Database: PostgreSQL + Npgsql
- Architecture: Feature-based + lightweight CQRS (separate Command and Query services)
- Printing: QuestPDF + background worker (queue)
- Logging: Serilog rolling file logs
- Login/change password/logout
- Select products, customize items, manage cart
- Checkout and create bills
- Track shift bill history
- Close shift and print shift reports
- KPI dashboard, charts, top-selling products
- Product/Category management
- Product Size/Topping management
- User management (create, update, deactivate/reactivate)
- Bill management (search, details, cancel/restore)
- Bill report CSV export
- Background PDF print queue (non-blocking UI)
- Trash cleanup background worker
- Theme tokenization via UiTheme
- Dependency injection via Microsoft.Extensions.Hosting
- Class and architecture diagrams: docs/ARCHITECTURE_CLASS_DIAGRAM.md
- Database diagrams: docs/DATABASE_DIAGRAMS.md
- Business use cases (7 UCs): docs/USE_CASE_SPECIFICATIONS_7UC.md
CoffeePOS/
scripts/
run.ps1
src/
CoffeePOS/ # Main WinForms application
Migrator/ # Database migration tool using DbUp
docs/ # Architecture, use case, and database docs
- Windows 10/11
- .NET SDK 8.x
- PostgreSQL 18+ (recommended)
Create appsettings.json for both projects from the example files:
- src/CoffeePOS/appsettings.example.json -> src/CoffeePOS/appsettings.json
- src/Migrator/appsettings.example.json -> src/Migrator/appsettings.json
At minimum, update:
- ConnectionStrings:DefaultConnection
- ThirdPartyServices:ImgBB_ApiKey (if image upload is used)
# From repository root
./scripts/run.ps1 migrate # Initialize/update database schema
./scripts/run.ps1 dev # Run CoffeePOS appOther commands:
./scripts/run.ps1 build # Publish Release single-file
./scripts/run.ps1 helpdotnet restore CoffeePOS.slnx
dotnet build CoffeePOS.slnx -v minimal
dotnet run --project src/Migrator/Migrator.csproj
dotnet run --project src/CoffeePOS/CoffeePOS.csproj- Admin: admin / admin123
- Cashier: cashier / 123123
These accounts are seeded by migration scripts and can be changed after login.
Main project is configured with:
- Runtime: win-x64
- PublishSingleFile: true
- ReadyToRun: via scripts/run.ps1 build
You can also publish manually:
dotnet publish src/CoffeePOS/CoffeePOS.csproj -c Release -r win-x64 --self-contained /p:PublishReadyToRun=true /p:PublishSingleFile=true- Logs are written to the Logs/ directory
- Level and rolling settings are configured in appsettings.json (Serilog)
This section is intentionally prepared for UI demo screenshots.
Symptoms:
- Missing appsettings.json
- Missing DefaultConnection
Fix:
-
Ensure both config files exist:
- src/CoffeePOS/appsettings.json
- src/Migrator/appsettings.json
-
Verify ConnectionStrings:DefaultConnection is valid in both files.
Symptoms:
- Migrator throws connection/authentication errors
Fix:
- Check PostgreSQL host, port, username, password, and database name.
- Confirm PostgreSQL is running and reachable from your machine.
- Re-run:
./scripts/run.ps1 migrateSymptoms:
- dotnet build fails due to missing SDK/runtime
Fix:
-
Install .NET SDK 8.x.
-
Validate installation:
dotnet --info -
Re-run:
dotnet build CoffeePOS.slnx -v minimalSymptoms:
- admin/admin123 or cashier/123123 does not work
Fix:
- Ensure migration completed successfully.
- Check if users were changed manually after seeding.
- Re-run migration on a clean/local dev database if needed.



