A Modern Full-Stack E-Commerce Platform Built with Next.js 14 & Firebase
Empowering seamless digital shopping experiences with cutting-edge web technologies
Live Demo β’ Report Bug β’ Request Feature
- About The Project
- Key Features
- Tech Stack
- Getting Started
- Project Structure
- Usage
- Deployment
- API Documentation
- Contributing
- License
- Contact
- Acknowledgments
BeyondBazaar is a production-ready, full-featured e-commerce platform designed for scalability and performance. Built with modern web technologies, it provides a complete shopping ecosystem from product discovery to order fulfillment.
- π Lightning Fast: Server-side rendering with Next.js 14 App Router
- π Secure: JWT authentication with Firebase integration
- π± Responsive: Mobile-first design with Tailwind CSS
- π¨ Modern UI: Clean interface with ShadCN UI components
- π Real-time: Live updates using Firebase Firestore
- π³ Payment Ready: Integrated with Cashfree & Zwitch
- π Admin Panel: Comprehensive dashboard for store management
- π§ͺ Type-Safe: Full TypeScript support
-
π Shopping Cart
- Add/remove products with real-time stock validation
- Persistent cart across sessions
- Quick checkout flow
-
π Product Discovery
- Advanced filtering and search
- Category-based navigation
- Product variants (size, color, etc.)
-
π³ Secure Checkout
- Multiple payment gateways (Cashfree, Zwitch)
- Order tracking with status updates
- Invoice generation and download
-
π¨βπΌ User Dashboard
- Order history and tracking
- Profile management
- Multiple delivery addresses
- Wishlist functionality
- Email/Password login with verification
- Phone OTP verification via Firebase
- JWT-secured API routes
- Session management with refresh tokens
- Password reset functionality
-
Product Management
- CRUD operations for products
- Bulk upload via CSV
- Image management with Firebase Storage
- Stock level tracking
- Product variants management
-
Order Management
- View and update order status
- Customer details and shipping info
- Order analytics and reports
-
Content Management
- Hero slider configuration
- Category management
- Banner and promotional content
- SEO metadata control
-
Analytics Dashboard
- Sales statistics
- Revenue tracking
- Customer insights
- Product performance metrics
- TypeScript for type safety
- Modular architecture
- Centralized API layer with Axios
- Custom hooks for reusable logic
- Error boundary components
- SEO optimized with Next.js metadata API
- CI/CD pipeline with GitHub Actions
- Framework: Next.js 14 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- State Management: Redux Toolkit
- UI Components: ShadCN UI, Lucide Icons
- Animations: Framer Motion
- Forms: React Hook Form + Zod validation
- API: Next.js API Routes
- Database: Firebase Firestore
- Authentication: Firebase Auth
- Storage: Firebase Storage
- HTTP Client: Axios with interceptors
- Cashfree Payment Gateway
- Zwitch Payment System
- CI/CD: GitHub Actions
- Process Manager: PM2
- Web Server: Nginx
- Hosting: VPS (Virtual Private Server)
- Monitoring: PM2 Logs
Ensure you have the following installed:
Node.js >= 18.0.0
npm >= 9.0.0
# or
yarn >= 1.22.0- Clone the repository
git clone https://github.com/guptaashish2003/beyondbazaar.git
cd beyondbazaar- Install dependencies
npm install
# or
yarn install- Set up environment variables
Create a .env.local file in the root directory (see Environment Setup)
- Run the development server
npm run dev
# or
yarn dev- Open your browser
Navigate to http://localhost:3000
Create a .env.local file with the following variables:
# App Configuration
NODE_ENV=development
FRONTENDURL=http://localhost:3000
BASEURL=http://localhost:3000/api
# Firebase Configuration
APIKEY=your_firebase_api_key
APP_ID=your_firebase_app_id
MESSAGING_ID=your_firebase_messaging_sender_id
# Database
DB_URI=your_mongodb_uri
# Authentication
JWT_SECRET_KEY=your_jwt_secret
JWT_ALGORITHM=HS256
JWT_EXPIRES_IN=7d
JWT_COOKIE_EXPIRE=7
NEXTAUTH_SECRET=your_nextauth_secret
# Payment Gateways
CLIENT_ID=your_cashfree_client_id
CLIENT_SECRET=your_cashfree_client_secret
# Email Configuration
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USER=your_email@gmail.com
EMAIL_PASSWORD=your_email_password
# Third-party APIs
GOOGLE_AUTH_API_KEY=your_google_api_key
BIGDATACLOUDKEY=your_bigdatacloud_key
BGDATAURL=https://api.bigdatacloud.net
# File Upload
UPLOADTHING_APP_ID=your_uploadthing_app_id
UPLOADTHING_SECRET=your_uploadthing_secret
β οΈ Security Note: Never commit your.env.localfile to version control. Add it to.gitignore.
beyondbazaar/
βββ app/
β βββ (auth)/ # Authentication routes
β β βββ login/
β β βββ register/
β β βββ verify-otp/
β βββ (dashboard)/ # User dashboard
β β βββ orders/
β β βββ profile/
β β βββ addresses/
β βββ admin/ # Admin panel
β β βββ products/
β β βββ orders/
β β βββ sliders/
β β βββ analytics/
β βββ api/ # API routes
β β βββ auth/
β β βββ products/
β β βββ orders/
β β βββ payments/
β βββ products/ # Product pages
β βββ cart/ # Shopping cart
β βββ checkout/ # Checkout flow
β βββ layout.tsx
β βββ page.tsx
β
βββ components/
β βββ layout/
β β βββ Navbar.tsx
β β βββ Footer.tsx
β β βββ Sidebar.tsx
β βββ products/
β β βββ ProductCard.tsx
β β βββ ProductGrid.tsx
β β βββ ProductDetails.tsx
β βββ cart/
β β βββ CartItem.tsx
β β βββ CartSummary.tsx
β βββ forms/
β β βββ ...form components
β βββ ui/ # ShadCN UI components
β
βββ lib/
β βββ firebase.ts # Firebase configuration
β βββ axios.ts # Axios instance & interceptors
β βββ jwt.ts # JWT utilities
β βββ utils.ts # Helper functions
β βββ validators.ts # Zod schemas
β
βββ store/ # Redux store
β βββ slices/
β β βββ authSlice.ts
β β βββ cartSlice.ts
β β βββ productSlice.ts
β βββ store.ts
β
βββ types/ # TypeScript type definitions
βββ hooks/ # Custom React hooks
βββ styles/
β βββ globals.css
βββ public/
β βββ images/
β βββ icons/
βββ .env.local.example
βββ next.config.mjs
βββ tailwind.config.ts
βββ tsconfig.json
βββ package.json
npm run test
# or
yarn testnpm run build
npm start
# or
yarn build
yarn startnpm run lint
# or
yarn lint- Build the application
npm run build- Start with PM2
pm2 start npm --name "beyondbazaar" -- start
pm2 save
pm2 startup- Configure Nginx
server {
listen 80;
server_name beyondbazaar.in www.beyondbazaar.in;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}- SSL with Certbot
sudo certbot --nginx -d beyondbazaar.in -d www.beyondbazaar.inThe project includes a GitHub Actions workflow for automated deployment:
# .github/workflows/deploy.yml
name: Deploy to Production
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
env:
NODE_ENV: production
- name: Deploy to VPS
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USER }}
key: ${{ secrets.VPS_SSH_KEY }}
script: |
cd /var/www/beyondbazaar
git pull origin main
npm ci
npm run build
pm2 restart beyondbazaarPOST /api/auth/register // Register new user
POST /api/auth/login // Login user
POST /api/auth/verify-otp // Verify phone OTP
POST /api/auth/logout // Logout user
POST /api/auth/refresh // Refresh access tokenGET /api/products // Get all products
GET /api/products/:id // Get single product
POST /api/products // Create product (Admin)
PUT /api/products/:id // Update product (Admin)
DELETE /api/products/:id // Delete product (Admin)GET /api/orders // Get user orders
POST /api/orders // Create new order
GET /api/orders/:id // Get order details
PUT /api/orders/:id // Update order status (Admin)For detailed API documentation, visit the API Docs (if available).
Contributions are what make the open-source community amazing! Any contributions you make are greatly appreciated.
- Fork the Project
- Create your 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
- Follow the existing code style
- Write meaningful commit messages
- Add tests for new features
- Update documentation as needed
Distributed under the MIT License. See LICENSE file for more information.
Ashish Gupta
- π AIML Student | Full Stack Developer
- π Delhi, India
- π§ Email: guptaashish2003@gmail.com
- πΌ LinkedIn: linkedin.com/in/ashish-gupta
- π Portfolio: ashishgupta.dev
- π GitHub: @guptaashish2003
Project Link: https://github.com/guptaashish2003/beyondbazaar
Special thanks to the following technologies and communities:
- Next.js - The React Framework for Production
- Firebase - Backend-as-a-Service platform
- Vercel - Deployment and hosting
- Tailwind CSS - Utility-first CSS framework
- ShadCN UI - Re-usable components
- Redux Toolkit - State management
- TypeScript - JavaScript with syntax for types
- Lucide Icons - Beautiful & consistent icons
β If you found this project helpful, please consider giving it a star!
Made with β€οΈ by Ashish Gupta