OSS · OPEN SOURCE · 2025
LLM Chat System (ITSE500)
Full-stack AI chat platform with Django REST (JWT/OAuth), React web, and Flutter mobile
Django · Flutter · React · JWT
GitHub | Release v1.0.0 | Live

Overview / Engineering Problem
Building a multi-platform AI chat application requires coordinating unified conversation state, flexible authentication (including frictionless onboarding via guest sessions alongside authenticated user accounts), and consistent API contracts across both web browsers and mobile devices.
LLM Chat System (ITSE500) is an open-source, full-stack AI chat platform uniting a Django REST backend with JWT/OAuth authentication, a live React web client, and a Flutter Android mobile client—complete with seamless guest session support.
Architecture & Technical Decisions
The platform enforces a clean API-first separation between backend orchestration and multi-client interfaces:
- Django REST Backend Core: Serves as the central API authority managing LLM chat interactions, conversation persistence, and unified authentication flows.
- Dual Authentication + Guest Sessions (JWT & OAuth): Combines stateless JWT token validation and OAuth flows for registered accounts with structured guest session support so visitors can interact immediately without mandatory signup friction.
- React Web Client: Provides a responsive browser interface deployed live at
https://react.itse500-ok.ly, consuming the same REST contracts as mobile clients. - Flutter Android Client: Delivers a native mobile experience sharing the backend's JWT/OAuth and guest session endpoints, demonstrating cross-client contract consistency.
SDLC & Quality Practices
Designing a cross-platform academic/open-source system with production deployment discipline:
- API Contract Consistency: Standardizing JSON payloads, error structures, and token handling across web and Android clients prevented client-specific backend forks.
- Clear Auth Boundaries: Isolating guest session privileges from authenticated JWT/OAuth capabilities kept onboarding smooth without weakening access boundaries.
- Public Verification: Released openly on GitHub alongside a live web deployment for transparent evaluation.
Stack & Deliverables
| Layer | Technology / Deliverable | Role in System |
|---|---|---|
| Backend & Auth | Django REST, JWT & OAuth | Chat orchestration, auth flows, and guest session API |
| Web Frontend | React | Live browser chat client (react.itse500-ok.ly) |
| Mobile Client | Flutter (Android) | Native Android chat application consuming unified APIs |
| Open Source & Live | GitHub (arousi/ITSE500-Django) & Live Demo |
Publicly verifiable full-stack codebase and web deployment |
Latest Release: v1.0.0 — Prompeteer Django REST LLM Chat Backend (v1.0.0)
Overview
Prompeteer Server (arousi/ITSE500-Django) is a Django 5.1.7 / Django REST Framework backend for a privacy-focused, multi-provider LLM chat application developed for ITSE500. It powers multi-provider OAuth, JWT & guest/visitor authentication, unified profile and conversation sync, client-side encryption key provisioning, and asynchronous LLM execution, while serving as the canonical OpenAPI contract source (api/schema.yaml) for the Flutter and React clients.
Tag Note: Tag
v1.0.0marks the initial release milestone (bbcd3a3). Subsequent updates onmainexpandedchat_api, environment-gated production infrastructure, CI workflows, and the publishedapi/schema.yamlcontract documented below.
Verified Modules & API Surface
All API endpoints are namespaced under /api/v1/<app>/:
| Module | Base Path | Responsibilities & Key Endpoints |
|---|---|---|
auth_api |
/api/v1/auth_api/ |
Registration (/register/), login (/login/), logout with refresh-token blacklisting (/logout/), JWT refresh (/token/refresh/), email PIN verification (/verify-email-pin/), password setup (/set-password-after-email-verify/), health check (/health/), and OAuth flows (/google/, /openrouter/, /github/, /microsoft/ /authorize/, /callback/, /oauth/result/<state_value>/). |
user_mang |
/api/v1/user_mang/ |
UnifiedSyncView (/me/) supporting GET/POST/PATCH/DELETE for profile and conversation sync, guest (temp_id) resolution, CSV/PDF data export, and account soft-delete. |
chat_api |
/api/v1/chat_api/ |
User-scoped CRUD for conversations/ and conversations/{id}/, paginated conversations/{id}/messages/, and multipart conversations/{id}/messages/{mid}/attachments/ (25 MB cap, server-computed SHA-256 & byte size). Dispatches LLM completions via litellm/openai through a strict pending → streaming → complete / error state machine. |
crypto_api |
/api/v1/crypto_api/ |
UserUMKView (/umk/) for GET/POST retrieval and one-time provisioning of a base64-encoded 32-byte User Master Key (UMK). |
core & prompeteer_server |
/, /admin/, /api/ |
Host-aware SPA/landing routing (root_router), /team/, Jazzmin admin (/admin/), and drf-spectacular OpenAPI schema (/api/schema/), Swagger UI (/api/docs/), and ReDoc (/api/redoc/). |
Authentication, Security & Guest Architecture
- JWT Lifecycle: Short-lived 15-minute access tokens (
JWT_ACCESS_MINUTES) paired with 7-day refresh tokens (JWT_REFRESH_DAYS), withROTATE_REFRESH_TOKENS=TrueandBLACKLIST_AFTER_ROTATION=Truebacked byCustom_UserUUID primary keys. - Multi-Provider OAuth + PKCE: Unified authorize/callback/bridge endpoints for Google, OpenRouter, GitHub, and Microsoft with
OAuthStateTTL tracking and encrypted provider token persistence (ProviderOAuthToken). - Privacy-Preserving Guest Mode: Visitors receive a stable
temp_idUUID for multi-device conversation sync viaUnifiedSyncViewwithout requiring PII. - Hardening & Scoping: DRF rate throttling (
auth:10/min,anon:60/min), user-scoped queryset filtering (returning404for non-owned chat resources), and fail-fast startup checks whenDJANGO_DEBUG=FalsewithoutSECRET_KEYorBACKEND_PASSWORD_SALT.
Docker, Compose & Env-Gated Infrastructure
- Container Runtime: Python
3.13-slimimage (Dockerfile) running Gunicorn (prompeteer_server.wsgi:application, 3 workers on port8000) viaentrypoint.sh(migrate --noinputandcollectstatic --noinputwith WhiteNoise). - Production Stack (
docker-compose.prod.yml): Orchestratesweb(health-checked on/api/v1/auth_api/health/),celery-worker, andcelery-beat(plus an optionalchannelsASGI/Uvicorn service) behind a TLS reverse proxy (Caddy/nginx). - Env-Gated Services with Local Fallbacks:
- PostgreSQL (
DB_HOSTset) → falls back to SQLite. - Redis (
REDIS_URLset) → falls back to LocMemCache / InMemoryChannelLayer. - MinIO / S3 Media (
AWS_S3_ENDPOINT_URLset) → falls back to local FileSystemStorage. - Celery (
CELERY_BROKER_URL/REDIS_URLset) → falls back to synchronous inline execution (CELERY_TASK_ALWAYS_EAGER=True).
- PostgreSQL (
Known Issues
The following limitations from the initial v1.0.0 release are preserved for transparency and open contributions:
- OTP Email Dispatch: Email dispatch for OTPs requires thorough debugging.
- Password Reset: Password reset functionality is coupled to OTP delivery and is impacted by the OTP email dispatch issue.
- Account Verification: Account verification depends on receiving OTPs from the email dispatcher.
- Chat Data Storage: Chat data storage in the initial
v1.0.0snapshot exhibits edge-case bugs that require debugging. - Key Rotation (
crypto_api):POST /api/v1/crypto_api/umk/?rotate=truecurrently returns400(Rotation not implemented).