How tarekhamada875-droid/rq- works
RQ is an Arabic garage-management PWA. Garage staff and administrators use the frontend to manage vehicle check-in/out, subscribers, prepaid credits, staff, delegates, and reporting; the browser calls a Cloudflare Worker that owns authorization and financial decisions and persists data through Firebase. The graph includes the main UI/API path, worker route and session layers, and key domain capabilities. Some route and dashboard details come from README descriptions and the file tree; unsampled implementation links are omitted.
Main entry points: cloudflareWorker.ts Worker entry and routing · sessionInfrastructure.ts Session authorization · App.tsx Application shell · apiClient.ts API client
Components 28
Frontend
- Application shell
src/App.tsx - Role dashboards
src/components/app/AppRoutes.tsx - Garage operations UI
src/components/garage/GarageDashboardView.tsx - Admin operations UI
src/components/admin/AdminDashboard.tsx - Status screens
src/components/layout/FullScreenStatus.tsx
Client services
- API client
src/api/apiClient.ts - Client authentication
src/services/authService.ts - Garage data service
src/services/garageService.ts - Garage session
src/hooks/useGarageSession.ts - Firebase client
src/firebase.ts - Client diagnostics
src/debug/debugRecorder.ts
Worker API
- Worker entry and routing
server/cloudflareWorker.ts - Session routes
server/workerSessionRoutes.ts - Vehicle routes
server/vehicleRoutes/index.ts - Subscriber routes
server/subscriberRoutes.ts - Garage routes
server/garageRoutes/index.ts - Credit grant routes
server/creditGrantRoutes.ts - Credit request routes
server/creditRequestRoutes.ts - Financial routes
server/financialRoutes.ts
Domain and storage
- Session authorization
server/sessionInfrastructure.ts - Request validation
server/validation.ts - Prepaid credit ledger
server/domain/prepaidCreditLedger.ts - Activity audit writer
server/activityLogWriter.ts - Firebase Admin access
server/firebaseAdmin.ts - PIN cryptography
server/pinCrypto.ts - PIN rate limiter
server/workerPinRateLimiter.ts
Other components
- Garage staff
- Admin users
Connections 32
- Garage staff → Application shell: uses
README.md - Admin users → Application shell: uses
README.md - Application shell → Role dashboards: renders
src/App.tsx - Application shell → Status screens: shows
src/App.tsx - Role dashboards → Garage operations UI: renders
src/components/app/AppRoutes.tsx - Role dashboards → Admin operations UI: renders
src/components/app/AppRoutes.tsx - Garage operations UI → Garage data service: manages garage data
- API client → Firebase client: reads auth
src/api/apiClient.ts - API client → Client diagnostics: records requests
src/api/apiClient.ts - Client authentication → API client: calls API
src/services/authService.ts - Garage data service → API client: calls API
src/services/garageService.ts - Garage data service → Firebase client: reads Firestore
src/services/garageService.ts - Garage session → Client authentication: claims sessions
src/hooks/useGarageSession.ts - Garage staff → Worker entry and routing: submits operations
README.md - Admin users → Worker entry and routing: submits operations
README.md - Worker entry and routing → Firebase Admin access: uses data store
server/cloudflareWorker.ts - Worker entry and routing → Session routes: registers routes
server/cloudflareWorker.ts - Worker entry and routing → Vehicle routes: registers routes
server/cloudflareWorker.ts - Worker entry and routing → Subscriber routes: registers routes
server/cloudflareWorker.ts - Worker entry and routing → Garage routes: registers routes
server/cloudflareWorker.ts - Worker entry and routing → Credit request routes: registers routes
server/cloudflareWorker.ts - Worker entry and routing → Financial routes: registers routes
server/cloudflareWorker.ts - Session routes → Session authorization: uses authorization
server/workerSessionRoutes.ts - Session authorization → Firebase Admin access: reads sessions
server/sessionInfrastructure.ts - Session authorization → PIN cryptography: uses PIN tools
server/sessionInfrastructure.ts - Session authorization → PIN rate limiter: uses rate limits
server/sessionInfrastructure.ts - Credit grant routes → Prepaid credit ledger: updates credits
server/creditGrantRoutes.ts - Credit request routes → Prepaid credit ledger: uses credit ledger
server/creditRequestRoutes.ts - Credit grant routes → Request validation: validates input
server/creditGrantRoutes.ts - Credit grant routes → Activity audit writer: writes audit records
server/creditGrantRoutes.ts - Worker entry and routing → Admin users: enforces authority
README.md - Worker entry and routing → Firebase Admin access: persists decisions
README.md