Angular 20 + .NET 8 Web API application for running a Chinese auction: donors contribute gifts, users buy tickets, admins manage everything and draw winners
| Gifts Catalog | Login Page |
|---|---|
![]() |
![]() |
| Manage Gifts | Manage Purchases |
|---|---|
![]() |
![]() |
Chinese Auction System is a full-stack web application that digitizes a classic charity raffle event ("Chinese auction"): donors contribute gifts, each gift is assigned a category and a ticket price, and users purchase tickets to enter the draw for the gifts they want. Admins run the show from a management dashboard β creating gifts, categories and donors, reviewing purchases, and picking winners.
The backend is a .NET 8 Web API built around a clean Repository + Service layered architecture, secured with JWT authentication and role-based authorization (User / Admin), with Serilog structured logging, custom rate-limiting middleware, and interactive API docs via Swagger. The frontend is an Angular 20 single-page app (with SSR support) styled with PrimeNG/PrimeFlex, and includes Excel export for admin reports via xlsx.
For Users
- Browse the gift catalog by category, with images, descriptions and ticket price
- Add gifts to a cart and check out by purchasing tickets
- Secure registration & login with JWT-based sessions
For Admins
- Full CRUD for Gifts, Categories and Donors
- Review and manage all ticket purchases
- Draw and record gift winners
- Seeded sample data for a realistic local setup out of the box
| Layer | Technologies |
|---|---|
| Frontend | Angular 20 (standalone, SSR-ready), PrimeNG, PrimeFlex, RxJS, xlsx (Excel export) |
| Backend | .NET 8 Web API, C#, Repository + Service architecture |
| Data access | Entity Framework Core 9, SQL Server |
| Auth & Security | JWT Bearer authentication, role-based authorization, custom rate-limiting middleware, CORS |
| Observability | Serilog structured logging, request-logging middleware |
| API Docs | Swagger / OpenAPI (Swashbuckle) |
| Testing | xUnit (server), Jasmine/Karma (client) |
ChineseAuction-FullStack-Angular-DotNet/
βββ client/
β βββ my-app/ # Angular 20 SPA
β βββ src/app/ # components, services, routes
β
βββ server/
β βββ ChineseSaleApi/ # .NET 8 Web API
β β βββ Controllers/ # Auth, User, Gift, Category, Donor, Purchase
β β βββ Models/ # User, Gift, Category, Donor, Ticket, Order, OrderItem
β β βββ Repositories/ # data access layer
β β βββ Services/ # business logic layer
β β βββ Middleware/ # request logging, rate limiting
β β βββ Data/ # DbContext + seed data
β β βββ Migrations/ # EF Core migrations
β βββ ChineseSaleApi.Tests/ # xUnit test suite
β
βββ screenshots/ # README assets
- .NET 8 SDK
- Node.js (LTS) and npm
- SQL Server (local or remote instance)
- (Optional) Angular CLI and EF Core tools for local development
cd server/ChineseSaleApi
dotnet restore
dotnet run- Configure your SQL Server connection string and JWT settings in
appsettings.json(ConnectionStrings:DefaultConnection,JwtSettings). - On first run, the app seeds sample categories, donors and gifts (with images from
wwwroot/images) so you have realistic demo data immediately. - To apply EF Core migrations manually:
dotnet ef database update- Interactive API docs are available at
/swaggerin development.
cd client/my-app
npm install
npm start
# or
ng serve --openThe client expects the API at the base URL configured in the Angular app config/environment β update it if your API runs on a different host or port. By default the API allows requests from http://localhost:4200.
# Server unit tests
cd server/ChineseSaleApi.Tests
dotnet test
# Client unit tests
cd client/my-app
npm test# Backend
cd server/ChineseSaleApi
dotnet publish -c Release
# Frontend
cd client/my-app
npm run build
# or
ng build --configuration productionServe the generated frontend assets from your web server of choice, or integrate them into the backend's static file pipeline.
- Authentication is JWT-based; protected endpoints require a valid
Bearertoken and enforce role checks (UservsAdmin). - Custom middleware applies request rate limiting and structured request logging (Serilog) on every call.
- CORS is locked down to the configured client origin.
Contributions and improvements are welcome β open an issue or a PR describing the change and its rationale.
Built with β€οΈ by Ester-Developer



