A full-stack web application that visualizes sales data with interactive charts and provides user authentication, order management, and detailed analytics.
- Authentication System: Secure login and registration with role-based access (Admin and Customer)
- Interactive Dashboard:
- Revenue statistics with growth indicators
- Customer acquisition metrics
- Sales trends visualization
- Product category distribution
- Time-based Filtering: Filter all analytics by different time periods (This Month, Last Month, This Year, Last Year)
- Order Management: Create, view, and track orders with detailed information
- React with TypeScript
- Tailwind CSS for styling
- CharJs for data visualization
- React Router for navigation
- Axios for API calls
- Node.js with Express
- TypeScript
- Prisma ORM
- PostgreSQL database
- JWT authentication
- RESTful API design
- Node.js (v14 or higher)
- npm
- PostgreSQL database
git clone https://github.com/mo-renike/data-visualization-dashboard
cd data-visualization-dashboard
Update the .env
file with your database connection URL and JWT secret.
Frontend:
cd client && npm install
Backend:
cd server
npm install
cd server
npx prisma migrate dev
npx ts-node src/utils/populateOrders.ts
This will:
- Create the database tables according to the Prisma schema
- pre populate the database with sample data
Frontend:
cd client
npm run dev
Backend:
cd server
npm run dev
- Frontend will be available at: http://localhost:5173
- Backend API will be available at: http://localhost:8080
Frontend:
cd client
npm run build
Backend:
cd server
npm run build
npm start
- Frontend deployed on vercel
- Backend deployed on render
POST /api/auth/register
- Register a new userPOST /api/auth/login
- Login a user
GET /api/orders
- Get all orders (admin) or user orders (customer)POST /api/orders
- Create a new order
GET /api/stats/stats
- Get dashboard statisticsGET /api/stats/revenue-chart
- Get revenue chart dataGET /api/stats/category-chart
- Get category distribution dataGET /api/stats/orders
- Get filtered orders by time period