High-Level Architecture
Adminest follows a modern full-stack architecture with clear separation of concerns:Directory Structure
Frontend Architecture
Technology Stack
| Technology | Purpose |
|---|---|
| Next.js 14 | React framework with App Router |
| TypeScript | Type safety |
| Tailwind CSS | Styling |
| Auth0 React SDK | Authentication |
| React Query | Server state management |
Key Components
Backend Architecture
Technology Stack
| Technology | Purpose |
|---|---|
| Express.js | HTTP server |
| MongoDB | Database |
| Mongoose | ODM |
| Auth0 | Authentication |
| OpenAI | AI processing |
| AWS S3 | File storage |
API Structure
Routes follow RESTful conventions:Services Layer
Business logic is separated into services:Data Models
Document Schema
Task Schema
Authentication Flow
- User clicks login
- Auth0 handles authentication
- Frontend receives JWT token
- Backend validates token on each request
AI Processing Pipeline
Document processing flow:- Extracts text from documents (OCR for images)
- Analyzes content to determine document type
- Extracts key data (dates, amounts, policy numbers)
- Generates summary and suggested tasks
- Creates vector embeddings for semantic search
External Integrations
Google Calendar
- OAuth 2.0 authentication
- Two-way sync for tasks with due dates
- Webhook notifications for external changes
Microsoft Calendar
- Microsoft Graph API
- Similar flow to Google Calendar
- Supports Outlook and Microsoft 365
AWS S3
- Secure document storage
- Pre-signed URLs for uploads/downloads
- Lifecycle policies for cost optimization
AI Observability
The Admin Centre includes an AI tab that provides real-time visibility into Claude API usage via Langfuse integration:- Token tracking — input, output, and cached token counts per operation
- Cost estimation — based on Claude Sonnet 4.5 pricing
- Latency monitoring — average response times by operation type
- Per-user analytics — consumption breakdown by user
- Error rate tracking — identify failing AI operations
traceList() and observationsGetMany() APIs, with Redis caching (5-minute TTL) for performance.