How elixzon/friendship-communication-app works
Friendship Communication is a paired, code-based experience for friends to answer prompts privately and receive relationship-level reflections. The main journey is create or join a session, give consent, start a question round, submit answers, synchronize progress, and view generated insights. The frontend manages session state and presents the experience; FastAPI routes coordinate session services and persistence. The tree and excerpts establish the session and WebSocket paths, but do not fully expose answer/insight orchestration, so those links are limited to supported evidence.
Main entry points: session_routes.py Session endpoints · InviteContext.tsx Invite state · main.py API application · session_service.py Session lifecycle
Components 19
Friendship experience
- Web experience
frontend/pages/index.tsx - Invite flows
frontend/pages/invite/index.tsx - Session room
frontend/pages/session.tsx - Invite state
frontend/src/contexts/InviteContext.tsx - HTTP client
frontend/src/api.ts - WebSocket client
frontend/src/websocket.ts
Session backend
- API application
app/main.py - Session endpoints
app/routes/session_routes.py - Database access
app/database.py
Session domain
- Session lifecycle
app/services/session_service.py - Question flow
app/services/question_service.py - Answer handling
app/services/answer_service.py - Insight generation
app/services/insight_service.py - Question bank
app/data/questions.py
Live updates
- WebSocket endpoint
app/websocket/routes.py - Connection manager
app/websocket/manager.py
Other components
- Friend
- MongoDB
- Gemini API
Connections 20
- Friend → Web experience: opens
- Friend → Invite flows: creates or joins
- Invite flows → Invite state: updates session
- Session room → Invite state: reads session
- Invite state → HTTP client: requests session
- HTTP client → API application: HTTP requests
- API application → Session endpoints: dispatches
- Session endpoints → Session lifecycle: calls lifecycle
- Session lifecycle → Database access: reads and writes
- Database access → MongoDB: queries
- Session lifecycle → Question flow: selects questions
- Question flow → Question bank: selects from
- Session endpoints → Connection manager: broadcasts events
- Invite state → WebSocket client: opens connection
- WebSocket client → WebSocket endpoint: connects
- API application → WebSocket endpoint: dispatches
- WebSocket endpoint → Connection manager: registers connection
- Session endpoints → Answer handling: answer workflow
- Session endpoints → Insight generation: insight workflow
- Insight generation → Gemini API: requests generation