How davfilsdev/zenithai-backend works
Zenith AI is a Django REST API for account management and persistent AI conversations. Users register or obtain JWTs, then manage conversations or submit a message; the chat endpoint creates or finds the conversation, saves the user message, and uses Gemini to generate a reply. The README also documents profile, conversation CRUD, and OpenAPI/Swagger/ReDoc capabilities. Edges follow shown imports and route declarations or documented API behavior; database persistence and settings wiring are not fully visible in the excerpts.
Main entry points: views.py Conversation and chat API · models.py Conversation and message data · services.py Gemini service · urls.py User routes
Components 14
API routing
- User routes
users/urls.py - Chat routes
chat/urls.py - API schema and docs
backend/urls.py
Accounts
- Registration, tokens, profile
users/views.py - Account serializers
users/serializers.py - User and profile data
users/models.py
Conversations and chat
- Conversation and chat API
chat/views.py - Conversation and message serializers
chat/serializers.py - Conversation and message data
chat/models.py
Runtime services
- Gemini service
chat/services.py - Django settings
backend/settings.py
Other components
- Frontend client
- Google Gemini
- PostgreSQL
Connections 14
- Frontend client → User routes: calls auth API
README.md - Frontend client → Chat routes: calls chat API
README.md - User routes → Registration, tokens, profile: routes to
users/urls.py - Chat routes → Conversation and chat API: routes to
chat/urls.py - Registration, tokens, profile → Account serializers: uses
users/views.py - Conversation and chat API → Conversation and message serializers: uses
chat/views.py - Conversation and chat API → Conversation and message data: reads and writes
chat/views.py - Conversation and chat API → Gemini service: requests generation
chat/views.py - Gemini service → Google Gemini: generates content
chat/services.py - Conversation and message data → User and profile data: references user
chat/models.py - Conversation and message data → PostgreSQL
- User and profile data → PostgreSQL
- Django settings → Gemini service: configures key and model
- Frontend client → API schema and docs: views API docs
README.md