🌍 Unified County Services API (UCS-API)

A modular, API-first backend designed to digitize public service delivery across Kenyan counties.

πŸ“˜ Explore API Docs β€’ 🐞 Report Bug β€’ ✨ Request Feature


🧩 About The Project

The UCS-API serves as the digital backbone for public service delivery in Kenya. It provides a scalable suite of backend APIs to accelerate digitization across counties.

Key goals:

  • πŸ’Ό Reduce redundant development work across counties
  • πŸ› Promote standardized, efficient e-governance
  • βš™οΈ Provide infrastructure for secure and scalable public services

βš’ Built With

  • NestJS – Scalable Node.js framework
  • TypeScript – Type-safe development
  • PostgreSQL – Relational database
  • TypeORM – Object-relational mapper
  • Docker – Containerization
  • Redis & BullMQ – Queued background jobs
  • Passport.js – Authentication strategies
  • Swagger (OpenAPI) – Beautiful auto-generated API docs

🎯 Key Features

βœ… Feature πŸ“‹ Description
Authentication & RBAC Secure login system with roles (Citizen, Officer, Admin)
User Registry Full CRUD for citizen/staff accounts
Service Catalog Dynamic creation of county services
Request Management Submit, track, and process service requests
Audit Trails Critical action logging for compliance
Secure File Uploads Document upload via Cloudinary
Payment Gateway M-Pesa STK Push integration via Daraja API (In Progress)
Notification Engine SMS/Email queuing framework (In Progress)

πŸš€ Getting Started

Prerequisites

Ensure you have:

  • Node.js v18+
  • Docker & Docker Compose
  • npm or yarn ### Why no NGIX Here for LB at horizontal scaling Render already: -Automatically assigns domains

-Provides HTTPS and TLS support

-Manages environment variables

-Proxies HTTP traffic to the service

Installation

git clone https://github.com/collinsomwoyo/county-api.git
cd county-api
npm install
cp .env.example .env

Edit your .env file with your credentials.

Start Services

docker-compose up -d

πŸ§ͺ Running the App

Development

npm run start:dev

Server runs on http://localhost:3001.

Production

npm run build
npm run start:prod

πŸ“– API Reference

Explore the Swagger documentation at:
http://localhost:3001/api


πŸ›£ Roadmap

βœ… Phase 1: Foundation

  • Project scaffolding, Docker setup, JWT auth

βœ… Phase 2: Core Services

  • Service catalog, request workflow, audit logs

⏳ Phase 3: Integrations

  • Secure uploads, M-Pesa payments, job queues

πŸ”œ Phase 4: Polish & Deployment

  • Analytics, CI/CD, cloud deployment

🀝 Contributing

I welcome contributions!

# Fork the repo
git checkout -b feature/AmazingFeature
git commit -m 'Add AmazingFeature'
git push origin feature/AmazingFeature

Then open a Pull Request.
⭐ Don’t forget to star the repo if you like the project!


πŸ“„ License

Distributed under the MIT License.
See LICENSE.txt for details.


πŸ“¬ Contact

Collins Omwoyo β€” collinsomwoyo@gmail.com
GitHub: https://github.com/collinsomwoyo/county-api


Share this project:

Updates