You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
graph TB
subgraph "Frontend Layer"
A[React 19.1.1] --> B[TypeScript 5.9.3]
B --> C[Vite 7.1.7]
C --> D[React Router 7.9.4]
end
subgraph "Real-time Communication"
E[Socket.io Client] --> F[WebSocket]
F --> G[Socket.io Server]
end
subgraph "Backend Layer"
H[Node.js 18+] --> I[Express.js 4.18.2]
I --> J[ES Modules]
J --> K[PostgreSQL Driver]
end
subgraph "AI Services"
L[OpenAI GPT-4o] --> M[OpenAI TTS]
N[Google Gemini 2.0] --> O[Fast Scan Service]
P[Response Cache] --> Q[Cost Optimization]
end
subgraph "Database"
R[PostgreSQL 15+] --> S[JSONB Storage]
S --> T[GIN Indexes]
T --> U[Full-text Search]
end
A --> E
G --> H
I --> L
I --> N
K --> R
Loading
π¨ Frontend Stack
Core Technologies
Technology
Version
Logo
Purpose
19.1.1
UI Framework
5.9.3
Type Safety
7.1.7
Build Tool
7.9.4
Client Routing
Voice & Audio Technologies
Technology
Purpose
Integration
Voice Input
Speech Recognition
Voice Output
Natural Speech
Real-time
WebSocket Communication
Camera & Media
Technology
Purpose
Browser Support
Camera Access
Chrome, Edge, Safari
Frame Capture
All Modern Browsers
βοΈ Backend Stack
Core Technologies
Technology
Version
Logo
Purpose
18+
Runtime Environment
4.18.2
Web Framework
4.7.2
Real-time Communication
8.16.3
Database Driver
Development Tools
Technology
Purpose
Configuration
Module System
import/export syntax
Environment
Config management
Security
Cross-origin requests
π€ AI & ML Services
OpenAI Services
Service
Model
Cost
Purpose
GPT-4o
$0.020/frame
Detailed frame analysis
GPT-4o-mini
$0.002/frame
Fast danger detection
tts-1/tts-1-hd
$0.005/response
Voice synthesis
Audio API
$0.30/min
Voice-to-voice (optional)
Google Services
Service
Model
Cost
Purpose
2.0 Flash Exp
$0.01-0.02/chat
Conversational AI
AI Pipeline Architecture
graph LR
A[Frame Captured] --> B[Instant Ack 0ms]
A --> C[Fast Scan 500ms]
A --> D[Full Analysis 2s]
B --> E[User Feedback]
C --> F[Danger Alert]
D --> G[Complete Description]
E --> H[Audio Queue]
F --> H
G --> H
H --> I[Text-to-Speech]
I --> J[User Hears Response]
graph TB
A[Frame Captured] --> B[0ms: Looking around...]
A --> C[500ms: Path clear!]
A --> D[2000ms: You're in a hallway...]
B --> E[User hears immediately]
C --> F[Safety alert if danger]
D --> G[Full description]
style B fill:#4CAF50
style C fill:#FF9800
style D fill:#2196F3
Loading
Caching System
Cache Type
Hit Rate
Response Time
Cost Savings
50%+
150ms
50% API cost
80%+
100ms
80% API cost
0%
Always fresh
Safety first
π§ Development Tools
Frontend Development
Tool
Purpose
Configuration
Code Quality
React hooks rules
Type Checking
Strict mode enabled
Development
HMR, fast builds
Backend Development
Tool
Purpose
Configuration
Runtime
ES Modules
Web Server
REST + WebSocket
Real-time
Event-driven
Database Tools
Tool
Purpose
Access
Database Management
Web interface
Query Execution
Supabase dashboard
Advanced Queries
Optional tool
π Cost Analysis
API Costs Breakdown
Service
Model
Cost per Unit
Usage
Monthly Cost*
Vision Analysis
$0.020/frame
4 frames/min
$144
Fast Scan
$0.002/frame
4 frames/min
$14.40
Voice Output
$0.005/response
4 responses/min
$36
Conversation
$0.01/chat
10 chats/day
$3
Voice-to-Voice
$0.30/min
Optional
$0-432
*Based on 1 hour/day usage
Cost Optimization
Optimization
Savings
Implementation
50%
Cache safe scenarios
90%
GPT-4o-mini for safety
60%
Only when needed
Total Monthly Cost
Without Optimization: ~$200-600/month
With Optimization: ~$100-300/month
With Caching: ~$50-150/month
π Deployment Architecture
Production Stack
graph TB
subgraph "Frontend Hosting"
A[Netlify] --> B[React Build]
B --> C[Static Files]
end
subgraph "Backend Hosting"
D[Railway] --> E[Node.js Server]
E --> F[WebSocket Server]
end
subgraph "Database Hosting"
G[Supabase] --> H[PostgreSQL]
H --> I[Connection Pooling]
end
subgraph "AI Services"
J[OpenAI API] --> K[GPT-4o]
L[Google AI] --> M[Gemini 2.0]
end
A --> D
E --> G
E --> J
E --> L
Loading
Environment Configuration
# Production Environment
NODE_ENV=production
PORT=3000
FRONTEND_URL=https://your-app.netlify.app
DATABASE_URL=postgresql://postgres.[project]:[password]@pooler.supabase.com:6543/postgres
OPENAI_API_KEY=your_openai_key
GEMINI_API_KEY=your_gemini_key
π Project Statistics
Metric
Count
Status
100+
β Complete
10,000+
β Complete
9
β Complete
10
β Complete
6
β Complete
6
β Complete
15+
β Complete
20+
β Complete
π― Key Features Implemented
β Completed Features
Feature
Technology
Status
Web Speech API
β Complete
getUserMedia
β Complete
OpenAI Vision
β Complete
Socket.io
β Complete
PostgreSQL
β Complete
Custom Service
β Complete
π In Progress
Feature
Technology
Progress
Gemini Chat
50%
Frame Analysis
30%
Alert System
20%
π Architecture Rating
Aspect
Rating
Description
βββββ
Clean, typed, well-documented
βββββ
3-tier optimization system
βββββ
Microservices-ready architecture
βββββ
Voice-first, screen-reader friendly
βββββ
Comprehensive guides
Overall Rating: βββββ (Excellent)
π Quick Start
Development Setup
# Clone the repository
git clone https://github.com/your-username/visualaid.git
cd visualaid
# Backend setupcd backend
npm install
cp ../env.example .env
# Edit .env with your API keys
npm start
# Frontend setup (new terminal)cd frontend
npm install
npm run dev
# Open browser# http://localhost:5173
Production Deployment
# Frontend buildcd frontend
npm run build
# Deploy to Netlify# Connect GitHub repo to Netlify# Set build command: npm run build# Set publish directory: dist# Backend deploy to Railway# Connect GitHub repo to Railway# Set environment variables# Deploy automatically