A full-featured e-commerce web application for managing and selling books online, built with ASP.NET Core MVC following clean architecture principles.
- Product Browsing: Browse books with detailed information including title, author, ISBN, description, and cover type
- Shopping Cart: Add books to cart with dynamic pricing based on quantity
- Tiered Pricing: Automatic price calculation (1-49 books, 50-99 books, 100+ books)
- Order Management: Place orders with detailed shipping information
- Order Tracking: View order status and payment status
- User Authentication: Register/login with email or social media (Facebook, Google)
- User Roles: Individual customers and company customers with different privileges
- Product Management: CRUD operations for books with image upload
- Category Management: Organize books by categories
- Cover Type Management: Manage different cover types (Hardcover, Paperback, etc.) with stored procedures
- Company Management: Manage authorized companies for B2B transactions
- User Management: Administer users and assign roles (Admin, Employee, Individual Customer, Company Customer)
- Order Management:
- View all orders with filtering capabilities
- Update order status (Pending, Approved, In Process, Shipped, Cancelled, Refunded)
- Process payments and manage payment status
- Update shipping details (carrier, tracking number)
- Cancel orders and process refunds
- Stripe Payment Gateway: Secure payment processing for individual customers
- Braintree Payment Gateway: Alternative payment processing option
- Delayed Payment: Company customers can pay within 30 days of order placement
- Email Notifications: SendGrid integration for transactional emails
- SMS Notifications: Twilio integration for order updates
The project follows Clean Architecture and Repository Pattern with clear separation of concerns:
BulkyBook/
β
βββ BulkyBookWeb/ # Presentation Layer (ASP.NET Core MVC)
β βββ Areas/
β β βββ Admin/ # Admin area controllers and views
β β βββ Customer/ # Customer area controllers and views
β β βββ Identity/ # Authentication and authorization
β βββ ViewModels/ # View-specific models
β βββ ViewComponents/ # Reusable UI components
β βββ wwwroot/ # Static files (CSS, JS, images)
β
βββ BulkyBook.DataAccess/ # Data Access Layer
β βββ Data/ # DbContext
β βββ Repositories/ # Repository pattern implementation
β βββ Migrations/ # EF Core migrations
β βββ Initializer/ # Database seeding and initialization
β
βββ BulkyBook.Entities/ # Domain Layer
β βββ Models # Domain entities (Product, Order, User, etc.)
β
βββ BulkyBook.Utilities/ # Cross-cutting Concerns
βββ Payment gateways # Stripe, Braintree integration
βββ Email service # SendGrid integration
βββ Helper classes # Static details, extensions
- Framework: ASP.NET Core 5.0 MVC
- Language: C# (.NET 5.0)
- ORM: Entity Framework Core 5.0
- Database: SQL Server (Azure SQL Database support)
- Authentication: ASP.NET Core Identity
- Design Patterns:
- Repository Pattern
- Unit of Work Pattern
- Dependency Injection
- View Engine: Razor Pages
- UI Framework: Bootstrap
- JavaScript: jQuery
- Rich Text Editor: TinyMCE (for product descriptions)
- DataTables: For advanced table features
- Payment Processing:
- Stripe.net (v39.91.0)
- Braintree
- Email Service: SendGrid
- SMS Service: Twilio (v5.72.1)
- Social Authentication:
- Facebook Authentication
- Google Authentication
- IDE: Visual Studio 2022
- Version Control: Git
- Package Manager: NuGet
The application uses the following main entities:
- Product: Books with pricing tiers, categories, and cover types
- Category: Book categories
- CoverType: Cover type classification (with stored procedures)
- Company: B2B customer companies
- ApplicationUser: Extended identity user with company association
- ShoppingCart: User shopping cart items
- OrderHeader: Order master data
- OrderDetails: Order line items
- .NET 5.0 SDK or later
- SQL Server (LocalDB, Express, or Azure SQL Database)
- Visual Studio 2022 (recommended) or VS Code
- Git
-
Clone the repository
git clone https://github.com/tofigamraslanov/book-store.git cd book-store -
Update database connection string
Edit
appsettings.jsonin theBulkyBookWebproject:"ConnectionStrings": { "DefaultConnection": "Server=YOUR_SERVER;Database=BulkyBook;Trusted_Connection=True;MultipleActiveResultSets=true" }
-
Configure third-party services (Optional)
Update the following sections in
appsettings.json:- Stripe keys (for payment processing)
- SendGrid key (for email notifications)
- Twilio credentials (for SMS notifications)
- Facebook/Google OAuth credentials (for social login)
-
Restore NuGet packages
dotnet restore
-
Apply database migrations
dotnet ef database update --project BulkyBook.DataAccess --startup-project BulkyBookWeb
-
Run the application
dotnet run --project BulkyBookWeb
-
Access the application
Navigate to
https://localhost:5001in your browser
The application includes a database initializer that creates default users and roles. Check DbInitializer.cs for default credentials.
- ASP.NET Core Identity: Secure user authentication and authorization
- Role-Based Access Control: Multiple user roles with different permissions
- HTTPS Enforcement: Secure communication
- Password Hashing: Secure password storage
- Anti-Forgery Tokens: CSRF protection
- Session Management: Secure session handling with cookies
The application is fully responsive and works seamlessly on:
- Desktop computers
- Tablets
- Mobile devices
- Add/remove items
- Update quantities
- Real-time price calculation
- Session-based cart persistence
- Customer adds items to cart
- Reviews cart and proceeds to checkout
- Enters/confirms shipping information
- Selects payment method
- Completes payment (immediate for individuals, delayed for companies)
- Order confirmation and email notification
- Admin processes and ships order
- Customer receives tracking information
- Individual Customers: Pay via Stripe at checkout
- Company Customers: Receive 30-day payment terms
- Payment Status Tracking: Pending β Approved/Rejected
- Refund Processing: Available for cancelled orders
Contributions, issues, and feature requests are welcome!
This project is licensed under the MIT License.
Tofig Amraslanov
- GitHub: @tofigamraslanov
- Built following clean architecture principles
- Implements industry-standard design patterns
- Uses modern ASP.NET Core best practices
β Star this repository if you find it helpful!