Sales Dashboard

Technical Overview & Architecture (Next.js Version)

1. Introduction

Sales Dashboard is a web application that transforms raw data from customers, products, and sales into clear and interactive visualizations. It allows monitoring sales performance, identifying behavioral patterns, and performing detailed analysis within a chosen date range.

2. Main Features

  • Dynamic sales visualization in a table view.
  • Query products, clients, and totals for each transaction.
  • Backend now uses Next.js API routes and Server Components.
  • Frontend built with React + Next.js + TailwindCSS.
  • Modular architecture based on classes (Client, Product, Sale, etc.).
  • Prepared for filters, date range analysis, and chart visualization.

3. Project Structure

sales-dashboard-next/
ā”œā”€ā”€ app/
│   ā”œā”€ā”€ layout.js
│   ā”œā”€ā”€ page.js
│   ā”œā”€ā”€ dashboard/
│   │   ā”œā”€ā”€ page.js
│   │   └── DashboardView.jsx
│   ā”œā”€ā”€ api/
│   │   └── sales/
│   │       └── route.js
│   └── globals.css
ā”œā”€ā”€ components/
│   ā”œā”€ā”€ ChartView.jsx
│   ā”œā”€ā”€ SalesTable.jsx
│   └── ReportsPanel.jsx
ā”œā”€ā”€ lib/
│   ā”œā”€ā”€ db.js
│   ā”œā”€ā”€ dataAccess/
│   │   └── SalesRepository.js
│   ā”œā”€ā”€ models/
│   │   ā”œā”€ā”€ Client.js
│   │   ā”œā”€ā”€ Product.js
│   │   ā”œā”€ā”€ Sale.js
│   │   └── EnumProductType.js
│   ā”œā”€ā”€ database/
│   │   └── schemas/
│   │       ā”œā”€ā”€ ClientSchema.js
│   │       ā”œā”€ā”€ ProductSchema.js
│   │       └── SaleSchema.js
│   ā”œā”€ā”€ controllers/
│   │   └── SalesController.js
│   └── reports/
│       ā”œā”€ā”€ TotalSales.js
│       ā”œā”€ā”€ SalesByProduct.js
│       ā”œā”€ā”€ SalesByClient.js
│       └── SalesByRangeAnalitics.js
ā”œā”€ā”€ package.json
ā”œā”€ā”€ next.config.js
└── node_modules/

4. Technologies Used

  • Frontend: Next.js (React), TailwindCSS
  • Backend: Next.js API routes, Server Components
  • Architecture: OOP with clear separation of models and presentation logic

5. Planned Improvements

  • Sales analysis by hour, day, week, month, or year
  • Trading-view style comparative charts
  • Filters by client, product, or date range
  • Data and report exporting
  • MongoDB or other persistent storage integration

6. Installation & Usage

  1. Clone the repository:
    git clone https://github.com/your-username/sales-dashboard.git
    cd sales-dashboard-next
  2. Install dependencies:
    npm install
  3. Run the development server:
    npm run dev
  4. Open your browser at:
    http://localhost:3000/dashboard

7. License

This project is released under the MIT License.