A production-ready, full-stack admin dashboard for managing a distributed supermarket chain across Kenya.
# Supermarket Admin Dashboard
A production-ready, full-stack admin dashboard for managing a distributed supermarket chain across Kenya. Built with modern technologies and best practices for scalability, security, and user experience.
## Project Overview
This system manages a supermarket chain with 5 branches across Kenya:
- **Nairobi** (Headquarters)
- **Kisumu**
- **Mombasa**
- **Nakuru**
- **Eldoret**
### Products Managed
- **Coke** - KES 80
- **Fanta** - KES 75
- **Sprite** - KES 75
_Uniform pricing across all branches_
## Features
### Dashboard
- Real-time business metrics (total revenue, sales count)
- Revenue breakdown by product (bar chart)
- Sales distribution by branch (pie chart)
- Sales trend analysis (line chart - 30 days)
- Recent transactions table
- Low stock alerts
### Inventory Management
- View stock levels per branch and product
- Low stock threshold alerts
- Restock functionality (HQ → branches)
- Real-time inventory updates
- Stock status indicators
### Sales Reports
- Consolidated reports across all branches
- Revenue by product breakdown
- Sales by branch analysis
- Top-performing products
- Date range filtering
- Export functionality (ready to implement)
### User Management (RBAC)
- View all registered users
- Promote customers to admin
- Role-based access control
- Admin promotion safeguards
- User statistics and analytics
## Tech Stack
### Frontend
- **Framework**: React 18 with Vite
- **Styling**: Tailwind CSS (modern dashboard aesthetic)
- **Charts**: Recharts
- **Icons**: Lucide React
- **Auth**: Clerk React SDK
- **HTTP**: Axios
- **Routing**: React Router v6
### Backend
- **Runtime**: Node.js 18+
- **Framework**: Express.js
- **ORM**: Prisma ORM
- **Database**: Neon PostgreSQL
- **Auth**: Clerk Node SDK
- **CORS**: cors middleware
### DevOps & Tools
- **Build Tool**: Vite
- **Database Hosting**: Neon (serverless Postgres)
- **Authentication**: Clerk (SaaS)
- **Version Control**: Git
## Authentication & RBAC
### …