How vankhanhanny/gnec works
Main Components
• Frontend (Next.js + TypeScript)
• Backend REST API (NestJS + Prisma + PostgreSQL)
• ASL Service (FastAPI + WebSockets + ML inference)
• AI Component (Python scripts + model training)
• External Services: Clerk (auth), Google Gemini API (sentence analysis)
• Database: PostgreSQL
• Deployment/orchestration: Docker-Compose
Relationships and Data Flows
• User’s Browser ↔ Frontend: HTTP/HTTPS, React UI interactions
• Frontend ↔ Backend API: REST calls for user data, job search, profile, guarded by Clerk tokens
• Frontend ↔ ASL Service: WebSocket for live video frames → inference results streamed back
• Backend ↔ Database: Prisma ORM generates SQL queries → PostgreSQL
• ASL Service ↔ AI Models: loads PyTorch models from filesystem, runs inference
• ASL Service ↔ Google Gemini: HTTP API calls for sentence analysis
• AI Component (training notebooks, scripts) is offline/development: accesses raw videos, trains models, outputs to models directory
Architectural Patterns
• Microservices: Backend API and ASL Service are separate containers/processes
• Layered architecture in Backend: Controllers → Services → Repositories → Prisma → Database
• Frontend: “app” directory and UI component library (atomic/ui-layout components)
• Real-time streaming with WebSockets in ASL Service
• External auth integration (Clerk strategy in NestJS and Next.js middleware)
Technologies & Frameworks
• Frontend: Next.js, React, TypeScript, Clerk SDK, Tailwind CSS (postcss.config)
• Backend: NestJS, TypeScript, Prisma, PostgreSQL, Clerk Guard
• ASL Service: Python, FastAPI, WebSockets (starlette), PyTorch models, Google Gemini API
• AI Component: Python Jupyter notebooks, OpenCV (or similar), PyTorch, LSTM/CNN models
• Orchestration: Docker/Docker-Compose, virtual environments for Python services
• Notes on ports (e.g., Frontend:3000, Backend:5000, ASL:8000)