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 --open
The 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 production
Serve 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



