Files
furyhawk 8351e73d39 feat: add Zustand stores for conversation, file preview, sidebar, theme, and knowledge base selection
- Implemented `conversation-store` for managing conversations and messages.
- Created `file-preview-store` to handle file preview state.
- Added `sidebar-store` for sidebar visibility management.
- Developed `theme-store` for theme persistence and management.
- Introduced `kb-selection-store` for managing active knowledge base selections with persistence.

chore: define API and chat types

- Added types for API responses, authentication, chat messages, conversations, and projects.
- Defined interfaces for various entities including users, sessions, and message ratings.

build: configure TypeScript and testing setup

- Set up `tsconfig.json` for TypeScript configuration.
- Created `vitest.config.ts` for testing configuration with Vitest.
- Added `vitest.setup.ts` for global test setup including mocks for Next.js router and media queries.
- Configured Vercel deployment settings in `vercel.json`.
2026-06-11 16:54:43 +08:00

2.5 KiB

Deployment

This project was generated with the following deployment-related flags:

  • Docker / docker-compose.yml
  • No Kubernetes manifests
  • CI: github

Docker Compose (single host)

For staging or small production:

# 1. Configure
cp backend/.env.example backend/.env
# Edit backend/.env with production values (see ENV_VARS.md)

# 2. Build + start
docker compose up -d --build

# 3. Apply migrations
docker compose exec app uv run alembic upgrade head


# 4. Verify
curl http://localhost:8033/api/v1/health
# Frontend: http://localhost:3033

Reverse proxy

Front this with your own reverse proxy (Caddy / Nginx / ALB). The backend listens on :8033 and frontend on :3033.

Platform-specific quickstarts

Fly.io

fly launch --name ai_agent-backend --region waw
fly postgres create --name ai_agent-db
fly postgres attach ai_agent-db
# Redis: use Upstash (`fly redis create`) or Fly's Tigris
fly secrets set $(cat backend/.env | grep -v '^#' | xargs)
fly deploy

Railway

  1. Connect repo, pick Dockerfile-based deploy.
  2. Add env vars from backend/.env to Railway service.
  3. Provision PostgreSQL plugin → DATABASE_URL auto-injected.
  4. Provision Redis plugin → REDIS_URL auto-injected.
  5. Deploy.

Render

  1. Create Web Service → docker, point at backend/Dockerfile.
  2. Create Static Site for frontend (build cmd: bun install && bun run build, output dir: .next).
  3. Create PostgreSQL → copy DATABASE_URL.
  4. Add env vars; deploy.

Vercel (frontend only)

The frontend is a Next.js app — works on Vercel out of the box.

cd frontend
vercel

Set BACKEND_URL and NEXT_PUBLIC_API_URL env vars in Vercel dashboard pointing to your backend host.


Environment validation in production

Before promoting to prod, run:

docker compose exec app uv run python -c "from app.core.config import settings; print('OK')"

Catches missing required env vars early. See ENV_VARS.md for the full list.

Post-deploy checks

  • /api/v1/health returns {"status": "ok"}
  • alembic current matches expected revision
  • Frontend renders, login flow works end-to-end
  • Logs flowing to your aggregator + Logfire receiving traces
  • Reverse proxy enforces HTTPS

Rollback

  • Schema: alembic downgrade -1 rolls back one migration. Test on staging first.
  • Code: redeploy previous image tag. Pin tags (v1.2.3), never deploy latest to prod.
  • Data: restore from your most recent backup; verify alembic current matches the data version.