A full-stack analytics dashboard builder that lets users create custom dashboards by adding and arranging widgets on a drag-and-drop grid layout. Build line charts, bar charts, pie charts, funnel charts, KPI cards, and data tables — all powered by configurable data sources.
| Layer | Technology |
|---|---|
| Frontend | React 18, TypeScript, Vite |
| Styling | Tailwind CSS |
| Charts | Recharts |
| Grid Layout | react-grid-layout |
| Backend | FastAPI, SQLAlchemy |
| Database | PostgreSQL |
| Auth | JWT (PyJWT + passlib/bcrypt) |
| PDF Export | ReportLab |
| Testing | Vitest, React Testing Library, Playwright |
- Node.js >= 18
- Python >= 3.11
- PostgreSQL >= 14
- npm >= 9
git clone <repository-url>
cd insightdashcd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txtcd frontend
npm installCreate a PostgreSQL database:
createdb insightdashRun migrations:
cd backend
alembic upgrade headCopy the example environment file and configure it:
cp .env.example .env| Variable | Description | Default |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | postgresql://localhost:5432/insightdash |
SECRET_KEY |
JWT signing secret | change-me-in-production |
CORS_ORIGINS |
Allowed frontend origins (comma-separated) | http://localhost:5173,http://localhost:3000 |
ACCESS_TOKEN_EXPIRE_MINUTES |
JWT token expiry | 60 |
Start both servers in separate terminals:
Backend (runs on port 8000):
cd backend
source venv/bin/activate
uvicorn app.main:app --reload --port 8000Frontend (runs on port 5173):
cd frontend
npm run devOpen http://localhost:5173 in your browser.
Backend:
cd backend
uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4Frontend:
cd frontend
npm run build
npm run preview # or serve the dist/ directory with your preferred static hostFor Vercel deployment, point the build to the frontend/ directory with the npm run build command and dist as the output directory.
insightdash/
├── .env.example # Environment variable template
├── backend/
│ ├── requirements.txt # Python dependencies
│ ├── app/
│ │ ├── core/
│ │ │ ├── config.py # App configuration
│ │ │ ├── database.py # SQLAlchemy engine & session
│ │ │ └── auth.py # JWT authentication helpers
│ │ ├── models/
│ │ │ ├── user.py # User model
│ │ │ ├── dashboard.py # Dashboard model
│ │ │ ├── widget.py # Widget model
│ │ │ ├── template.py # Dashboard template model
│ │ │ └── share_token.py # Share token model
│ │ ├── api/routes/
│ │ │ ├── auth.py # Register/login endpoints
│ │ │ ├── widgets.py # Widget CRUD
│ │ │ ├── templates.py # Template gallery endpoints
│ │ │ └── share.py # Public share endpoints
│ │ ├── services/
│ │ │ ├── auth_service.py # Auth business logic
│ │ │ └── template_service.py
│ │ └── utils/
│ │ ├── pagination.py # Pagination helpers
│ │ └── errors.py # Error handling
│ └── tests/
├── frontend/
│ ├── src/
│ │ ├── api/client.ts # API client
│ │ ├── contexts/AuthContext.tsx
│ │ ├── pages/
│ │ │ ├── DashboardListPage.tsx # Dashboard grid with search
│ │ │ ├── DashboardEditorPage.tsx # Drag-and-drop editor
│ │ │ ├── DashboardViewPage.tsx # Read-only view
│ │ │ ├── TemplateGalleryPage.tsx # Pre-built templates
│ │ │ ├── SharePage.tsx # Public shared view
│ │ │ ├── DataSourcesPage.tsx # Data source management
│ │ │ ├── LoginPage.tsx
│ │ │ ├── RegisterPage.tsx
│ │ │ └── LandingPage.tsx
│ │ ├── components/
│ │ │ ├── Layout.tsx
│ │ │ ├── Navigation.tsx
│ │ │ └── widgets/
│ │ │ ├── WidgetRenderer.tsx # Dynamic widget renderer
│ │ │ ├── WidgetToolbar.tsx # Sidebar widget picker
│ │ │ ├── ConfigurationPanel.tsx # Widget config editor
│ │ │ ├── LineChartWidget.tsx
│ │ │ ├── BarChartWidget.tsx
│ │ │ ├── PieChartWidget.tsx
│ │ │ ├── FunnelChartWidget.tsx
│ │ │ ├── DataTableWidget.tsx
│ │ │ └── sample-data.ts # Seed/sample data
│ │ └── types/
│ │ ├── index.ts
│ │ └── widget-config.ts
│ ├── tailwind.config.js
│ ├── vite.config.ts
│ └── playwright.config.ts
The backend exposes a REST API. Interactive docs are available at /docs (Swagger UI) when the server is running.
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/auth/register |
Register a new user |
POST |
/api/auth/login |
Login and receive JWT |
GET |
/api/dashboards |
List user's dashboards |
POST |
/api/dashboards |
Create a dashboard |
GET |
/api/dashboards/{id} |
Get dashboard by ID |
PUT |
/api/dashboards/{id} |
Update a dashboard |
DELETE |
/api/dashboards/{id} |
Delete a dashboard |
GET |
/api/dashboards/{id}/export |
Export dashboard as PDF |
GET |
/api/dashboards/shared/{token} |
View shared dashboard (public) |
POST |
/api/widgets |
Create a widget |
PUT |
/api/widgets/{id} |
Update a widget |
DELETE |
/api/widgets/{id} |
Delete a widget |
GET |
/api/templates |
List dashboard templates |
POST |
/api/data-sources/{id}/upload |
Upload CSV data source |
- Dashboard — id, title, description, layout_config (JSON), created_by, is_public, share_token, timestamps
- Widget — id, dashboard_id (FK), widget_type (line_chart | bar_chart | pie_chart | funnel_chart | kpi_card | data_table), title, data_config (JSON), position, dimensions, style_config (JSON)
- DataSource — id, name, type (csv_upload | manual | api_mock), config (JSON), sample_data (JSON)
- DashboardTemplate — id, name, description, thumbnail_url, layout_config (JSON), widget_configs (JSON)
cd frontend
npx vitest runcd frontend
npx playwright install
npx playwright testcd backend
source venv/bin/activate
python -m pytestMIT