Complete, typed, and lightweight dataset of Rwanda's administrative divisions - 5 provinces, 30 districts, 416 sectors, 2,148 cells, and 14,837 villages with simplified codes and coordinates.
# Rwanda-Geo π·πΌ
> **Complete, typed, and lightweight dataset of Rwanda's administrative divisions** - Provinces, Districts, Sectors, Cells, Villages.
## β¨ Features
- **πΊοΈ Complete Administrative Hierarchy**: All 5 provinces, 30 districts, 416 sectors, 2,148 cells, and 14,837 villages
- **π Advanced Search & Navigation**: Fuzzy search, hierarchical traversal, and intelligent suggestions
- **π‘οΈ TypeScript First**: Fully typed with comprehensive interfaces and IntelliSense support
- **β‘ High Performance**: Optimized data structures (**~135KB bundle size**)
- **π Universal Support**: Works in Node.js, browsers, and modern JavaScript environments
- **π§ Validation Tools**: Built-in data integrity checks and format validation
- **π Rich Metadata**: Geographic coordinates, hierarchical relationships, and user-friendly codes
- **π― Tree-shakable**: Only import what you need to keep your bundle size minimal
## π¦ Installation
```bash
npm install rwanda-geo
```
```bash
yarn add rwanda-geo
```
```bash
pnpm add rwanda-geo
```
## β οΈ Important: Server-Side Only
**This package is designed for server-side usage only** because it uses Node.js built-in modules (`fs`, `zlib`, `path`) to load data files. It cannot be used directly in client-side applications (React, Vue, browser-based apps).
### β
Supported Environments
- **Node.js servers** (Express, Fastify, etc.)
- **Next.js server components** and API routes
- **Nuxt.js server-side** functions
- **Deno** (with Node.js compatibility)
- **Build-time** data generation
### β Not Supported
- **React client components**
- **Vue client components**
- **Browser-based applications**
- **Static site generators** (without server-side processing)
### π§ Usage Examples
#### Next.js Server Components
```tsx
// app/locations/page.tsx
import { getAllProvinces, getAllDistricts } from 'rwanda-geo';
export default async function LocationsPage() {
// This runs on the server where Node.js modules are available
const provinces = getAllPro β¦