A comprehensive e-commerce platform built with the MERN stack, specifically designed for book retail with advanced features including payment integration, order management, and promotional systems.
Repository: https://github.com/kannan-innovates/chapterless
- Features
- Tech Stack
- Installation
- Configuration
- Project Structure
- API Documentation
- Admin Panel
- User Features
- Payment Integration
- Security Features
- Contributing
- Product Catalog: Comprehensive book inventory with categories, authors, and detailed descriptions
- Shopping Cart: Real-time cart management with quantity controls and price calculations
- Wishlist: Save products for later with bulk cart transfer functionality
- Search & Filter: Advanced product search with category and price filtering
- Product Recommendations: Top-selling and new arrival sections
- Multiple Payment Methods:
- Cash on Delivery (COD) with order value restrictions
- Razorpay integration for online payments
- Wallet payments with instant processing
- Smart Checkout: Multi-step checkout with address management
- Order Validation: Comprehensive order verification and processing
- Authentication System: Secure login/signup with email verification
- OTP Verification: Email-based OTP for account security
- Profile Management: Complete user profile with address management
- Password Security: Secure password change functionality
- Coupon Management:
- Fixed and percentage-based discounts
- Category and product-specific coupons
- Usage limits and expiry management
- Offer System:
- Product-specific offers
- Category-wide promotions
- Automatic discount calculations
- Referral Program:
- Unique referral codes for each user
- Wallet rewards for successful referrals (βΉ100 for referrer, βΉ50 for new user)
- Digital Wallet: Secure wallet with transaction history
- Refund Processing: Automatic refunds for cancellations and returns
- Transaction Tracking: Detailed transaction logs with pagination
- Balance Management: Real-time balance updates
- Order Tracking: Complete order lifecycle management
- Cancellation System:
- Full order cancellation
- Individual item cancellation
- Intelligent refund calculations
- Return Management:
- Return request system
- Admin approval workflow
- Automated refund processing
- Invoice Generation: PDF invoice download functionality
- Dashboard Analytics:
- Sales charts with multiple time filters
- Best-selling products, categories, and authors
- Revenue and order statistics
- User Management: User blocking/unblocking with search functionality
- Product Management: Complete CRUD operations with image upload
- Order Management: Order status updates and tracking
- Return Processing: Bulk return request handling
- Sales Reports: Excel and PDF export functionality
- Runtime: Node.js 18.x
- Framework: Express.js 4.x
- Database: MongoDB with Mongoose ODM
- Authentication: Express-session with secure configuration
- File Upload: Multer for image handling
- Payment: Razorpay integration
- Email: Nodemailer for OTP and notifications
- Template Engine: EJS (Embedded JavaScript)
- Styling: Bootstrap 5.x with custom CSS
- Icons: Bootstrap Icons & Remix Icons
- Charts: Chart.js for analytics
- Notifications: SweetAlert2 for user feedback
- Password Hashing: bcrypt
- Input Validation: Custom validation middleware
- Session Security: Secure session configuration
- CSRF Protection: Built-in security measures
- Node.js (v18.x or higher)
- MongoDB (v6.x or higher)
- npm or yarn package manager
-
Clone the repository
git clone https://github.com/kannan-innovates/chapterless.git cd chapterless -
Install dependencies
npm install
-
Environment Configuration Create a
.envfile in the root directory:PORT=3001 MONGODB_URI=mongodb://localhost:27017/chapterless SESSION_SECRET=your_session_secret_key # Razorpay Configuration RAZORPAY_KEY_ID=your_razorpay_key_id RAZORPAY_KEY_SECRET=your_razorpay_key_secret # Email Configuration EMAIL_USER=your_email@gmail.com EMAIL_PASS=your_app_password
-
Start the application
# Development mode npm run dev # Production mode npm start
-
Access the application
- User Interface:
http://localhost:3001 - Admin Panel:
http://localhost:3001/admin/adminLogin
- User Interface:
The application uses MongoDB with the following collections:
- Users (with admin roles)
- Products (books with categories)
- Orders (with item-level tracking)
- Carts & Wishlists
- Coupons & Offers
- Wallets (with transaction history)
- Referrals
Create an admin user in MongoDB:
{
fullName: "Admin User",
email: "admin@chapterless.com",
password: "hashed_password", // Use bcrypt
isAdmin: true,
isBlocked: false
}chapterless/
βββ controllers/ # Business logic
β βββ adminController/ # Admin panel controllers
β βββ userController/ # User-facing controllers
βββ models/ # MongoDB schemas
βββ routes/ # Express route definitions
β βββ adminRoutes/ # Admin panel routes
β βββ userRoutes/ # User-facing routes
βββ views/ # EJS templates
β βββ admin/ # Admin panel views
β βββ user/ # User interface views
β βββ partials/ # Reusable components
βββ middlewares/ # Custom middleware
βββ validators/ # Input validation
βββ helpers/ # Utility functions
βββ utils/ # Helper utilities
βββ config/ # Configuration files
βββ public/ # Static assets
β βββ assets/ # Images and media
β βββ styles/ # CSS files
β βββ js/ # Client-side JavaScript
βββ app.js # Application entry point
- Session Management: Secure session configuration with httpOnly cookies
- Password Security: bcrypt hashing with salt rounds
- Input Validation: Comprehensive server-side validation
- XSS Protection: Input sanitization and output encoding
- Authentication Middleware: Route-level access control
- Admin Protection: Separate admin authentication system
- Dashboard Analytics: Real-time sales and order statistics
- Best Sellers: Top 10 products, categories, and authors
- Sales Reports: Exportable reports in Excel and PDF formats
- User Analytics: User registration and activity tracking
- Revenue Tracking: Detailed financial reporting
- Offer Integration: Automatic application of best available offers
- Coupon Stacking: Intelligent coupon and offer combination
- Tax Calculation: 8% GST calculation on final amounts
- COD Restrictions: Orders above βΉ1000 require online payment
- Stock Tracking: Real-time inventory updates
- Product Variants: Support for different book editions
- Category Management: Hierarchical category system
- Image Management: Multiple product images with optimization
- Multi-step Checkout: Address β Payment β Confirmation
- Payment Verification: Razorpay signature validation
- Order States: Placed β Processing β Shipped β Delivered
- Cancellation Logic: Time-based cancellation rules
- Intelligent Calculations: Proportional refunds for partial cancellations
- Payment Method Aware: Different refund flows for COD vs Online payments
- Wallet Integration: Automatic wallet credits for eligible refunds
- Tax Handling: Proper tax refund calculations
- OTP Verification: 60-second expiry with resend functionality
- Masked Email Display: Privacy-focused email masking (abc***@example.com)
- Order Notifications: Automated order status updates
- Welcome Emails: New user onboarding
- Secure Sessions: httpOnly, secure cookie configuration
- Auto-logout: Session timeout handling
- Multi-device Support: Concurrent session management
- Cache Control: Proper browser cache headers
- Excel Reports: Comprehensive sales data in XLSX format
- PDF Generation: Professional invoice and report PDFs
- Date Range Filtering: Custom date range selections
- Bulk Operations: Mass data processing capabilities
- Database Indexing: Optimized MongoDB queries
- Image Optimization: Compressed image storage
- Pagination: Efficient data loading with pagination
- Caching: Strategic caching for frequently accessed data
- Lazy Loading: On-demand content loading
- Input Validation: Comprehensive server-side validation
- Error Handling: Graceful error management
- Logging: Detailed application logging
- Code Organization: Modular, maintainable code structure
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
For support and queries:
- GitHub Issues: Create an issue
- Email: Contact through GitHub profile
This project is licensed under the MIT License - see the LICENSE file for details.
- Bootstrap Team for the excellent UI framework
- MongoDB for the robust database solution
- Razorpay for seamless payment integration
- Node.js Community for the amazing ecosystem
Kannan S - GitHub Profile
Always curious, always improving
β If you found this project helpful, please give it a star!
Built with β€οΈ for book lovers everywhere