A vendor analytics dashboard for e-commerce platforms built with React, Node.js, and MongoDB.
- Real-time analytics dashboard
- Monthly sales tracking
- Product performance metrics
- Revenue tracking
- JWT authentication
- Responsive design
- Redis caching for performance
- Swagger API documentation
- Node.js + TypeScript
- Express.js
- MongoDB with Mongoose
- Redis for caching
- JWT authentication
- Swagger for API documentation
- React + TypeScript
- Material-UI v7
- Recharts for data visualization
- Axios for API calls
Animations:
- Node.js (v18 or higher)
- MongoDB
- Redis
- Docker (optional)
- Clone the repository
git clone https://github.com/erdsel/supplier-dashboard.git
cd supplier-dashboard- Install backend dependencies
cd backend
npm install- Install frontend dependencies
cd ../frontend
npm installCreate .env file in the backend directory:
NODE_ENV=development
PORT=3002
MONGODB_URI=mongodb://localhost:27017/lonca
JWT_SECRET=your-secret-key
JWT_EXPIRE=7d
CORS_ORIGIN=http://localhost:3000,http://127.0.0.1:3000
REDIS_HOST=localhost
REDIS_PORT=6380
API_URL=http://localhost:3002# Windows
start-dev.bat
# Linux/Mac
./start-dev.sh
# Or using docker-compose directly
docker-compose -f docker-compose.dev.yml updocker-compose up -d# Start development with hot-reload
make dev
# Stop development
make dev-down
# View logs
make dev-logs
# Restart development
make restart- Start the backend server
cd backend
npm run dev- Start the frontend development server
cd frontend
npm start- Access the application at
http://localhost:3000 - API documentation available at
http://localhost:3002/api-docs
POST /api/auth/login-by-name- Login with vendor name
GET /api/analytics/monthly-sales/:vendorId- Monthly sales dataGET /api/analytics/product-sales/:vendorId- Product sales dataGET /api/analytics/vendor-stats/:vendorId- Vendor statisticsGET /api/analytics/detailed/:vendorId- Detailed analyticsGET /api/analytics/validate/:vendorId- Data validationGET /api/analytics/date-range/:vendorId- Date range analyticsDELETE /api/analytics/cache/:vendorId- Clear cache (Admin only)







