How elevate-skills/chat-ai works
ChatAI is a React application backed by FastAPI: a user submits a prompt, the chat UI requests a streamed completion, and the backend can enrich current-information queries with web results before forwarding them to OpenRouter. Authentication and chat-history retrieval are separate flows. The README also describes Firestore-backed projects and settings, but their implementation is not shown in the sampled source; the corresponding frontend pages appear to be product surfaces rather than demonstrated data workflows.
Main entry points: App.jsx App router · chat.py Chat completions · AuthContext.jsx Auth context · Home.jsx Chat page
Components 24
Web application
- App router
frontend/src/App.jsx - Chat page
frontend/src/pages/Home.jsx - Chat interface
frontend/src/components/Chat.jsx - Navigation
frontend/src/components/Sidebar.jsx - Chat library
frontend/src/pages/Library.jsx - Projects
frontend/src/pages/Projects.jsx - Scheduled tasks
frontend/src/pages/Scheduled.jsx - Apps and integrations
frontend/src/pages/Apps.jsx - Sign in
frontend/src/pages/Login.jsx - Sign up
frontend/src/pages/Signup.jsx - Route guard
frontend/src/components/ProtectedRoute.jsx
Identity and preferences
- Auth context
frontend/src/contexts/AuthContext.jsx - Theme context
frontend/src/contexts/ThemeContext.jsx - Firebase client
frontend/src/services/firebase.js
Backend API
- FastAPI app
backend/app/main.py - Chat completions
backend/app/api/chat.py - History endpoint
backend/app/api/history.py - Backend settings
backend/app/core/config.py - Token verification
backend/app/core/security.py
External services
- OpenRouter
- Web search
- Firebase Auth
- Firestore
Other components
- User
Connections 29
- User → App router: uses
frontend/src/App.jsx - App router → Chat page: routes to
frontend/src/App.jsx - App router → Chat library: routes to
frontend/src/App.jsx - App router → Projects: routes to
frontend/src/App.jsx - App router → Scheduled tasks: routes to
frontend/src/App.jsx - App router → Apps and integrations: routes to
frontend/src/App.jsx - App router → Sign in: routes to
frontend/src/App.jsx - App router → Sign up: routes to
frontend/src/App.jsx - App router → Route guard: guards routes
frontend/src/App.jsx - App router → Auth context: provides
frontend/src/App.jsx - App router → Theme context: provides
frontend/src/App.jsx - Chat page → Navigation: renders
frontend/src/pages/Home.jsx - Chat page → Chat interface: renders
frontend/src/pages/Home.jsx - Chat interface → FastAPI app: requests stream
frontend/src/components/Chat.jsx - FastAPI app → Chat completions: mounts route
backend/app/main.py - FastAPI app → History endpoint: mounts route
backend/app/main.py - Chat completions → Backend settings: reads settings
backend/app/api/chat.py - Chat completions → OpenRouter: streams completion
backend/app/api/chat.py - Chat completions → Web search: searches query
backend/app/api/chat.py - History endpoint → Token verification: validates user
backend/app/api/history.py - History endpoint → Firestore: reads chat records
backend/app/api/history.py - Token verification → Backend settings: reads credentials
backend/app/core/security.py - Token verification → Firebase Auth: verifies token
backend/app/core/security.py - Auth context → Firebase client: uses client
frontend/src/contexts/AuthContext.jsx - Auth context → Firebase Auth: authenticates
README.md - Navigation → Theme context: uses theme
frontend/src/components/Sidebar.jsx - Navigation → Auth context: uses identity
frontend/src/components/Sidebar.jsx - Projects → Firestore: uses storage
- Chat library → Firestore: uses storage