Understand the Basjoo Architecture
mainBasjoo is composed of three main layers: a FastAPI backend, a Next.js admin dashboard, and an embeddable widget.
Backend
Built with FastAPI, the backend manages:
- Auth: Admin routes under
/api/admin. - V1 APIs: Public endpoints for chat (
/api/v1/chat), agent configuration, sessions, and quotas. - Admin Routers: Protected endpoints for URL ingestion, file uploads, and index rebuilding.
- Core Domains: Agent configuration, knowledge sources (URLs/Files), indexing (via Qdrant), chat sessions, and scheduling.
Frontend
A Next.js application located in frontend-nextjs/ providing the admin dashboard and management interfaces.
Widget
A self-contained component (BasjooWidget.tsx) that can be embedded in any website. It automatically detects the apiBase, fetches public configuration, and handles streaming chat replies via SSE.