Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -4,114 +4,145 @@ title: DTE Punjab — Training Dashboard v2
|
|
| 4 |
sdk: docker
|
| 5 |
colorFrom: yellow
|
| 6 |
short_description: A full-featured Flask dashboard for the BDDS, DTE, NIELIT.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
---
|
| 8 |
|
|
|
|
| 9 |
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
-
#
|
| 12 |
|
| 13 |
-
|
|
|
|
|
|
|
| 14 |
|
| 15 |
-
|
| 16 |
-
[
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
|
|
|
| 18 |
|
| 19 |
-
|
| 20 |
|
| 21 |
-
https://github.com/
|
| 22 |
|
| 23 |
---
|
| 24 |
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
* **🗺️ Interactive Geospatial Mapping:** Clickable bubble map plotting participant density across Punjab districts. Features an integrated Google Maps fallback and click-to-open functionality for specific polytechnic colleges.
|
| 33 |
-
* **🗄️ Dynamic Participant Data:** Searchable, filterable (by batch, designation, district), and fully sortable paginated data table.
|
| 34 |
-
* **📥 Export Capabilities:** One-click CSV generation for both complete datasets and actively filtered views.
|
| 35 |
-
* **🌓 Modern UI/UX:** Fully responsive, premium interface with a persistent Dark / Light mode toggle powered by vanilla CSS variables and `localStorage`.
|
| 36 |
-
* **🖼️ Media Gallery:** Built-in lightbox gallery showcasing batch-wise group photographs.
|
| 37 |
|
| 38 |
---
|
| 39 |
|
| 40 |
-
##
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
---
|
| 47 |
|
| 48 |
-
##
|
| 49 |
|
| 50 |
-
**1. Clone the repository:**
|
| 51 |
```bash
|
| 52 |
git clone https://github.com/lovnishverma/dte_dashboard.git
|
| 53 |
cd dte_dashboard
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
**2. Create and activate a virtual environment (Recommended):**
|
| 57 |
-
```bash
|
| 58 |
-
python -m venv venv
|
| 59 |
-
source venv/bin/activate # On Windows use: venv\Scripts\activate
|
| 60 |
-
```
|
| 61 |
-
|
| 62 |
-
**3. Install the required dependencies:**
|
| 63 |
-
```bash
|
| 64 |
pip install -r requirements.txt
|
| 65 |
```
|
| 66 |
|
| 67 |
-
|
| 68 |
-
Ensure you have a `.env` file in the root directory containing your Google Maps API key (and optionally the Flask environment):
|
| 69 |
```env
|
| 70 |
-
GOOGLE_MAPS_API_KEY=
|
| 71 |
FLASK_ENV=development
|
| 72 |
```
|
| 73 |
|
| 74 |
-
**5. Run the application:**
|
| 75 |
```bash
|
| 76 |
python app.py
|
|
|
|
| 77 |
```
|
| 78 |
-
*The dashboard will be available at `http://localhost:5000`*
|
| 79 |
|
| 80 |
---
|
| 81 |
|
| 82 |
-
##
|
| 83 |
|
| 84 |
-
|
| 85 |
-
* Resolved designation normalization edge cases (e.g., standardizing "SR. LECTURER" vs "Senior Lecturer").
|
| 86 |
-
* Pagination now correctly displays windowed page numbers, preventing overflow for large datasets.
|
| 87 |
-
* Optimized count-up animations to correctly target the first text node.
|
| 88 |
-
* Charts and Canvas maps now seamlessly redraw on theme toggles and section re-visits.
|
| 89 |
-
|
| 90 |
-
---
|
| 91 |
-
|
| 92 |
-
## 📁 Project Structure
|
| 93 |
-
|
| 94 |
-
```text
|
| 95 |
dte_dashboard/
|
| 96 |
-
├── app.py #
|
| 97 |
-
├── requirements.txt
|
| 98 |
-
├──
|
|
|
|
| 99 |
├── data/
|
| 100 |
-
│ └── DTE_all_Batch.xlsx # Source dataset
|
| 101 |
├── templates/
|
| 102 |
-
│ └── index.html #
|
| 103 |
└── static/
|
| 104 |
-
├── css/style.css #
|
| 105 |
-
├── js/main.js #
|
|
|
|
| 106 |
└── images/ # Batch group photographs
|
| 107 |
```
|
| 108 |
|
| 109 |
---
|
| 110 |
|
| 111 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
|
| 113 |
-
**Copyright © NIELIT Ropar**
|
| 114 |
|
| 115 |
-
|
|
|
|
| 116 |
|
| 117 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
sdk: docker
|
| 5 |
colorFrom: yellow
|
| 6 |
short_description: A full-featured Flask dashboard for the BDDS, DTE, NIELIT.
|
| 7 |
+
emoji: 📈
|
| 8 |
+
colorTo: indigo
|
| 9 |
+
pinned: true
|
| 10 |
+
thumbnail: >-
|
| 11 |
+
https://cdn-uploads.huggingface.co/production/uploads/6575c3025da75f987f12c909/F1EpaSFzebxHn1otUVgJD.jpeg
|
| 12 |
---
|
| 13 |
|
| 14 |
+
<div align="center">
|
| 15 |
|
| 16 |
+
<a href="https://www.nielit.gov.in/index.php">
|
| 17 |
+
<img src="https://www.nielit.gov.in/images/NIELIT_logo.jpg" alt="NIELIT Logo" height="80"/>
|
| 18 |
+
</a>
|
| 19 |
|
| 20 |
+
# DTE Punjab — Big Data & Data Science Training Dashboard v2
|
| 21 |
|
| 22 |
+
**Analytics portal for the Big Data & Data Science Training Programme**
|
| 23 |
+
*Department of Technical Education & Industrial Training, Government of Punjab*
|
| 24 |
+
*Under FutureSkills PRIME · NIELIT Ropar*
|
| 25 |
|
| 26 |
+
[](https://nielitropar-dte.hf.space/)
|
| 27 |
+
[](https://github.com/lovnishverma/dte_dashboard)
|
| 28 |
+
[](LICENSE)
|
| 29 |
+
[](https://python.org)
|
| 30 |
+
[](https://flask.palletsprojects.com/)
|
| 31 |
+
[](Dockerfile)
|
| 32 |
|
| 33 |
+
</div>
|
| 34 |
|
| 35 |
+
---
|
| 36 |
|
| 37 |
+
<img width="1910" alt="DTE Punjab Dashboard Screenshot" src="https://github.com/user-attachments/assets/4c9a6b22-f98f-4022-aef7-03c96a98b970" />
|
| 38 |
|
| 39 |
---
|
| 40 |
|
| 41 |
+
## What Was Built
|
| 42 |
+
|
| 43 |
+
This is a production-grade full-stack web application built entirely from scratch for NIELIT Ropar to track, visualize, and analyze participant data from a government Big Data & Data Science training programme spanning 3 batches (Feb 2026) across Punjab's polytechnic colleges.
|
| 44 |
+
|
| 45 |
+
### Backend (`app.py`)
|
| 46 |
+
- **Flask REST API** with 5 JSON endpoints: `/api/dashboard-data`, `/api/summary`, `/api/map-data`, `/api/stats/advanced`, `/api/export`
|
| 47 |
+
- **Pandas-powered data pipeline** that reads a raw multi-header `.xlsx` file (headers at row 7, data from row 8), normalizes messy real-world inputs — de-duplicating 30+ spelling variants of college names, standardizing designations (`SR. LECTURER` → `Senior Lecturer`), and mapping branches to canonical codes (CSE, IT, CE)
|
| 48 |
+
- **`@lru_cache`** on data load so the Excel file is parsed only once per server lifetime
|
| 49 |
+
- **Geospatial preprocessing** — hardcoded GPS coordinates for 18 Punjab districts and 19 colleges, with automatic bubble-offset logic to prevent overlapping markers for multi-college districts
|
| 50 |
+
- **Filtered CSV export** endpoint supporting server-side filtering by batch, designation, and district
|
| 51 |
|
| 52 |
+
### Frontend (`templates/index.html` + `static/`)
|
| 53 |
+
- **Single-page dashboard** with 6 sections: Overview, Analytics, Insights, Map, Gallery, Participants
|
| 54 |
+
- **9 Chart.js charts**: district bar, gender doughnut, branch doughnut, designation horizontal bar, batch-gender grouped bar, top colleges horizontal bar, plus 3 overview mini-charts — all re-rendered on theme switch
|
| 55 |
+
- **Dual-map system**: Google Maps JavaScript API (AdvancedMarkerElement with scaled PinElements, InfoWindow popups) as primary, with automatic Leaflet.js fallback on auth failure — tile layer swaps dynamically on dark/light toggle
|
| 56 |
+
- **Smart insights engine**: 6 auto-generated analytical cards with animated progress bars (gender inclusion, district dominance, designation breakdown, college diversity, batch distribution, geographic spread)
|
| 57 |
+
- **Participants table**: real-time search + 3 filter dropdowns + multi-column sort + windowed pagination (20 rows/page) + per-row detail modal with avatar image (with initials fallback)
|
| 58 |
+
- **Lightbox photo gallery** for batch group photographs
|
| 59 |
+
- **Dark/Light theme** via CSS custom properties (`[data-theme]`) persisted to `localStorage`, with all Chart.js defaults updated on toggle
|
| 60 |
+
- **Client-side CSV export** for filtered table views using Blob API
|
| 61 |
+
- **Fully responsive** — collapsible sidebar with hamburger + overlay, stacked layouts on mobile
|
| 62 |
|
| 63 |
+
### Infrastructure
|
| 64 |
+
- **Docker-ready** with a `python:3.11-slim` image, non-root user, and Gunicorn on port 7860 for HuggingFace Spaces deployment
|
| 65 |
+
- **Environment-variable driven** — Google Maps key injected via `.env` / `python-dotenv`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
---
|
| 68 |
|
| 69 |
+
## Tech Stack
|
| 70 |
|
| 71 |
+
| Layer | Technology |
|
| 72 |
+
|---|---|
|
| 73 |
+
| Backend | Python 3.11, Flask 3.x, Pandas 2.x, OpenPyXL, python-dotenv |
|
| 74 |
+
| Frontend | Vanilla JS (ES6+), Chart.js 4.4, Leaflet.js 1.9 |
|
| 75 |
+
| Mapping | Google Maps JS API (AdvancedMarkerElement) + Leaflet fallback |
|
| 76 |
+
| Deployment | Docker, Gunicorn, HuggingFace Spaces |
|
| 77 |
|
| 78 |
---
|
| 79 |
|
| 80 |
+
## Quick Start
|
| 81 |
|
|
|
|
| 82 |
```bash
|
| 83 |
git clone https://github.com/lovnishverma/dte_dashboard.git
|
| 84 |
cd dte_dashboard
|
| 85 |
+
python -m venv venv && source venv/bin/activate
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
pip install -r requirements.txt
|
| 87 |
```
|
| 88 |
|
| 89 |
+
Create `.env`:
|
|
|
|
| 90 |
```env
|
| 91 |
+
GOOGLE_MAPS_API_KEY=your_key_here
|
| 92 |
FLASK_ENV=development
|
| 93 |
```
|
| 94 |
|
|
|
|
| 95 |
```bash
|
| 96 |
python app.py
|
| 97 |
+
# → http://localhost:5000
|
| 98 |
```
|
|
|
|
| 99 |
|
| 100 |
---
|
| 101 |
|
| 102 |
+
## Project Structure
|
| 103 |
|
| 104 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
dte_dashboard/
|
| 106 |
+
├── app.py # Flask backend — data pipeline + 5 API routes
|
| 107 |
+
├── requirements.txt
|
| 108 |
+
├── Dockerfile # python:3.11-slim, Gunicorn on :7860
|
| 109 |
+
├── .env # API keys (gitignored)
|
| 110 |
├── data/
|
| 111 |
+
│ └── DTE_all_Batch.xlsx # Source dataset (79 participants, 3 batches)
|
| 112 |
├── templates/
|
| 113 |
+
│ └── index.html # Single-page dashboard UI
|
| 114 |
└── static/
|
| 115 |
+
├── css/style.css # Dark/Light theme via CSS variables (~600 lines)
|
| 116 |
+
├── js/main.js # All frontend logic (~650 lines)
|
| 117 |
+
├── img/ # Per-participant avatar images (B1_01.png …)
|
| 118 |
└── images/ # Batch group photographs
|
| 119 |
```
|
| 120 |
|
| 121 |
---
|
| 122 |
|
| 123 |
+
## v2 Bug Fixes
|
| 124 |
+
|
| 125 |
+
- Fixed `gm_authFailure` crash on `AdvancedMarkerElement` with an auth guard + graceful Leaflet fallback
|
| 126 |
+
- Resolved designation normalization edge cases (`SR. LECTURER` vs `SENIOR LECTURER`)
|
| 127 |
+
- Windowed pagination prevents overflow on large datasets
|
| 128 |
+
- Count-up animations correctly target first text node (not the `<span>` unit suffix)
|
| 129 |
+
- Charts and maps redraw correctly on theme toggle and section re-visit
|
| 130 |
+
|
| 131 |
+
---
|
| 132 |
+
|
| 133 |
+
## Credits
|
| 134 |
|
| 135 |
+
**Copyright © 2026 NIELIT Ropar** · MIT License
|
| 136 |
|
| 137 |
+
Built by **Lovnish Verma** (Project Engineer) and **Ravi Kant** (Project Assistant), NIELIT Ropar
|
| 138 |
+
Under the guidance of **Dr. Sarwan Singh** and **Anita Budhiraja**
|
| 139 |
|
| 140 |
+
<div align="center">
|
| 141 |
+
<a href="https://www.nielit.gov.in/index.php">
|
| 142 |
+
<img src="https://img.shields.io/badge/NIELIT-National_Institute_of_Electronics_%26_IT-003087?style=flat-square&logo=data:image/png;base64,iVBORw0KGgo=" />
|
| 143 |
+
</a>
|
| 144 |
+
|
| 145 |
+
<img src="https://img.shields.io/badge/FutureSkills-PRIME-FF6B00?style=flat-square" />
|
| 146 |
+
|
| 147 |
+
<img src="https://img.shields.io/badge/Govt._of-Punjab-003087?style=flat-square" />
|
| 148 |
+
</div>
|