This is an Environmental Management System is a full-stack web application built to track environmental projects, incidents, licenses, audits, research and donations across all 47 counties of Kenya
# 🌿 Neema Environmental Management System
> **mazingira yetu | uhai wetu | wajibu wetu**
> *our environment | our life | our responsibility*
A full-stack environmental management web application built for Kenya's 47 counties — tracking projects, incidents, licenses, research, audits and donations through a live MySQL database with role-based dashboards.
---
## 📋 Table of Contents
- Overview
- Tech Stack
- Database Schema
- Features by Role
- Project Structure
- Getting Started
- Database Setup
- Running the App
- API Endpoints
- MySQL Objects
- Screenshots
- What I Learned
---
## Overview
Neema DBMS is a complete full-stack project built from scratch using **MySQL**, **Node.js**, **Express** and **Vanilla JavaScript**. It manages environmental data across all 47 Kenyan counties with four separate role-based dashboards — Public, Employee, Manager and Admin.
### Key Numbers
| Metric | Count |
|--------|-------|
| MySQL Tables | 12 |
| Views | 6 |
| Stored Functions | 13 |
| Stored Procedures | 2 |
| API Endpoints | 40+ |
| User Roles | 4 |
| Counties Covered | 47 |
| Data Rows (bulk) | 300+ per table |
---
## Tech Stack
| Layer | Technology | Purpose |
|-------|-----------|---------|
| Database | MySQL 8.0 | All data storage, views, functions, procedures |
| Backend | Node.js v24 + Express.js | REST API server |
| DB Driver | mysql2 | MySQL connection & parameterised queries |
| Frontend | HTML5 + CSS3 | Role-based dashboards |
| Logic | Vanilla JavaScript | DOM manipulation, async/await, fetch API |
| Tools | MySQL Workbench | Schema design & query execution |
---
## Database Schema
```
Branches (47 counties)
├── Employees ──────────────────── self-ref (ManagerID)
│ ├── ProjectTeam
│ ├── Inspections (as inspector)
│ ├── Incidents (as reporter)
│ ├── ResearchStudies (as lead researcher)
│ └── EnvironmentalAudits (as lead auditor)
│
├── Projects
│ ├── ProjectTeam
│ └── ProjectFunding
│
└── Organizations
├── Lice …