How hac1es/friendwithbooks-backend works
Project type and purpose
• This is a single‐project ASP.NET Core Web API backend (FriendwithBooksBackend) providing REST endpoints and real‐time chat for a “Friend with Books” application. Its controllers cover authentication, user profiles, book catalog, shopping cart, orders, payments, reviews, flash sales, and a SignalR chat hub.
File structure
• Top level:
• FriendwithBooksBackend.sln – Visual Studio solution
• Program.cs – application entry point
• Under FriendwithBooksBackend/:
• Controllers/ – HTTP API endpoints (AuthController, BookController, CartController, etc.)
• Hubs/ – SignalR Hub for real‐time chat (ChatHub.cs)
• Data/ – EF Core DbContext (DataContext.cs) and any DTOs
• Migrations/ – EF Core database migrations
• Models/ – Entity classes (Book, User, Order, Review, FlashSale, Transaction, etc.)
• Interfaces/ – Repository interfaces (IBookRepository, IUserRepository, etc.)
• Repositories/ – Concrete repository implementations using EF Core
• Services/ – Business logic and cross‐cutting services (CachingServices, ChatService, UserIDProvider)
• appsettings.json / appsettings.Development.json – configuration for database, caching, etc.
Detail
• Internal interactions (e.g., CartController → CartService → CartRepository → DataContext)