How kapil31jangid/civora works
Civora turns a citizen’s urban-problem description into safe, measurable SDG 11 guidance through a browser chat, server-side routing, domain prompts, and Gemini. The main path runs from the chat UI through the API and chat route to response generation; optional conversation persistence adds browser-scoped history via Supabase or an in-memory store. The README documents specialist modes, one-time action formats, and stateless Arena requests. Some links to unsampled modules rely on SOURCE INDEX references or README statements rather than inspected implementations.
Main entry points: App.tsx Chat app · chat.ts Chat endpoint · store.ts Conversation store · app.ts Express app
Components 21
Browser experience
- Chat app
client/src/App.tsx - Message composer
client/src/components/chat/Composer.tsx - Command palette
client/src/lib/commands.ts - Message display
client/src/components/chat/MessageList.tsx - Conversation sidebar
client/src/components/sidebar/Sidebar.tsx - Conversation dialogs
client/src/components/sidebar/ConversationDialogs.tsx - Chat state
client/src/hooks/useChat.ts - Conversation state
client/src/hooks/useConversations.ts - API client
client/src/lib/api.ts
API workflow
- Express app
server/src/app.ts - Chat endpoint
server/src/routes/chat.ts - Conversation endpoints
server/src/routes/conversations.ts
Guidance generation
- Domain guard
server/src/utils/domainGuard.ts - Command parsing
server/src/utils/commands.ts - Specialist prompts
server/src/prompts - Response generation
server/src/services/gemini.ts
Conversation history
- Conversation store
server/src/services/store.ts - Supabase PostgreSQL
- In-memory store
server/src/services/store.ts
Other components
- Citizen
- Gemini API
Connections 22
- Citizen → Chat app: uses chat
- Chat app → Chat state: manages chat
client/src/App.tsx - Chat app → Conversation state: manages history
client/src/App.tsx - Chat app → Message composer: renders composer
client/src/App.tsx - Chat app → Message display: renders messages
client/src/App.tsx - Chat app → Conversation sidebar: renders sidebar
client/src/App.tsx - Chat app → Conversation dialogs: renders dialogs
client/src/App.tsx - Message composer → Command palette: offers commands
client/src/components/chat/Composer.tsx - Chat state → API client: sends chat
client/src/hooks/useChat.ts - Conversation state → API client: requests history
client/src/hooks/useConversations.ts - API client → Express app: calls API
- Express app → Chat endpoint: routes chat
server/src/app.ts - Express app → Conversation endpoints: routes conversations
server/src/app.ts - Chat endpoint → Command parsing: parses commands
server/src/routes/chat.ts - Chat endpoint → Domain guard: checks domain
server/src/routes/chat.ts - Chat endpoint → Response generation: requests response
server/src/routes/chat.ts - Response generation → Specialist prompts: selects prompt
server/src/services/gemini.ts - Response generation → Gemini API: calls model
- Chat endpoint → Conversation store: reads and writes
server/src/routes/chat.ts - Conversation endpoints → Conversation store: manages history
server/src/routes/conversations.ts - Conversation store → Supabase PostgreSQL: persists records
- Conversation store → In-memory store: falls back to
server/src/services/store.ts