How ittzspsv/lily-support works
This repository implements a helpdesk/support-ticket product with a Next.js interface and FastAPI backend. Its main workflow is user authentication, ticket creation and management, attachment handling, and ticket collaboration; administrative routes manage users and agents. The backend also exposes configurable ticket forms, role-based access, and WebSocket support. Relationships below are limited to imports and calls evidenced by sampled files or the SOURCE INDEX; unsampled ticket, role, and frontend wiring is not asserted.
Main entry points: main.py FastAPI app · auth.py Authentication · tickets.py Ticket routes · admin Admin routes
Components 29
Web interface
- Next.js app
frontend/src/app - Ticket workspace
frontend/src/components/ui/tickets/TicketWorkspace.tsx - Ticket hooks
frontend/src/features/hooks/tickets - Support form
frontend/src/features/hooks/useSupportForm.ts - API clients
frontend/src/api
Backend API
- FastAPI app
backend/src/main.py - Auth routes
backend/src/api/routes/auth/auth.py - Ticket routes
backend/src/api/routes/tickets/tickets.py - Form routes
backend/src/api/routes/forms/forms.py - Attachment routes
backend/src/api/routes/attachments/attachments.py - Admin routes
backend/src/api/routes/admin - Role administration
backend/src/api/routes/admin/roles.py - Agent skills routes
backend/src/api/routes/users/skills/skills.py
Identity and access
- Authentication
backend/src/services/auth.py - Auth dependencies
backend/src/dependencies/auth.py - User service
backend/src/services/users.py - Role service
backend/src/services/roles.py - Credential service
backend/src/services/credintials.py - Token service
backend/src/services/token.py
Ticket operations
- Ticket service
backend/src/services/tickets.py - Ticket configuration
backend/src/configs/tickets.py - WebSocket connection
backend/src/api/websockets/connection.py - Agent service
backend/src/services/agents.py
Persistence and integrations
- Object storage service
backend/src/services/storage.py - Database
backend/src/database/database.py - Ticket models
backend/src/database/models/tickets.py - User models
backend/src/database/models/user.py - S3-compatible storage
Other components
- User
Connections 30
- User → Next.js app: uses
- FastAPI app → Auth routes: registers
backend/src/main.py - FastAPI app → Ticket routes: registers
backend/src/main.py - FastAPI app → Attachment routes: registers
backend/src/main.py - FastAPI app → Admin routes: registers
backend/src/main.py - FastAPI app → Form routes: registers
backend/src/main.py - FastAPI app → Database: creates tables
backend/src/main.py - Auth routes → Authentication: invokes
backend/src/api/routes/auth/auth.py - Auth routes → Auth dependencies: uses guards
backend/src/api/routes/auth/auth.py - Auth dependencies → Authentication: validates tokens
backend/src/dependencies/auth.py - Auth dependencies → User service: loads user
backend/src/dependencies/auth.py - Auth dependencies → Token service: checks revocation
backend/src/dependencies/auth.py - Authentication → User service: uses
backend/src/services/auth.py - Authentication → Role service: loads default roles
backend/src/services/auth.py - Authentication → Credential service: uses credentials
backend/src/services/auth.py - Authentication → User models: uses role model
backend/src/services/auth.py - Ticket routes → Ticket service: uses
backend/src/api/routes/tickets/tickets.py - Ticket routes → WebSocket connection: uses events
backend/src/api/routes/tickets/tickets.py - Ticket routes → Ticket configuration: uses configuration
backend/src/api/routes/tickets/tickets.py - Attachment routes → Object storage service: requests storage
backend/src/api/routes/attachments/attachments.py - Object storage service → S3-compatible storage: generates signed URLs
backend/src/services/storage.py - Object storage service → Ticket configuration: loads settings
backend/src/services/storage.py - Form routes → Ticket configuration: uses forms
backend/src/api/routes/forms/forms.py - Admin routes → Agent service: manages agents
backend/src/api/routes/admin/agents.py - Admin routes → User service: manages users
backend/src/api/routes/admin/users.py - Admin routes → Role administration: includes role routes
- Next.js app → API clients: calls API
- Ticket workspace → Ticket hooks: uses hooks
- Support form → API clients: submits form
- API clients → Ticket routes: requests tickets