A modern, full-featured e-commerce web application specifically designed for gaming enthusiasts. Built with Node.js, Express.js, MongoDB, and EJS, GameNation provides a comprehensive platform for buying and selling gaming products online.
Visit the live application: gamenation.online
- Features
- Tech Stack
- Project Structure
- Installation
- Configuration
- Usage
- API Documentation
- Database Schema
- Contributing
- License
-
User Authentication & Authorization
- User registration and login
- Google OAuth integration
- Password reset functionality
- Session management
-
Product Management
- Browse gaming products by categories
- Advanced product search and filtering
- Product reviews and ratings
- Wishlist functionality
- Product image gallery
-
Shopping Experience
- Shopping cart management
- Multiple address management
- Order tracking and history
- Coupon and discount system
- Wallet payment integration
-
Payment Processing
- Razorpay payment gateway integration
- Wallet payment system
- Secure checkout process
- Order confirmation emails
-
Dashboard
- Sales analytics and reporting
- User management
- Order management with status updates
-
Product Management
- Add, edit, and delete products
- Category management
- Image upload with Cloudinary integration
- Inventory tracking
-
Order & Sales Management
- Order processing and status updates
- PDF invoice generation
- Sales reports (Excel export)
- Customer management
-
Marketing Tools
- Coupon creation and management
- Offer and discount management
- Email notifications
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB with Mongoose ODM
- Template Engine: EJS
- Authentication: Passport.js (Local & Google OAuth)
- Session Management: Express-session
- Styling: Tailwind CSS
- JavaScript: Vanilla JS with SweetAlert2
- Layouts: Express-EJS-Layouts
- Image Storage: Cloudinary
- Payment Gateway: Razorpay
- Email Service: Nodemailer
- PDF Generation: PDFKit
- Excel Export: XLSX
- Process Manager: Nodemon
- Security: Bcrypt for password hashing
- File Upload: Multer
- Cache Control: NoCache middleware
GameNation/
├── config/ # Configuration files
│ └── db.mjs # Database connection
├── constants/ # Application constants
├── controller/ # Route controllers
│ ├── adminController/ # Admin-related controllers
│ └── userController/ # User-related controllers
├── middleware/ # Custom middleware
├── model/ # Database schemas
│ ├── addressSchema.mjs # User address model
│ ├── cartSchema.mjs # Shopping cart model
│ ├── categorySchema.mjs # Product category model
│ ├── couponSchema.mjs # Coupon/discount model
│ ├── offerSchema.mjs # Special offers model
│ ├── orderSchema.mjs # Order management model
│ ├── productSchema.mjs # Product model
│ ├── userSchema.mjs # User model
│ ├── walletSchema.mjs # User wallet model
│ └── wishListSchema.mjs # Wishlist model
├── public/ # Static assets
│ ├── css/ # Compiled CSS files
│ ├── js/ # Client-side JavaScript
│ └── images/ # Static images
├── routes/ # Route definitions
│ ├── adminRoutes.mjs # Admin routes
│ └── userRoutes.mjs # User routes
├── services/ # Business logic services
│ └── auth.mjs # Authentication service
├── src/ # Source files
│ └── tailwind.css # Tailwind source
├── uploads/ # File uploads directory
├── views/ # EJS templates
│ └── layouts/ # Layout templates
├── .env # Environment variables
├── .gitignore # Git ignore rules
├── app.mjs # Main application file
├── package.json # Dependencies and scripts
└── tailwind.config.js # Tailwind configuration
- Node.js (v14 or higher)
- MongoDB (v4.4 or higher)
- npm or yarn package manager
-
Clone the repository
git clone https://github.com/ajaypalamkunnel/GameNation.git cd GameNation -
Install dependencies
npm install
-
Set up environment variables Create a
.envfile in the root directory:# Database MONGODB_URI=mongodb://localhost:27017/gamenation # Server PORT=3000 # Session Secret SESSION_SECRET=your_session_secret_here # Google OAuth GOOGLE_CLIENT_ID=your_google_client_id GOOGLE_CLIENT_SECRET=your_google_client_secret # Cloudinary CLOUDINARY_CLOUD_NAME=your_cloudinary_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_api_secret # Razorpay RAZORPAY_KEY_ID=your_razorpay_key_id RAZORPAY_KEY_SECRET=your_razorpay_key_secret # Email (Nodemailer) EMAIL_USER=your_email@gmail.com EMAIL_PASS=your_email_password
-
Build Tailwind CSS
npm run build
-
Start the application
# Development mode npm run dev # Production mode npm start
-
Access the application Open your browser and navigate to
http://localhost:3000
Ensure MongoDB is running on your system. The application will automatically connect to the database specified in your .env file.
- Cloudinary: Sign up at cloudinary.com for image storage
- Razorpay: Create an account at razorpay.com for payment processing
- Google OAuth: Set up OAuth credentials in Google Console
- Registration/Login: Create an account or log in with existing credentials
- Browse Products: Explore gaming products by categories
- Shopping: Add items to cart, apply coupons, and proceed to checkout
- Payment: Complete purchase using Razorpay or wallet
- Order Tracking: Monitor order status and download invoices
- Admin Login: Access admin panel with administrator credentials
- Product Management: Add/edit products, manage categories and inventory
- Order Management: Process orders, update status, and generate reports
- User Management: Monitor user activities and manage accounts
- Analytics: View sales reports and export data
POST /register- User registrationPOST /login- User loginGET /logout- User logoutGET /auth/google- Google OAuth login
GET /home- Home pageGET /products- Product listingGET /product/:id- Product detailsPOST /cart/add- Add to cartPOST /order/create- Create order
GET /admin/dashboard- Admin dashboardPOST /admin/product/add- Add new productGET /admin/orders- Manage ordersGET /admin/users- User management
- User: User authentication and profile information
- Product: Gaming product details with categories
- Cart: Shopping cart items for each user
- Order: Order information and status tracking
- Category: Product categorization
- Coupon: Discount and promotion codes
- Wallet: User wallet for transactions
- Wishlist: User's saved favorite products
We welcome contributions to GameNation! Please follow these steps:
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Commit your changes
git commit -m 'Add some amazing feature' - Push to the branch
git push origin feature/amazing-feature
- Open a Pull Request
- Follow the existing code style and structure
- Write meaningful commit messages
- Test your changes thoroughly
- Update documentation as needed
This project is licensed under the ISC License. See the LICENSE file for details.
Ajay Palamkunnel - GitHub Profile
- Express.js community for the robust web framework
- MongoDB team for the flexible database solution
- Tailwind CSS for the utility-first CSS framework
- All contributors who helped improve this project
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed information
- Contact the maintainer through GitHub
⭐ Star this repository if you found it helpful!
Made with ❤️ for the gaming community