# Malawi School Accessibility & Education Planning Tool
A web-based GIS application that helps Malawi education officials visualize school locations, analyze accessibility from populated areas, and identify underserved communities for evidence-based infrastructure planning.
## Overview
The tool focuses on quickly answering questions like:
- Where are communities beyond reasonable distance to a school?
- What are the average distances to the nearest school across regions?
- Which places should be prioritized for new school construction?
## Tech Stack
- **Frontend**: Next.js 16, React 19, TypeScript
- **UI**: shadcn/ui, TailwindCSS v4, Lucide React
- **State**: Zustand
- **Database**: PostgreSQL with PostGIS
## Features
- **Map visualization**: Interactive map with layers for administrative boundaries, schools, populated places, and roads
- **Coverage analysis (MVP)**: Buffer-based analysis and straight-line distances to identify underserved areas
- **Basic statistics (MVP)**: School counts, average distances, school-to-population ratios
- **Planned**: Priority scoring of underserved locations, road network (pgRouting) distances, and exportable reports (PDF/CSV)
## Data Model
- **admin_boundaries**: Administrative subdivisions (Polygon)
- **education_facilities**: Schools with attributes (Point)
- **populated_places**: Settlements with population (Point)
- **roads**: Road network for travel analysis (LineString)
Computed/derived data includes school coverage buffers (2km/5km/10km), outside-coverage places, a distance matrix, priority scores, and road-based travel distances.
## Getting Started
### Prerequisites
- Node.js and pnpm
- PostgreSQL with the PostGIS extension enabled
### 1) Install dependencies
```bash
pnpm install
```
### 2) Database setup
Create a database and enable PostGIS (example shown for local development):
```sql
CREATE DATABASE malawi_education;
\c malawi_education
CREATE EXTENSION IF NOT EXISTS postgis;
```
Create spatial tables …