How neon-20/chatbotai works
Project type and purpose
• This is a full-stack AI chat application (“Domus AI”) built with Next.js 14 and React on the frontend, Supabase (PostgreSQL, Auth, Storage) on the backend, and multiple external AI model integrations. It provides real-time chat, file attachments, workspaces, role-based access, and multi-locale support.
File structure
• app/: Next.js 14 “app router” pages, layouts, API routes under app/api/….
• components/: UI broken into feature folders—chat, analytics, sidebar, models, setup, etc.
• lib/: Shared utilities (prompt building, stream consumption, i18n, supabase wrappers).
• db/: Schema wrappers for all tables (chats, messages, files, workspaces, roles).
• supabase/: Local Supabase config, migrations, seed.
• public/: Static assets, locale JSON.
• context/, types/, worker/: global React context, TypeScript types, background workers.
• Tests: unit tests in __tests__, end-to-end in Playwright.
• Configuration (next.config.js, tailwind.config.ts, env examples).
README for additional insights
• Layers described as Frontend, Backend (Supabase), Integration (AI APIs, WebSockets, REST).
• Features & components: chat interface, file handler, workspace management, RBAC.