Repository Tour
This is a practical map of the Pi-Chat workspace repository at github.com/alextheradu/pi-chat.
App routes
app/page.tsx: authenticated workspace entry, redirects to active channelapp/(public)/site/page.tsx: public website routeapp/(public)/docs/page.tsx: public docs indexapp/(public)/docs/[slug]/page.tsx: markdown-backed docs pagesapp/(auth)/login/page.tsx: server login route wrapperapp/(auth)/login/login-page-client.tsx: interactive login UIapp/api/auth/[...nextauth]/route.ts: NextAuth route handlerapp/api/health/route.ts: database and MinIO health endpointapp/api/integrations/webhooks/route.ts: authenticated webhook management APIapp/api/integrations/webhooks/[id]/route.ts: revoke webhookapp/api/hooks/[token]/route.ts: public incoming webhook delivery endpointapp/integrations/page.tsx: protected webhook management page
Core libraries
lib/auth.ts: sign-in callbacks and domain/invite enforcementlib/project-config.ts: branding and policy values read from environmentlib/prisma.ts: Prisma client singletonlib/minio.ts: MinIO client and bucket helperslib/incoming-webhooks.ts: webhook token generation and hashinglib/permissions.ts: role-based permission matrix
Styling
app/globals.css: design tokens (Pi-Chat Precision Dark palette) and global stylesapp/layout.tsx: root metadata, fonts (DM Sans + JetBrains Mono), and providers
Database
prisma/schema.prisma: full data modelprisma/migrations/: migration historyprisma/seed.ts: development seed dataprisma.config.ts: Prisma CLI config
Deployment
docker-compose.dev.yml: local Postgres and MinIO for developmentdocker-compose.yml: production stack with app, Postgres, and MinIOdocker/Dockerfile: production image using Next.js standalone outputdocker/entrypoint.sh: migrate, init storage, seed, then start the server
Scripts
scripts/init-minio.mjs: creates required MinIO bucketsscripts/seed-production.mjs: idempotent bootstrap seed for container startup
Tests
npm run test:db: verifies PostgreSQL connectivitynpm run test:minio: verifies MinIO connectivity and bucket accessnpm run test:health: runs the combined health check