How devranbir/speechviber works
Project Type and Purpose
• SpeechViber is a full-stack, single-page web application designed to improve communication skills via AI-driven, real-time feedback.
• It uses React.js on the client, Firebase (Authentication + Realtime Database) as the backend, and external AI APIs (Groq for NLP and AssemblyAI or similar for speech-to-text) plus client-side face-api.js models for visual analysis.
File Structure
• Top level:
• public/ – static assets including HTML, manifest, and face-api.js model shards
• src/ – main application code
• webpack.config.js & vite.config.js – build tools
• firebase.js & src/firebase/config.js – Firebase initialization
• src/components – reusable UI pieces and error/route handling
• src/pages – feature modules (SpeechAnalysis, GrammarCheck, Interview, etc.)
• src/services – wrappers for core domain logic: audioService.js, historyService.js
• src/contexts & src/context – React Contexts for Auth, Theme, Particle effects, User state
• src/hooks – custom hooks for audio recording, error handling
• src/utils – cross-cutting helpers (achievements, error handlers, profile cleanup)
README for Architecture Insights
• Frontend: React + Material-UI + Framer Motion
• Backend: Firebase Authentication + Realtime Database
• AI Integration: Groq APIs for NLP, Text-to-Speech, Speech-to-Text; face-api.js models for facial expression analysis
• Hosting: GitHub Pages / Vercel
Main Components and Relationships
a. Client Browser (User Interface)
• React SPA orchestrates pages, components, contexts, hooks
• Static assets served from public/ (index.html, face-api.js models)
b. Authentication Layer
• Firebase Auth handles sign-in/sign-up, token management
• PrivateRoute component enforces protected pages
c. Data Layer
• Firebase Realtime Database stores user profiles, session history, progress metrics, achievements
• historyService.js abstracts read/write operations
d. AI Services
• Groq API (NLP, feedback generation)
• AssemblyAI (speech-to-text conversion) or similar external endpoint
• face-api.js (client-side model files loaded from public/models for visual analysis)
e. Hosting & Build
• Vite/Webpack build outputs static files
• Deployment to GitHub Pages or Vercel
Architectural Patterns & Design Principles
• Single-Page Application pattern with React Router for page navigation
• Separation of concerns:
• UI layer (components/pages/styles)
• Business logic (services, hooks)
• State management (contexts)
• BaaS pattern using Firebase for auth and realtime data
• Client-heavy AI integration: static models + runtime API calls