Logo Lanfrica

alinafekamwendo/malawi-districts-api

Domain:

geospatial

Record type:

software
Creator:
ali
Host:
REST API for Malawi district administrative and cultural data built with NestJS and Prisma. # πŸ‡²πŸ‡Ό Malawi Districts Information API A structured, relational REST API built with **NestJS** and **Prisma** that provides comprehensive administrative and cultural information about districts in Malawi. This project demonstrates production-level backend architecture, relational modeling, and scalable API design. --- ## πŸš€ Overview The Malawi Districts Information API models hierarchical and relational geographic data including: * Districts * Traditional Authorities (TAs) * Group Village Headmen (GVHs) * Villages * Council Wards * Popular Features (lakes, rivers, markets, mountains) * Dominant Tribes * Dominant Languages The API is designed to power a frontend (e.g., a Next.js application) that allows users to search and explore district-level information. --- ## πŸ— Architecture This project follows **modular NestJS architecture** and clean separation of concerns. ``` Controller β†’ Service β†’ Prisma β†’ Database ``` ### Key Architectural Concepts * Dependency Injection * DTO-based validation * Structured REST resource design * Proper relational modeling (1:N, N:N) * Global Prisma module * Scalable module-based structure --- ## πŸ›  Tech Stack | Layer | Technology | | ----------------- | --------------- | | Backend Framework | NestJS | | ORM | Prisma | | Database | PostgreSQL | | Validation | class-validator | | API Architecture | REST | | Language | TypeScript | --- ## πŸ—„ Database Design ### Relationship Structure ``` District β”œβ”€β”€ Traditional Authority β”‚ β”œβ”€β”€ Group Village Head β”‚ β”‚ └── Village β”œβ”€β”€ Council Wards β”œβ”€β”€ Features β”œβ”€β”€ Dominant Tribes (Many-to-Many) └── Dominant Languages (Many-to-Many) ``` ### Modeling Features * UUID primary keys * Enumerations (Region, FeatureType) * Join tables for many-to-many relationships * Normalized schema design * Referential integrity enforced via Prisma --- ## πŸ“‘ API Endpoints ### Districts | Method | Endpoi …