En self-hosted AI ChatBot klient med React frontend, Hono backend, PostgreSQL database og Auth0 authentication.
- React 18 + TypeScript + Vite
- TanStack Router (type-safe routing)
- TanStack Query (data fetching)
- Auth0 (authentication)
- @assistant-ui/react (chat UI)
- Hono (lightweight web framework)
- Drizzle ORM (type-safe database access)
- PostgreSQL + pgvector (database med embedding support)
- Azure AI Foundry (LLM integration)
- Kubernetes (container orchestration)
- CloudNativePG (PostgreSQL operator)
- Helm (package management)
- ✅ Auth0 Authentication
- ✅ OAuth integration (Atlassian, Microsoft Partner Center)
- ✅ Automatic token refresh med re-auth prompt
- ✅ Real-time chat med SSE streaming
- ✅ MCP server support med multiple auth metoder
- ✅ Chat historik gemt i PostgreSQL
- ✅ RAG-ready med pgvector embeddings
- ✅ Multiple samtaler (conversations)
- ✅ Self-hosted - ingen cloud dependencies
ai-chatclient/
├── src/ # Frontend React app
│ ├── components/ # React komponenter
│ ├── hooks/ # Custom hooks
│ ├── lib/ # API client
│ └── routes/ # TanStack Router routes
├── backend/ # Backend Hono API
│ ├── src/
│ │ ├── db/ # Drizzle schema
│ │ ├── middleware/ # Auth middleware
│ │ ├── routes/ # API routes
│ │ ├── services/ # Business logic
│ │ └── lib/ # Utilities
│ └── package.json
├── deploy/ # Kubernetes deployment
└── docker-compose.yml # Lokal udvikling
npm install
cd backend && npm install && cd ..cp .env.example .env.local
cp backend/.env.example backend/.env.localdocker-compose up -d
npm run db:migrateÅbn http://localhost:5173 i din browser.
Når OAuth tokens udløber:
- Backend forsøger automatisk refresh
- Hvis refresh fejler, vises re-auth modal
- Bruger gennemfører OAuth flow i popup
- Operationen fortsætter automatisk
# Opret PostgreSQL cluster
kubectl apply -f deploy/postgres-cluster.yaml -n ai-chatclient
# Deploy med Helm
```bash
cd deploy
helm dependency update
helm upgrade --install ai-chatclient . -n ai-chatclient --create-namespace| Fil | Beskrivelse |
|---|---|
deploy/Chart.yaml |
Helm chart med gitops-helm-base dependency |
deploy/values.yaml |
Konfiguration (image, replicas, ingress, HPA) |
Dockerfile |
Multi-stage build med nginx |
nginx.conf |
Nginx config med SPA routing |
MIT