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 β¦