ChatX is a full-stack AI chat web application built with Vite, React, TypeScript, Tailwind CSS, shadcn/ui, and Supabase.
- User authentication (signup/login)
- Chat interface with AI responses
- Persistent chat history
- Multiple chat sessions
- Responsive design
- Frontend: Vite, React, TypeScript
- Styling: Tailwind CSS, shadcn/ui components
- Backend: Supabase (Authentication, Database)
- Node.js (v18 or higher)
- npm or yarn
- Supabase account
git clone <repository-url>
cd chatx
npm install
# or
yarn install
- Create a new Supabase project at supabase.com
- Enable email/password authentication in Authentication > Providers
- Run the SQL from
supabase_schema.sql
in the SQL Editor to set up the database schema - Get your project URL and anon key from Settings > API
Create a .env
file in the root directory:
VITE_SUPABASE_URL=your_supabase_project_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
npm run dev
# or
yarn dev
The app should now be running at http://localhost:5173
src/components
: Reusable UI componentssrc/context
: React context providers for state managementsrc/module
: Feature-specific modules (auth, chat, etc.)src/services
: Backend API services (Supabase)src/config
: Configuration and typessrc/pages
: Page components
The application uses two main tables:
chat_sessions
: Stores chat sessions with titleschat_messages
: Stores individual messages within sessions
Row-level security policies are in place to ensure users can only access their own data.
MIT