How kirubhananths/aimnest_backend works
AImNest is a FastAPI backend for user accounts, workspaces, goals, tickets, notifications, settings, dashboards, and an AI chat assistant. The main workflow is a client request entering the API, passing authentication when required, then reaching a domain router that reads or updates persisted data. For chat, the conversation router delegates reply generation to an assistant service, which can assemble user-scoped context and use an AI provider. The README is a GitLab template and documents no product capabilities; connections reflect the supplied source index and excerpts, not uninspected implementation details.
Main entry points: session.py Application database · main.py FastAPI app · auth.py Auth dependency · ai_service.py Assistant service
Components 20
API surface
- FastAPI app
app/main.py
Identity
- Auth routes
app/routers/auth.py - Auth service
app/services/auth_service.py - JWT service
app/core/jwt_service.py - Auth dependency
app/dependencies/auth.py - Email service
app/services/email_service.py
Product domains
- Workspace routes
app/routers/workspace.py - Goal routes
app/routers/goal.py - Ticket routes
app/routers/ticket.py - Dashboard routes
app/routers/dashboard.py - Notification routes
app/routers/notification.py - Settings routes
app/routers/settings.py
AI assistant
- Conversation routes
app/routers/conversation.py - Assistant service
app/services/ai_service.py - Context retrieval
app/services/ai/context.py - Prompt builder
app/services/ai/prompt_builder.py - Provider factory
app/services/ai/provider_factory.py - Ollama provider
app/services/ai/ollama_provider.py
Persistence
- Application database
app/db/session.py
Other components
- Client
Connections 37
- Client → FastAPI app: sends requests
app/main.py - FastAPI app → Auth routes: registers routes
app/main.py - FastAPI app → Workspace routes: registers routes
app/main.py - FastAPI app → Goal routes: registers routes
app/main.py - FastAPI app → Conversation routes: registers routes
app/main.py - FastAPI app → Dashboard routes: registers routes
app/main.py - FastAPI app → Notification routes: registers routes
app/main.py - FastAPI app → Settings routes: registers routes
app/main.py - FastAPI app → Ticket routes: registers routes
app/main.py - Auth routes → Auth service: delegates auth
app/routers/auth.py - Auth routes → JWT service: creates tokens
app/routers/auth.py - Auth routes → Application database: uses session
app/routers/auth.py - Auth service → Email service: sends email
app/services/auth_service.py - Auth service → Application database: persists auth data
app/services/auth_service.py - Auth dependency → JWT service: validates token
app/dependencies/auth.py - Auth dependency → Application database: loads user
app/dependencies/auth.py - Workspace routes → Auth dependency: requires identity
app/routers/workspace.py - Workspace routes → Application database: reads and writes
app/routers/workspace.py - Goal routes → Auth dependency: requires identity
app/routers/goal.py - Goal routes → Application database: reads and writes
app/routers/goal.py - Ticket routes → Auth dependency: requires identity
app/routers/ticket.py - Ticket routes → Application database: reads and writes
app/routers/ticket.py - Dashboard routes → Auth dependency: requires identity
app/routers/dashboard.py - Dashboard routes → Application database: queries data
app/routers/dashboard.py - Notification routes → Auth dependency: requires identity
app/routers/notification.py - Notification routes → Application database: reads and writes
app/routers/notification.py - Settings routes → Auth dependency: requires identity
app/routers/settings.py - Settings routes → Application database: reads and writes
app/routers/settings.py - Conversation routes → Auth dependency: requires identity
app/routers/conversation.py - Conversation routes → Application database: reads and writes
app/routers/conversation.py - Conversation routes → Assistant service: requests reply
app/routers/conversation.py - Assistant service → Context retrieval: builds context
app/services/ai_service.py - Assistant service → Prompt builder: assembles prompt
app/services/ai_service.py - Assistant service → Provider factory: selects provider
app/services/ai_service.py - Assistant service → Application database: loads history
app/services/ai_service.py - Context retrieval → Application database: retrieves user data
app/services/ai/context.py - Provider factory → Ollama provider: creates provider