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
- Clone the repository:
git clone https://github.com/your-username/sales-dashboard.git cd sales-dashboard-next
- Install dependencies:
npm install
- Run the development server:
npm run dev
- Open your browser at:
http://localhost:3000/dashboard
7. License
This project is released under the MIT License.