3legant is a modern e-commerce platform built with the MERN stack, offering a seamless shopping experience with a responsive frontend and a secure backend. It features advanced product filtering, a shopping cart, user authentication, and an admin dashboard for efficient store management.
- React 19 - Latest version with improved performance and features
- Vite - Next-generation frontend tooling with instant HMR
- Tailwind CSS - Utility-first CSS framework for rapid UI development
- Radix UI - Unstyled, accessible components for building high-quality design systems
- Zustand - Lightweight state management with minimal boilerplate
- React Router - Declarative routing for React applications
- Node.js - JavaScript runtime for server-side development
- Express - Fast, unopinionated web framework for Node.js
- MongoDB - NoSQL database for flexible data storage
- Mongoose - Elegant MongoDB object modeling
- JWT - Secure authentication and authorization
- Bcrypt - Password hashing for security
-
Responsive Design
- Mobile-first approach
- Fluid layouts and breakpoints
- Touch-friendly interactions
-
Product Management
- Advanced search and filtering
- Dynamic product categories
- Real-time inventory updates
-
User Experience
- Intuitive shopping cart
- Wishlist functionality
- Seamless checkout process
- Order tracking
-
Authentication
- Secure user registration/login
- Social media authentication
- Password recovery
-
Dashboard Analytics
- Sales overview and trends
- Revenue analytics
- Customer insights
-
Product Management
- Bulk product operations
- Category management
- Inventory tracking
- Image optimization
-
Order Management
- Order status updates
- Payment processing
- Shipping integration
-
Customer Management
- Customer profiles
- Purchase history
- Communication tools
-
API Architecture
- RESTful endpoints
- GraphQL support (planned)
- API versioning
- Rate limiting
-
Security
- JWT authentication
- Role-based access control
- Input validation
- XSS protection
-
Data Management
- CRUD operations
- Data validation
- Error handling
- Logging system
3legant/
├── client/ # React frontend
│ ├── src/
│ │ ├── assets/ # Static resources
│ │ ├── components/ # Reusable UI components
│ │ ├── hooks/ # Custom React hooks
│ │ ├── layout/ # Layout components
│ │ ├── lib/ # Third-party library configs
│ │ ├── pages/ # Page components
│ │ ├── routers/ # Route configurations
│ │ ├── store/ # State management
│ │ └── utils/ # Utility functions
│ ├── public/ # Public assets
│ └── vite.config.js # Vite configuration
│
└── server/ # Node.js backend
├── config/ # App configuration
├── controllers/ # Request handlers
├── models/ # Database schemas
├── routes/ # API routes
├── middlewares/ # Custom middlewares
├── utils/ # Helper functions
└── validators/ # Input validation
VITE_API_URL=http://localhost:5000
VITE_STRIPE_PUBLIC_KEY=your_stripe_public_key
VITE_GA_TRACKING_ID=your_ga_tracking_id
PORT=5000
MONGO_URI=mongodb://localhost:27017/3legant
JWT_SECRET=your_jwt_secret_key
JWT_EXPIRE=7d
STRIPE_SECRET_KEY=your_stripe_secret_key
CLOUD_NAME=your_cloudinary_cloud_name
CLOUD_API_KEY=your_cloudinary_api_key
CLOUD_API_SECRET=your_cloudinary_api_secret
- Node.js 18+
- npm or yarn
- MongoDB Atlas account or local MongoDB instance
- Git
-
Clone the repository:
git clone https://github.com/Nainee99/3legant-platform.git cd 3legant-platform
-
Install dependencies:
# Install client dependencies cd client npm install # Install server dependencies cd ../server npm install
-
Set up environment variables:
- Copy
.env.example
to.env
in both client and server directories - Update the variables with your configuration
- Copy
-
Start the development servers:
# Terminal 1: Start client cd client npm run dev # Terminal 2: Start server cd server npm run dev
-
Access the application:
- Frontend:
http://localhost:5173
- Backend API:
http://localhost:5000
- Frontend:
POST /api/auth/register
- User registrationPOST /api/auth/login
- User loginPOST /api/auth/logout
- User logoutGET /api/auth/me
- Get current user
GET /api/products
- Get all productsGET /api/products/:id
- Get single productPOST /api/products
- Create product (Admin)PUT /api/products/:id
- Update product (Admin)DELETE /api/products/:id
- Delete product (Admin)
POST /api/orders
- Create orderGET /api/orders
- Get user ordersGET /api/orders/:id
- Get order detailsPUT /api/orders/:id
- Update order status (Admin)
-
Build the frontend:
cd client npm run build
-
Deploy to hosting platforms:
- Vercel: Connect repository and deploy
- Netlify: Upload dist folder or connect repository
- AWS S3: Upload dist folder and configure CloudFront
-
Prepare for production:
cd server npm run build
-
Deploy to cloud platforms:
- Heroku: Connect repository and configure environment
- AWS EC2: Set up Node.js environment and PM2
- Digital Ocean: Deploy using App Platform
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a pull request
- Follow the existing code style and conventions
- Write meaningful commit messages
- Add appropriate documentation
- Include tests for new features
- Update README.md if needed
This project is licensed under the MIT License - see the LICENSE file for details.