A backend system built with ASP.NET Core Web API for an Air Conditioner platform that helps users browse AC products, calculate the suitable cooling capacity for their rooms, submit purchase requests, and interact with a simple chatbot assistant. The project uses ASP.NET Core Identity, JWT Authentication, Entity Framework Core, and SQL Server.
- User registration and login
- JWT-based authentication
- Role-based authorization with
AdminandUser - Air Conditioner product management
- Room cooling load calculation
- Product recommendation based on room calculation
- Purchase request workflow with admin approval
- Chatbot for basic AC guidance
- Admin dashboard with analytics
- Swagger/OpenAPI for API testing
- ASP.NET Core Web API
- Entity Framework Core
- SQL Server
- ASP.NET Core Identity
- JWT Authentication
- AutoMapper
- Swagger / Swashbuckle
Contains:
- Entities
- Repository interfaces
- Unit of Work interface
Contains:
- DTOs
- Service interfaces
- Business logic
- Mapping profiles
Contains:
- EF Core DbContext
- Fluent API configurations
- Identity user model
- Repository implementations
Contains:
- Controllers
- Dependency injection setup
- Authentication configuration
- Swagger configuration
- Application startup
- Register
- Login
- JWT token generation
The system is specialized in Air Conditioners only. Each product includes:
- ProductId
- Brand
- Model
- CoolingCapacity
- Price
- Description
- StockQuantity
Users can calculate the required AC capacity using:
- Length
- Width
- Height
- ThermalFactor Formula:
- If
ThermalFactor = true
CoolingLoad = Length × Width × Height × 300 - If
ThermalFactor = false
CoolingLoad = Length × Width × Height × 250The API returns: - RoomVolume
- CoolingLoad
- RecommendedCapacity
Users do not directly purchase products instantly. Instead:
- The user creates a purchase request
- The order is stored with status
Pending - Admin reviews the request
- Admin can:
- Accept
- Reject
- User sees the updated status in their orders list Possible statuses:
- Pending
- Accepted
- Rejected
Users can send questions to the chatbot and receive responses. Messages are stored in the database for later analysis.
The admin can access:
- Total users
- Total products
- Total sales
- Total revenue
- Best selling products
- Sales per month
- Top customers
- Pending purchase requests
Can:
- Create users
- Delete users
- Manage products
- View all sales
- View sales by user
- Review pending orders
- Accept or reject orders
- View dashboard analytics
Can:
- Register
- Login
- View products
- Calculate room cooling needs
- Create purchase requests
- View their order history
- Chat with the chatbot
ApplicationUserProductRoomCalculationSaleChatMessage
POST /api/auth/registerPOST /api/auth/login
GET /api/productGET /api/product/{id}GET /api/product/brand/{brand}GET /api/product/recommended?coolingLoad=valuePOST /api/productAdmin onlyPUT /api/product/{id}Admin onlyDELETE /api/product/{id}Admin only
POST /api/room/calculateGET /api/room/my-calculations
POST /api/salesGET /api/sales/myGET /api/salesAdmin onlyGET /api/sales/user/{userId}Admin only
POST /api/chatbot/messageGET /api/chatbot/history
GET /api/admin/dashboardGET /api/admin/usersPOST /api/admin/usersDELETE /api/admin/users/{userId}GET /api/admin/salesGET /api/admin/sales/user/{userId}GET /api/admin/orders/pendingPUT /api/admin/orders/{saleId}/acceptPUT /api/admin/orders/{saleId}/reject
Make sure you have installed:
- .NET 8 SDK
- SQL Server
- Visual Studio 2022 or VS Code
Update your connection string in appsettings.json:
"ConnectionStrings": {
"DefaultConnection": "Server=YOUR_SERVER_NAME;Database=GraduationProjectDb;Trusted_Connection=True;TrustServerCertificate=True"
}
Also configure JWT settings if needed:
"Jwt": {
"Key": "YourSuperSecretKeyThatIsAtLeast32CharactersLong!",
"Issuer": "GraduationProjectAPI",
"Audience": "GraduationProjectClient",
"ExpireHours": "24"
}