Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎟️ Chinese Auction System

A full-stack raffle & fundraising platform

Angular 20 + .NET 8 Web API application for running a Chinese auction: donors contribute gifts, users buy tickets, admins manage everything and draw winners

Angular .NET EF Core SQL Server JWT PrimeNG License


πŸ“Έ App Screenshots

User Experience

Gifts Catalog Login Page
Gifts User Login Page

Administrative Dashboard

Manage Gifts Manage Purchases
Manage Gifts Manage Purchases

πŸ“– About the Project

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.


πŸš€ Key Features

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

🧱 Tech Stack

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)

πŸ—‚οΈ Project Structure

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

βš™οΈ Prerequisites


🧩 Setup & Run β€” Server

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 /swagger in development.

πŸ–₯️ Setup & Run β€” Client

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.


πŸ§ͺ Tests

# Server unit tests
cd server/ChineseSaleApi.Tests
dotnet test

# Client unit tests
cd client/my-app
npm test

πŸ“¦ Production Build

# 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.


πŸ” Security Notes

  • Authentication is JWT-based; protected endpoints require a valid Bearer token and enforce role checks (User vs Admin).
  • Custom middleware applies request rate limiting and structured request logging (Serilog) on every call.
  • CORS is locked down to the configured client origin.

🀝 Contributing

Contributions and improvements are welcome β€” open an issue or a PR describing the change and its rationale.


Built with ❀️ by Ester-Developer

About

🎟️ Full-stack Chinese auction (raffle) platform β€” Angular 20 + .NET 8 Web API, EF Core/SQL Server, JWT auth with roles, and an admin dashboard for gifts, donors, and ticket purchases.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages