How anishvermaishere/look-chat works
Look AI is a React/FastAPI chat product. Users register or log in, enter the chat interface, manage chat history, send messages, and receive streamed AI responses rendered with markdown and reasoning indicators. The backend separates HTTP routing, controllers, domain services, model-provider integration, and persistence; the frontend separates routes, chat UI/state, and API clients. Several backend relationships are supported by the source index, while frontend and unsampled implementation links rely on README capability statements; those links are shown as documented rather than inspected call paths.
Main entry points: services/chat.py Chat service · chat-panel.tsx Chat panel · routes/chat.py Chat routes · auth.py Auth service
Components 29
Web application
- App routes
fe/src/routes/app-routes.tsx - Chat page
fe/src/pages/chat.tsx - Chat panel
fe/src/features/chat/components/chat-panel.tsx - Message renderer
fe/src/features/chat/components/chat-messages.tsx - Chat state
fe/src/features/chat/provider/chat-provider.tsx - Chat API client
fe/src/features/chat/services/apis/chat.ts - Chat search
fe/src/features/chat/components/searchbar.tsx - Login and registration
fe/src/components/login.tsx - Auth API client
fe/src/services/apis/auth.ts
API and identity
- Chat routes
be/app/routes/chat.py - Auth routes
be/app/routes/auth.py - User routes
be/app/routes/user.py - JWT middleware
be/app/middleware/auth.py - Chat controller
be/app/controllers/chat.py - Auth controller
be/app/controllers/auth.py - Auth service
be/app/services/auth.py
Chat domain
- Chat service
be/app/services/chat.py - Message service
be/app/services/message.py - Assistant service
be/app/services/assistant.py - AI service
be/app/services/ai.py
Runtime integrations
- OpenAI provider
be/app/llm/open_ai.py - Redis cache
be/app/core/cache.py - Cache adapter
be/app/utils/redis.py - JWT service
be/app/utils/jwt.py
Persistence
- Database sessions
be/app/database/database.py - Chat records
be/app/database/models/chat.py - Message records
be/app/database/models/message.py - User records
be/app/database/models/user.py
Other components
- Chat user
Connections 36
- Chat user → App routes: opens app
README.md - App routes → Chat page: routes to
fe/src/routes/app-routes.tsx - Chat page → Chat panel: shows chat
- Chat panel → Chat state: uses state
- Chat panel → Message renderer: renders messages
- Chat panel → Chat API client: sends requests
- Chat panel → Chat search: offers search
- Chat API client → Chat routes: calls API
- Chat user → Login and registration: registers or logs in
README.md - Login and registration → Auth API client: submits credentials
- Auth API client → Auth routes: calls API
- Auth routes → Auth controller: delegates
be/app/routes/auth.py - Auth controller → Auth service: invokes
be/app/controllers/auth.py - Auth service → User records: queries users
be/app/services/auth.py - Auth service → JWT service: creates tokens
be/app/services/auth.py - Auth routes → Database sessions: gets session
be/app/routes/auth.py - Chat user → Chat panel: sends messages
README.md - Chat routes → Chat controller: delegates
be/app/routes/chat.py - Chat controller → Chat service: invokes
- Chat service → Chat records: uses records
be/app/services/chat.py - Chat service → Message records: uses records
be/app/services/chat.py - Chat service → Message service: uses service
be/app/services/chat.py - Chat service → Assistant service: uses service
be/app/services/chat.py - Chat service → AI service: requests AI
be/app/services/chat.py - Chat service → OpenAI provider: uses provider
be/app/services/chat.py - Chat routes → Database sessions: gets session
be/app/routes/chat.py - Chat service → Chat panel: streams response
README.md - Chat panel → Message renderer: renders markdown
README.md - Chat routes → JWT middleware: protected by
be/app/main.py - JWT middleware → JWT service: verifies token
be/app/middleware/auth.py - User routes → Chat controller: uses controller
be/app/routes/user.py - User routes → JWT middleware: protected by
be/app/main.py - Auth service → Redis cache: caches profile
be/app/services/auth.py - Redis cache → Cache adapter: constructs adapter
be/app/core/cache.py - Database sessions → User records: backs records
be/app/database/models/user.py - Database sessions → Message records: backs records
be/app/database/models/message.py