AIParksit System Architecture
Real-time data flow and API endpoint documentation
50+
Pages & Routes
15+
API Endpoints
3
User Types
Real-time
WebSocket Updates
Nginx Web Server
Status: Running
PID: 1906
Uptime: 7h 23m
Workers: 16
CPU Usage:
12%
Memory:
69.6 MB
PM2 (aiparksit-website)
Status: Online
PID: 137716
Uptime: 3h 45m
Restarts: 5
CPU Usage:
0%
Memory:
58.6 MB
PostgreSQL Database
Status: Active
Version: PostgreSQL 14.x
Connections: 14 active
Database: aiparksit_production
Queries/min:
1,234
Size:
2.4 GB
WebSocket Server
Status: Connected
Uptime: 7h 23m
Active Connections: 12 clients
Events/min: 45
Latency:
45ms
Last Event:
2s ago
💾 Disk Space
/opt (Application)
/var/log (Logs)
/home (User Data)
👥 Active Users
8
Dashboard:
3 users
Marketplace:
2 users
Operator:
2 users
Investor:
1 user
⚠️ Recent Errors (Last 24 Hours)
| Time | Service | Error Type | Message | Count |
|---|---|---|---|---|
| 07:15:23 | API | Timeout | /api/proxy/facilities - Connection timeout | 1 |
| 07:12:45 | Next.js | 500 Error | Internal server error on /operator | 2 |
| 06:58:12 | PostgreSQL | Slow Query | Query took 5.2s - SELECT * FROM bookings | 1 |
| 06:45:33 | WebSocket | Disconnect | Client disconnected unexpectedly | 3 |
| ✓ No critical errors in last 24 hours | ||||
⚡ Quick Actions
Driver Booking Flow
Driver App
→
Next.js Frontend
→
API Proxy
→
PostgreSQL
Client
Click to highlight all client components
Server
Click to highlight all server components
Database
Click to highlight all database components
External API
Click to highlight all external services
Driver Journey - Step by Step
- 1. Browse Marketplace GET /api/proxy/marketplace
- 2. View Available Spots GET /api/proxy/facilities
- 3. Real-time Availability WebSocket Connection
- 4. Book Parking Space POST /api/bookings
- 5. Payment Processing POST /api/payments
- 6. Confirmation Email POST /api/notifications/email
Operator Dashboard Data Flow
Operator Portal
→
Dashboard API
→
PostgreSQL
PostgreSQL
→
Analytics Engine
→
Charts & Graphs
Client
Click to highlight all client components
Server
Click to highlight all server components
Database
Click to highlight all database components
External API
Click to highlight all external services
Operator Dashboard - Data Sources
- 1. Onboarding Process POST /api/operator/onboarding
- 2. Facility Management GET /api/proxy/operator
- 3. Revenue Analytics GET /api/analytics/revenue
- 4. Occupancy Tracking GET /api/analytics/occupancy
- 5. Add New Facility POST /api/facilities
- 6. Real-time Updates WebSocket /ws/operator
Investor Metrics Pipeline
Investor Portal
→
Metrics API
→
PostgreSQL
Aggregated Data
→
Report Generator
→
PDF Export
Client
Click to highlight all client components
Server
Click to highlight all server components
Database
Click to highlight all database components
External API
Click to highlight all external services
Investor Metrics - Available Reports
- 1. Platform Overview GET /api/proxy/investor
- 2. Revenue Metrics GET /api/metrics/revenue
- 3. User Growth GET /api/metrics/growth
- 4. Market Analysis GET /api/metrics/market
- 5. Download PDF Report POST /api/reports/export
- 6. Email Report POST /api/notifications/email
Complete API Architecture
Client Browser
→
Nginx (Port 443)
→
Next.js (Port 3005)
Next.js Server
→
API Routes (/app/api/)
→
PostgreSQL
Middleware
→
Anti-Harvesting
→
Rate Limiting
Client
Click to highlight all client components
Server
Click to highlight all server components
Database
Click to highlight all database components
External API
Click to highlight all external services
API Endpoints - Complete List
- GET Health Check /api/health
- GET Marketplace Data /api/proxy/marketplace
- GET Facilities List /api/proxy/facilities
- GET Operator Dashboard /api/proxy/operator
- GET Investor Metrics /api/proxy/investor
- POST Operator Onboarding /api/operator/onboarding
- POST Email Notifications /api/notifications/email
Real-time WebSocket Architecture
React Component
→
SocketProvider
→
WebSocket Server
Database Change
→
Event Trigger
→
Live UI Update
Client
Click to highlight all client components
Server
Click to highlight all server components
Database
Click to highlight all database components
External API
Click to highlight all external services
Real-time Events - Live Updates
- Connection Established ws://api.aiparksit.com/ws
- Parking Availability Update Event: availability_changed
- New Booking Alert Event: booking_created
- Revenue Update (Operator) Event: revenue_updated
- Dashboard Metrics Refresh Polling: Every 30s
- Auto-Reconnect on Disconnect Retry: 3s delay
Network Infrastructure
- Public IP (pfSense WAN) 63.226.48.138
- pfSense Gateway (LAN) 10.123.45.1
- Server (Virtualmin) 10.123.45.22
- Nginx Proxy Port 80/443
- Next.js Application Port 3005
- PostgreSQL Database localhost:5432