A full-featured, microservices-based e-commerce platform built with Node.js, React, and MongoDB. The platform supports both customer and seller experiences with real-time AI-powered shopping assistance.
- Overview
- Architecture
- Tech Stack
- Services
- Features
- API Reference
- Getting Started
- Docker Setup
- Environment Variables
- Testing
- Project Structure
Mino is a modern e-commerce platform designed with a microservices architecture. It provides:
- Customer Portal: Browse products, manage cart, place orders, and chat with AI assistant
- Seller Dashboard: Manage products, track orders, view analytics
- Real-time Notifications: Email notifications for user registration and product listings
- AI Shopping Assistant: Powered by Google Gemini AI with LangChain integration
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend Applications β
β βββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββ β
β β Frontend User (5173) β β Frontend Seller (5174) β β
β β React + Vite + Redux β β React + Vite + Redux β β
β βββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Backend Microservices β
β βββββββββββ βββββββββββ βββββββββββ βββββββββββ βββββββββββ ββββββββββββ β
β β Auth β β Product β β Cart β β Order β β Seller β β AI Buddy β β
β β :3000 β β :3001 β β :3002 β β :3003 β β :3007 β β :3005 β β
β ββββββ¬βββββ ββββββ¬βββββ ββββββ¬βββββ ββββββ¬βββββ ββββββ¬βββββ ββββββ¬ββββββ β
β β β β β β β β
β βββββββββββββ΄ββββββββββββ΄ββββββ¬ββββββ΄ββββββββββββ΄ββββββββββββ β
β β β
β ββββββββββββΌβββββββββββ β
β β RabbitMQ β β
β β Message Broker β β
β β :5672 β β
β ββββββββββββ¬βββββββββββ β
β β β
β ββββββββββββΌβββββββββββ β
β β Notification β β
β β :3006 β β
β βββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Data Layer β
β βββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββ β
β β MongoDB :27017 β β Redis :6379 β β
β β (Primary Database) β β (Session/Cache Store) β β
β βββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Services communicate asynchronously via RabbitMQ:
| Queue Name | Publisher | Consumer | Purpose |
|---|---|---|---|
Auth_Notification.USER_CREATED |
Auth | Notification | Welcome emails |
AUTH_SELLER_DASHBOARD.USER_CREATED |
Auth | Seller Dashboard | Sync user data |
PRODUCT_CREATED |
Product | Seller Dashboard | Sync product data |
Product_Notification.PRODUCT_CREATED |
Product | Notification | Product live emails |
ORDER_SELLER_DASHBOARD.ORDER_CREATED |
Order | Seller Dashboard | Sync order data |
| Technology | Purpose |
|---|---|
| Node.js | Runtime environment |
| Express 5 | Web framework |
| MongoDB + Mongoose | Database & ODM |
| Redis (ioredis) | Caching & session management |
| RabbitMQ (amqplib) | Message broker |
| JWT | Authentication |
| bcryptjs | Password hashing |
| Nodemailer | Email notifications |
| LangChain + Google Gemini | AI shopping assistant |
| Socket.io | Real-time communication |
| ImageKit | Image storage & CDN |
| Multer | File uploads |
| Technology | Purpose |
|---|---|
| React 19 | UI library |
| Vite 7 | Build tool |
| Redux Toolkit | State management |
| React Router 7 | Routing |
| Tailwind CSS 4 | Styling |
| Axios | HTTP client |
| Socket.io Client | Real-time communication |
| Technology | Purpose |
|---|---|
| Docker | Containerization |
| Jest | Testing framework |
| Supertest | API testing |
| MongoDB Memory Server | In-memory DB for tests |
User authentication and authorization service.
Features:
- User registration with role support (user/seller)
- Login with JWT token (httpOnly cookies)
- Session management
- Address management (CRUD)
- Redis-based token blacklisting
Product catalog management.
Features:
- Create products with image upload (ImageKit CDN)
- Full-text search on title and description
- Price range filtering
- Pagination support
- Seller-specific product management
Shopping cart management.
Features:
- Add items to cart
- Update item quantities
- Get cart contents
- Per-user cart isolation
Order processing and management.
Features:
- Create orders from cart
- Order status management (PENDING β CONFIRMED β SHIPPED β DELIVERED)
- Order cancellation
- Shipping address management
- Pagination support
Email notification service.
Features:
- Welcome emails on registration
- Product listing confirmation emails
- Gmail OAuth2 integration
- Queue-based message processing
Seller analytics and order management.
Features:
- Dashboard metrics (products, orders, revenue)
- Order management with status updates
- Product listing view
- Synced data via message queues
AI-powered shopping assistant.
Features:
- Real-time chat via WebSocket
- Product search capability
- Add to cart functionality
- Powered by Google Gemini 2.0 Flash
- LangGraph agent architecture
- π Secure authentication with JWT
- ποΈ Browse and search products
- π Shopping cart management
- π¦ Order placement and tracking
- π Multiple shipping addresses
- π€ AI shopping assistant
- π± Responsive design
- π Sales dashboard with metrics
- π¦ Product management (CRUD)
- πΌοΈ Image upload with CDN
- π Order management
- π Order status updates
- π Analytics overview
- ποΈ Microservices architecture
- π¨ Async messaging with RabbitMQ
- ποΈ MongoDB with text indexing
- β‘ Redis caching
- π³ Docker containerization
- π§ͺ Automated testing
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| POST | /register |
Register new user | β |
| POST | /login |
Login user | β |
| GET | /me |
Get current user | β |
| GET | /logout |
Logout user | β |
| GET | /users/me/addresses |
Get user addresses | β |
| POST | /users/me/addresses |
Add address | β |
| DELETE | /users/me/addresses/:id |
Delete address | β |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| GET | / |
List products (with filters) | β |
| GET | /:id |
Get product by ID | β |
| POST | / |
Create product | β (seller/admin) |
| PATCH | /:id |
Update product | β (seller) |
| DELETE | /:id |
Delete product | β (seller) |
| GET | /seller |
Get seller's products | β (seller) |
Query Parameters:
q- Search query (full-text search)miniprice- Minimum price filtermaxprice- Maximum price filterskip- Pagination offsetlimit- Results limit (max 20)
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| GET | / |
Get user's cart | β |
| POST | /items |
Add item to cart | β |
| PATCH | /items/:productId |
Update item quantity | β |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| POST | / |
Create order from cart | β |
| GET | /me |
Get user's orders | β (admin) |
| GET | /:id |
Get order by ID | β |
| POST | /:id/cancel |
Cancel order | β |
| PATCH | /:id/address |
Update order address | β |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| GET | /matrics |
Get dashboard metrics | β (seller) |
| GET | /orders |
Get seller's orders | β (seller) |
| GET | /orders/:orderId |
Get order details | β (seller) |
| PATCH | /orders/:orderId/status |
Update order status | β (seller) |
| GET | /products |
Get seller's products | β (seller) |
- Node.js v20+
- MongoDB v8+
- Redis
- RabbitMQ
- npm or yarn
- Clone the repository
git clone <repository-url>
cd Mino-Project- Install dependencies for all services
# Backend services
cd auth && npm install && cd ..
cd product && npm install && cd ..
cd cart && npm install && cd ..
cd order && npm install && cd ..
cd notification && npm install && cd ..
cd seller-dashbord && npm install && cd ..
cd ai-buddy && npm install && cd ..
# Frontend applications
cd frontend-user && npm install && cd ..
cd frontend-seller && npm install && cd ..- Set up environment variables
Create .env files in each service directory:
Auth Service (.env)
PORT=3000
MONGO_URI=mongodb://localhost:27017/mino-auth
JWT_SECRET=your-secret-key
REDIS_HOST=localhost
REDIS_PORT=6379
RABBITMQ_URL=amqp://localhost:5672Product Service (.env)
PORT=3001
MONGO_URl=mongodb://localhost:27017/mino-products
JWT_SECRET=your-secret-key
RABBITMQ_URL=amqp://localhost:5672
IMAGEKIT_PUBLIC_KEY=your-key
IMAGEKIT_PRIVATE_KEY=your-key
IMAGEKIT_URL_ENDPOINT=your-endpointCart Service (.env)
PORT=3002
MONGO_URI=mongodb://localhost:27017/mino-cart
JWT_SECRET=your-secret-keyOrder Service (.env)
PORT=3003
MONGO_URI=mongodb://localhost:27017/mino-orders
JWT_SECRET=your-secret-key
RABBITMQ_URL=amqp://localhost:5672Notification Service (.env)
EMAIL_USER=your-email@gmail.com
CLIENT_ID=your-oauth-client-id
CLIENT_SECRET=your-oauth-client-secret
REFRESH_TOKEN=your-refresh-token
RABBITMQ_URL=amqp://localhost:5672AI Buddy Service (.env)
MONGO_URI=mongodb://localhost:27017/mino-ai
JWT_SECRET=your-secret-key
GEMINI_API_KEY=your-gemini-api-key
ALLOWED_ORIGINS=http://localhost:5173,http://localhost:5174Seller Dashboard (.env)
MONGO_URI=mongodb://localhost:27017/mino-seller
JWT_SECRET=your-secret-key
RABBITMQ_URL=amqp://localhost:5672- Start the services
# Start backend services (in separate terminals)
cd auth && npm start
cd product && npm start
cd cart && npm start
cd order && npm start
cd notification && npm start
cd seller-dashbord && npm start
cd ai-buddy && npm start
# Start frontend applications
cd frontend-user && npm run dev
cd frontend-seller && npm run dev- Access the applications
- Customer Portal: http://localhost:5173
- Seller Dashboard: http://localhost:5174
- RabbitMQ Management: http://localhost:15672
- Navigate to docker directory
cd docker
cp .env.example .env
# Edit .env with your values- Build and run all services
docker-compose up -d --build- View logs
docker-compose logs -f- Stop all services
docker-compose down| Service | Port | Description |
|---|---|---|
| Auth | 3000 | User authentication |
| Product | 3001 | Product management |
| Cart | 3002 | Shopping cart |
| Order | 3003 | Order processing |
| Notification | 3004 | Email notifications |
| Seller Dashboard | 3005 | Seller analytics |
| AI Buddy | 3006 | AI chatbot |
| MongoDB | 27017 | Database |
| Redis | 6379 | Cache |
| RabbitMQ | 5672/15672 | Message broker |
# MongoDB shell
docker exec -it mino-mongodb mongosh -u admin -p password123
# Redis CLI
docker exec -it mino-redis redis-cli# Stop and remove containers
docker-compose down
# Remove volumes (data)
docker-compose down -v
# Remove everything including images
docker-compose down -v --rmi all| Variable | Description |
|---|---|
MONGO_URI |
MongoDB connection string |
JWT_SECRET |
JWT signing secret |
| Variable | Description |
|---|---|
RABBITMQ_URL |
RabbitMQ connection URL |
| Variable | Description |
|---|---|
REDIS_HOST |
Redis host |
REDIS_PORT |
Redis port |
REDIS_PASSWORD |
Redis password (optional) |
| Variable | Description |
|---|---|
EMAIL_USER |
Gmail address |
CLIENT_ID |
OAuth2 client ID |
CLIENT_SECRET |
OAuth2 client secret |
REFRESH_TOKEN |
OAuth2 refresh token |
| Variable | Description |
|---|---|
GEMINI_API_KEY |
Google Gemini API key |
ALLOWED_ORIGINS |
CORS allowed origins |
| Variable | Description |
|---|---|
IMAGEKIT_PUBLIC_KEY |
ImageKit public key |
IMAGEKIT_PRIVATE_KEY |
ImageKit private key |
IMAGEKIT_URL_ENDPOINT |
ImageKit URL endpoint |
# Auth service tests
cd auth
npm test
# Cart service tests
cd cart
npm test
# Product service tests
cd product
npm testThe project uses:
- Jest as the test runner
- Supertest for HTTP assertions
- MongoDB Memory Server for isolated database testing
auth/__tests__/
βββ addresses.test.js
βββ login.test.js
βββ logout.test.js
βββ me.test.js
βββ register.test.js
cart/src/__tests__/
βββ card.controller.addItem.test.js
product/tests/
βββ products.delete.test.js
βββ products.get.test.js
βββ products.id.test.js
βββ products.patch.test.js
βββ products.test.js
Mino-Project/
βββ docker/ # Docker configurations
β βββ .env.example
β βββ auth.Dockerfile
β βββ cart.Dockerfile
β βββ order.Dockerfile
β βββ product.Dockerfile
β βββ notification.Dockerfile
β βββ seller-dashboard.Dockerfile
β βββ ai-buddy.Dockerfile
β
βββ auth/ # Auth microservice
β βββ server.js
β βββ src/
β β βββ index.js
β β βββ broker/ # RabbitMQ integration
β β βββ controllers/
β β βββ db/ # MongoDB + Redis
β β βββ Middlware/
β β βββ Models/
β β βββ router/
β βββ __tests__/
β
βββ product/ # Product microservice
β βββ server.js
β βββ src/
β β βββ broker/
β β βββ controllers/
β β βββ db/
β β βββ middlewares/
β β βββ Models/
β β βββ routes/
β β βββ serviecs/ # ImageKit upload
β βββ tests/
β
βββ cart/ # Cart microservice
β βββ server.js
β βββ src/
β β βββ controller/
β β βββ db/
β β βββ middlewares/
β β βββ model/
β β βββ routes/
β βββ __tests__/
β
βββ order/ # Order microservice
β βββ server.js
β βββ src/
β β βββ broker/
β β βββ Controller/
β β βββ db/
β β βββ middlewares/
β β βββ Model/
β β βββ Routes/
β
βββ notification/ # Notification microservice
β βββ server.js
β βββ src/
β β βββ broker/
β β βββ email.js
β
βββ seller-dashbord/ # Seller Dashboard microservice
β βββ server.js
β βββ src/
β β βββ broker/
β β βββ controller/
β β βββ db/
β β βββ middleware/
β β βββ models/
β β βββ router/
β
βββ ai-buddy/ # AI Assistant microservice
β βββ server.js
β βββ src/
β β βββ app.js
β β βββ agent/ # LangChain agent
β β βββ db/
β β βββ sockets/ # WebSocket server
β
βββ frontend-user/ # Customer React app
β βββ vite.config.js
β βββ src/
β β βββ App.jsx
β β βββ api/
β β βββ components/
β β βββ pages/
β β βββ store/ # Redux store
β
βββ frontend-seller/ # Seller React app
βββ vite.config.js
βββ src/
β βββ App.jsx
β βββ api/
β βββ components/
β βββ pages/
β βββ store/ # Redux store
- Fork the repository
- Create your 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
This project is licensed under the ISC License.
Built with β€οΈ by the Mino Team