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
- User Action → Mobile App
- API Request → Backend API
- Database Query → PostgreSQL
- Response → Mobile App
- 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
- RESTful API: Simple, stateless API design
- Phone-based Auth: OTP verification via SMS
- Role-based Access: Provider, Service Seeker, Admin roles
- Real-time Updates: Polling for updates (could be upgraded to WebSockets)
- Location Services: GPS-based provider matching