Sales Analytics Dashboard

A comprehensive MERN stack application for sales data analysis and reporting

Backend API
Node.js + Express.js REST API with MongoDB integration
  • • MongoDB with Mongoose ODM
  • • Advanced aggregation pipelines
  • • Input validation & error handling
  • • 7 REST API endpoints
Data Models
Comprehensive data structure for sales analytics
  • • Customers (name, region, type)
  • • Products (name, category, price)
  • • Sales (quantity, revenue, date)
  • • Analytics Reports (aggregated data)
Analytics Features
Advanced reporting and visualization capabilities
  • • Revenue tracking by date range
  • • Top-selling products analysis
  • • Customer performance metrics
  • • Region & category statistics
Project Structure
Complete MERN stack application with separate backend and frontend

Backend (Node.js)

backend/
├── models/ (Customer, Product, Sales)
├── routes/ (API endpoints)
├── controllers/ (Business logic)
├── utils/ (Seeding & helpers)
└── server.js (Express app)

Frontend (React)

frontend/
├── src/components/ (UI components)
├── src/pages/ (Dashboard, Reports)
├── src/services/ (API calls)
├── src/hooks/ (Custom hooks)
└── src/App.js (Main app)
Setup Instructions
Follow these steps to run the complete MERN stack application

1. Backend Setup

cd backend
npm install
cp .env.example .env
# Update .env with MongoDB URI
npm run seed # Generate sample data
npm run dev # Start on port 5000

2. Frontend Setup

cd frontend
npm install
cp .env.example .env
npm start # Start on port 3000

This page is deployed on Vercel. The complete MERN stack application files are included in the project.