Skip to content

PRAZPC/bachao

Repository files navigation

Bachau Emergency Governance System

Bachau is a decentralized, offline-capable emergency governance ecosystem designed to connect citizens with official government emergency channels in high-friction environments. It enables immediate situational awareness, emergency reporting, and coordination through secure digital interfaces while providing auxiliary support via verified volunteer networks and NGO/INGO integration.

Project Structure

bachau-integrated/
├── bachao /                    # Flutter Project Root
│   ├── android/                # Android native host project
│   │   ├── app/                # Android application module
│   │   ├── gradle/             # Gradle wrapper files
│   │   ├── .gitignore          # Android-specific gitignore
│   │   ├── build.gradle.kts    # Project-level Gradle build script
│   │   ├── gradle.properties   # Gradle configuration properties
│   │   ├── settings.gradle.kts # Gradle settings
│   │   └── ...
│   ├── ios/                    # iOS native host project
│   │   ├── Flutter/            # Flutter assets and configuration for iOS
│   │   ├── Runner/             # iOS application code (Swift/Obj-C)
│   │   ├── Runner.xcodeproj/   # Xcode project file
│   │   ├── Runner.xcworkspace/ # Xcode workspace file
│   │   ├── .gitignore          # iOS-specific gitignore
│   │   └── ...
│   ├── lib/                    # Main Dart source code (Flutter app)
│   │   └── main.dart           # Entry point
│   ├── linux/                  # Linux native host project
│   ├── macos/                  # macOS native host project
│   ├── web/                    # Web host project
│   ├── windows/                # Windows native host project
│   ├── test/                   # Unit and Widget tests
│   ├── .dart_tool/             # [IGNORED] Internal Dart/Flutter tools cache and build info
│   ├── .idea/                  # [IGNORED] IntelliJ IDEA project settings
│   ├── build/                  # [IGNORED] Build output directory (generated binaries, APKs, etc.)
│   ├── .gitignore              # Git ignore rules for the Flutter project
│   ├── analysis_options.yaml   # Linter rules for Dart code
│   ├── pubspec.lock            # Lockfile for Dart dependencies
│   ├── pubspec.yaml            # Project configuration and dependencies
│   └── README.md               # Project-specific README
|
├── frontend/                   # React Native (Expo) mobile application
│   ├── app/                    # App screens and navigation
│   ├── components/             # Reusable UI components
│   ├── assets/                 # Images and static files
│   ├── constants/              # App constants and themes
│   ├── hooks/                  # Custom React hooks
│   ├── package.json           # Frontend dependencies
│   └── app.json               # Expo configuration
│
├── backend/                    # FastAPI backend services
│   ├── api/                   # API endpoints
│   │   ├── dispatcher.py      # Emergency dispatch endpoints
│   │   ├── health.py          # Health check endpoints
│   │   ├── sms.py            # SMS service endpoints
│   │   └── sos.py            # SOS emergency endpoints
│   ├── app/                   # Application setup
│   │   ├── main.py           # FastAPI app entry point
│   │   └── __init__.py
│   ├── core/                  # Core configurations
│   │   ├── config.py         # App configuration
│   │   └── security.py       # Security utilities
│   ├── model/                 # Data models
│   │   ├── dispatcher.py     # Dispatcher models
│   │   ├── guardians.py      # Guardian models
│   │   ├── incident.py       # Incident models
│   │   ├── sms.py           # SMS models
│   │   └── sos.py           # SOS models
│   ├── services/              # Business logic services
│   │   ├── decoder.py        # Message decoding service
│   │   ├── dispatcher.py     # Dispatch coordination service
│   │   ├── guardians.py      # Guardian management service
│   │   └── sms-ingest/       # SMS ingestion service
│   ├── ws/                    # WebSocket handlers
│   │   ├── guardians.py      # Guardian WebSocket handlers
│   │   └── incidents.py     # Incident WebSocket handlers
│   ├── requirements.txt       # Python dependencies
│   └── .env                  # Environment variables
│
├── packages/                   # Shared utilities
│   └── sms-core/              # SMS encoding/decoding utilities
│       ├── decode.py          # SMS decoding logic
│       ├── encode.ts          # SMS encoding logic (TypeScript)
│       └── spec.md           # SMS protocol specification
│
├── test_main.http             # API testing file
└── README.md                  # This file

Components

Frontend (React Native/Expo)

  • Emergency Reporting: Citizens can report emergencies through the mobile app
  • Real-time Updates: Live incident tracking and updates
  • Offline Capability: Works in low-connectivity environments
  • User Authentication: Phone number verification with OTP

Backend (FastAPI)

  • API Endpoints: RESTful services for emergency management
  • WebSocket Support: Real-time communication for live updates
  • SMS Integration: Handles SMS-based emergency reports
  • Data Models: Structured data for incidents, guardians, and dispatchers

Shared Packages

  • SMS Core: Encoding/decoding utilities for SMS-based emergency reports
  • Cross-platform Types: Shared data structures between frontend and backend

Getting Started

Backend Setup

cd backend
pip install -r requirements.txt
uvicorn app.main:app --reload

Frontend Setup

cd frontend
npm install
npx expo start

API Endpoints

  • Health: /health - Service health check
  • SOS: /sos - Emergency SOS endpoints
  • SMS: /sms - SMS service integration
  • Dispatcher: /dispatcher - Emergency dispatch coordination

Core Functional Scope (MVP)

  1. User Management

    • Phone number authentication with OTP
    • Profile setup for citizens and volunteers
    • Verified KYC for professional responders (government channels, nurses, doctors)
  2. Emergency Reporting and Coordination

    • Centralized dashboard aggregating incoming reports
    • Geospatial mapping of emergency incidents and responders
    • Routing to official government channels with optional volunteer support
  3. Governance Integration

    • Provides actionable data to government emergency services
    • Supports bridging communication with NGOs/INGOs for auxiliary support
    • Offline-capable reporting mechanisms for low-connectivity regions
  4. Supporting Features

    • Volunteer coordination network
    • Optional SMS reporting and compressed messaging for low-bandwidth environments
    • Search and mapping utilities

Future Scope

  • Provide public or private API endpoints for government channels, NGOs, and third-party applications to access aggregated emergency data securely.
  • Support additional disaster-specific modules and integration with government applications.
  • Expand analytics and reporting tools for situational awareness and resource allocation.

Development Workflow

  1. Monorepo Initialization

    • Single repository contains all services, frontend, shared packages, infrastructure, and documentation.
  2. Frontend Development

    • apps/mobile contains React Native Expo project
    • Provides offline-capable emergency reporting, volunteer coordination, and geospatial tracking
    • Placeholder modules for screens, services, and local storage
  3. Backend Development

    • services/api contains FastAPI application
    • Implements REST endpoints, authentication, SOS routing, volunteer matching, and geospatial utilities
  4. Middleware Services

    • services/sms-ingest for low-connectivity or offline emergency reports
    • Abstracts different communication protocols (SMS, Android device reports, SMPP)
  5. Shared Modules

    • packages/sms-core for encoding/decoding messages
    • packages/geo for geospatial computations
    • packages/types for cross-service type consistency
  6. Infrastructure

    • infra/docker for containerization
    • infra/nginx for reverse proxy and load balancing
    • infra/env for environment-specific configuration

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors