How rwr9857/skn14-final-1team-web works
Purpose and Entry Points
CodeNova is a Django-based internal developer-support system with two AI surfaces: a Google API documentation RAG assistant and a permission-filtered internal-document sLLM chatbot. It also provides account approval, chat persistence, saved cards/API keys, and a community.
• Process/runtime entry points: manage.py, codenova/wsgi.py, codenova/asgi.py
• URL composition and application settings: codenova/urls.py, codenova/settings.py, codenova/settings_prod.py
Web Application and Domain Boundaries
The Django project separates user identity, primary product UI/data, API-chat orchestration, internal-chat integration, and personal-content views into apps.
• Primary browser-facing views/templates and chat/community persistence: main/views.py, main/models.py, main/urls.py
• API RAG endpoints and model-facing operations: apichat/views.py, apichat/urls.py
• Internal chatbot endpoints and remote sLLM client: internal/views.py, internal/utils/sllm.py
• Signup/login/approval and user organization attributes: uauth/models.py, uauth/views.py, uauth/urls.py
API Assistant: LangGraph RAG Pipeline
The API assistant accepts text, image, and voice input; maintains chat context; classifies requests as API/general/unsupported; and uses GPT-4o to answer API questions grounded in retrieval results.
• Workflow assembly and graph nodes: apichat/utils/main3.py, apichat/utils/langgraph_setting2.py, apichat/utils/langgraph_node2.py
• Retrieval combines Chroma/BGE-M3 semantic search and BM25 keyword search, spanning original API documents and generated QA content: apichat/utils/retriever_hybrid.py, apichat/utils/retriever.py, apichat/utils/retriever_bm25.py
• Vector-store boundaries are encapsulated separately for original and QA sources: apichat/utils/vector_db.py, apichat/utils/vector_db_qa.py
• The graph can evaluate answer quality and retry with regenerated searches; external model calls are to OpenAI GPT-4-class APIs.
Multimodal and Object Storage Flow
Uploaded chat images are stored externally and associated with persisted messages; audio is transcribed before entering the same RAG/chat path.
• S3 integration for API-chat uploads: apichat/aws_s3_service.py
• Speech-to-text adapter: apichat/utils/whisper.py
• Chat/session/message/image and saved-card records: main/models.py
• Profile-image S3 handling: uauth/aws_s3_service.py
Internal sLLM Chat and Authorization Boundary
Internal chat is deliberately separate from the OpenAI API-assistant pipeline. Django obtains the authenticated user’s department/role, limits accessible internal-document retrieval accordingly, and calls a remote fine-tuned Qwen3-8B service. The model decides between direct conversation and document-search tool calls, with formal/informal response modes.
• Django integration boundary: internal/views.py, internal/urls.py
• Remote sLLM invocation client: internal/utils/sllm.py
• User department, rank, and approval state: uauth/models.py
• Internal-chat UI is integrated with the main application: main/templates/my_app/internal_docs.html, main/static/my_app/js/chat/chat-internal.js
Persistent Product Data
MySQL is the system of record for users, approval lifecycle, chat sessions/messages/images, saved cards, API keys, posts, comments, and likes. Chroma is a separate retrieval datastore rather than transactional application storage.
• Core product schema: main/models.py
• User/approval schema: uauth/models.py
• Internal app model boundary: internal/models.py
Deployment and External Infrastructure
The application is containerized and configured for production Django serving through Gunicorn/Uvicorn. Deployment targets AWS Elastic Beanstalk; MySQL runs separately on EC2. AWS S3 stores user/chat media. The fine-tuned Qwen service is hosted externally on RunPod via vLLM/FastAPI, while API chat uses OpenAI. CI builds container images on GitHub Actions.
• Container and EB descriptors: Dockerfile, Dockerrun.aws.json
• Gunicorn configuration: gunicorn.conf.py
• CI workflow: .github/workflows/docker-image.yml
Main entry points: urls.py Project routing & settings · views.py API chat endpoints · main3.py LangGraph workflow · retriever_hybrid.py Hybrid retrieval
Components 20
Django application
- Django runtime · WSGI/ASGI process entry points.
manage.py - Project routing & settings
codenova/urls.py - Product UI & chat · Browser views plus chat, community, and saved-content persistence.
main/views.py - Product schema · Sessions, messages, images, cards, API keys, and community records.
main/models.py - Identity & approval · Signup, login, approval, department, and rank.
uauth/views.py - User schema
uauth/models.py
API assistant RAG
- API chat endpoints
apichat/views.py - LangGraph workflow · Classifies requests, preserves context, evaluates answers, and retries retrieval.
apichat/utils/main3.py - Hybrid retrieval · Combines BGE-M3 semantic and keyword search.
apichat/utils/retriever_hybrid.py - API document vectors
apichat/utils/vector_db.py - Generated QA vectors
apichat/utils/vector_db_qa.py - OpenAI GPT-4o · Generates grounded API-assistant answers.
- Upload & speech adapters · Stores images and transcribes voice before RAG processing.
apichat/aws_s3_service.py
Internal sLLM chat
- Internal chat integration · Applies authenticated department and role access constraints.
internal/views.py - Remote sLLM client
internal/utils/sllm.py - Qwen3-8B service · Selects direct conversation or authorized document-search tools.
Deployment & infrastructure
- MySQL · Runs separately on EC2.
- AWS S3 · Stores chat and profile media.
- Container deployment · Production Django serving via Gunicorn/Uvicorn.
Dockerfile - Image build CI
.github/workflows/docker-image.yml
Connections 21
- Django runtime → Project routing & settings: loads
- Project routing & settings → Product UI & chat: routes browser UI
- Project routing & settings → Identity & approval: routes account flows
- Project routing & settings → API chat endpoints: routes API chat
- Project routing & settings → Internal chat integration: routes internal chat
- Product UI & chat → Product schema: persists product data
- Identity & approval → User schema: manages users
- Product schema → MySQL: stored in
- User schema → MySQL: stored in
- API chat endpoints → LangGraph workflow: submits chat requests
- API chat endpoints → Upload & speech adapters: handles image and voice input
- Upload & speech adapters → AWS S3: stores uploads
- LangGraph workflow → Hybrid retrieval: retrieves evidence
- Hybrid retrieval → API document vectors: semantic source
- Hybrid retrieval → Generated QA vectors: QA source
- LangGraph workflow → OpenAI GPT-4o: generates and evaluates
- Internal chat integration → User schema: reads role and department
- Internal chat integration → Remote sLLM client: invokes authorized chat
- Remote sLLM client → Qwen3-8B service: remote inference
- Image build CI → Container deployment: builds image
- Container deployment → Django runtime: serves application