Skip to main content

Architecture Overview

High-level architecture of the ThePlugg platform.

System Components

┌─────────────────────────────────────────┐
│ Mobile App (Flutter) │
│ iOS & Android Native Apps │
└──────────────┬──────────────────────────┘
│ HTTP/REST API

┌──────────────▼──────────────────────────┐
│ Backend API (Node.js/Express) │
│ REST API Server │
└──────────────┬──────────────────────────┘

┌───────┴────────┐
│ │
┌──────▼─────┐ ┌──────▼─────┐
│ PostgreSQL │ │ AWS S3 │
│ Database │ │ Storage │
└────────────┘ └────────────┘


┌──────▼──────────────────────────┐
│ Admin Dashboard (React.js) │
│ Web Application │
└─────────────────────────────────┘

Data Flow

  1. User Action → Mobile App
  2. API Request → Backend API
  3. Database Query → PostgreSQL
  4. Response → Mobile App
  5. UI Update → User sees changes

Communication Patterns

  • Mobile App ↔ Backend: REST API over HTTPS
  • Admin Dashboard ↔ Backend: REST API over HTTPS with API key auth
  • Backend ↔ Database: Prisma ORM
  • Backend ↔ Storage: AWS S3 SDK
  • Backend ↔ SMS: BulkSMS REST API
  • Backend ↔ Push: OneSignal API

Technology Stack

Backend

  • Node.js + Express
  • TypeScript
  • Prisma ORM
  • PostgreSQL

Mobile

  • Flutter (Dart)
  • Provider (State Management)
  • GoRouter (Navigation)

Admin

  • React.js
  • TypeScript
  • React Router

Infrastructure

  • AWS S3 (Storage)
  • BulkSMS (SMS)
  • OneSignal (Push Notifications)

Key Design Decisions

  1. RESTful API: Simple, stateless API design
  2. Phone-based Auth: OTP verification via SMS
  3. Role-based Access: Provider, Service Seeker, Admin roles
  4. Real-time Updates: Polling for updates (could be upgraded to WebSockets)
  5. Location Services: GPS-based provider matching