How hjeandedieu/diana works
Diana is a memory-aware AI companion for developers. A user signs in, opens or creates a conversation, and sends a prompt; the frontend calls the backend, which coordinates the AI service and persistent data, then returns the response for display. Separate product workflows manage remembered context, conversation history, account access, and profile settings. The README documents PostgreSQL and OpenAI integrations; sampled source confirms session persistence and auth logic, but does not expose the detailed chat or memory orchestration, so those internal links are limited to documented architecture.
Main entry points: app.js Express API · App.tsx Diana UI · main.py FastAPI assistant · memory.py Memory handler
Components 24
Frontend
- Diana UI
frontend/src/App.tsx - Login and register
frontend/src/services/authService.ts - Chat interface
frontend/src/pages/ChatScreen.tsx - Memories screen
frontend/src/pages/MemoriesScreen.tsx - Profile settings
frontend/src/pages/ProfileScreen.tsx - Session API client
frontend/src/services/sessionService.ts - Auth API client
frontend/src/services/authService.ts
Backend API
- Express API
backend/src/app.js - Auth routes
backend/src/routes/auth.routes.js - Session routes
backend/src/routes/session.routes.js - Chat routes
backend/src/routes/chat.routes.js - Memory routes
backend/src/routes/memories.routes.js - User routes
backend/src/routes/users.routes.js - Session controller
backend/src/controllers/session.controller.js - Auth service
backend/src/services/auth.service.js - Chat service
backend/src/services/chat.service.js - Memory service
backend/src/services/memory.service.js
AI Assistant
- FastAPI assistant
ai-service/app/main.py - AI chat handler
ai-service/app/routers/chat.py - Memory handler
ai-service/app/routers/memory.py
Persistence
- PostgreSQL
- Prisma client
backend/src/lib/prisma.ts
Other components
- Developer
- OpenAI API
Connections 27
- Developer → Diana UI: uses
- Diana UI → Login and register: routes to
- Diana UI → Chat interface: routes to
- Diana UI → Memories screen: routes to
- Diana UI → Profile settings: routes to
- Login and register → Auth API client: submits credentials
- Auth API client → Express API: auth requests
- Chat interface → Session API client: manages sessions
- Session API client → Express API: session requests
- Memories screen → Express API: memory requests
- Profile settings → Express API: account requests
- Express API → Auth routes: mounts
- Express API → Session routes: mounts
- Express API → Chat routes: mounts
- Express API → Memory routes: mounts
- Express API → User routes: mounts
- Session routes → Session controller: dispatches
- Session controller → Prisma client: calls service
- Auth service → Prisma client: reads and writes
- Prisma client → PostgreSQL: persists data
- Express API → FastAPI assistant: forwards chat
- FastAPI assistant → AI chat handler: registers
- FastAPI assistant → Memory handler: registers
- AI chat handler → OpenAI API: generates replies
- Memory handler → OpenAI API: extracts memories
- Chat service → FastAPI assistant: AI integration
- Memory service → Memory handler: AI integration