Bruriah is an AI-powered chat interface designed to provide a supportive and engaging learning experience for children. Using OpenAI's language model, Bruriah acts as a kind and intelligent tutor, answering questions and explaining concepts in an age-appropriate and encouraging way.
- User Authentication: Secure user sign-up, login, and logout using Supabase Auth.
- Persistent Chat History: Each user can create and manage multiple chats, with chat histories stored in Supabase.
- Profile Context: Personalize the chat context with student provided school, location and grade information.
- Real-time AI Responses: Powered by OpenAI's GPT-4 model, providing conversational and educational support.
- Dynamic Profile Avatars: Supports user-uploaded avatars or default initials.
- Customizable Chat Titles: Rename chats directly from the sidebar.
- Fortnite-Inspired Design: A modern UI styled with the Bangers font and responsive Tailwind CSS.
- Frontend: React.js with Tailwind CSS for styling.
- Backend: Supabase for authentication, database, and serverless Edge Functions.
- AI: OpenAI API for generating AI-powered responses.
- Deployment: Hosted via Supabase Functions for Edge API and your preferred frontend host.
- Node.js
- Supabase project setup with database and API keys
- OpenAI API key
-
Clone the Repository:
git clone https://github.com/hummusonrails/bruriah.git cd bruriah-chat
-
Install Dependencies:
npm install
-
Configure Environment Variables: Create a
.env.local
file in the root directory and add the following environment variables:VITE_SUPABASE_PROJECT_REF=your-supabase-ref VITE_SUPABASE_ANON_KEY=your-supabase-anon-key VITE_SUPABASE_URL=https://your-supabase-url OPENAI_API_KEY=your-openai-api-key
-
Start the Development Server:
npm run dev
-
Access the Application: Open
http://localhost:5173
in your browser to view the application.
Column | Type | Description |
---|---|---|
id | int8 | Primary key |
auth_user_id | uuid | Foreign key to auth.users |
username | text | Unique username for the user |
avatar_url | text | URL to the user's profile avatar |
Column | Type | Description |
---|---|---|
id | int8 | Primary key |
profile_id | int8 | Foreign key to profiles |
title | text | Title of the chat |
status | text | Status of the chat: archived or active |
Column | Type | Description |
---|---|---|
id | int8 | Primary key |
chat_id | int8 | Foreign key to chats |
role | varchar | Role of the message sender: user or assistant |
content | text | Content of the message |
Deploy the following Edge Function for OpenAI API interaction:
- Navigate to your Supabase dashboard and create a new Edge Function named openai.
- Copy the code from
supabase-functions/openai.js
into the Edge Function editor. - Deploy the function.
Build the project for production:
npm run build
- Sign Up: Create a new account or log in with an existing account.
- Create Chat: Click the "+" button to create a new chat with a custom title.
- Chat with Bruriah: Start chatting with Bruriah and receive AI-powered responses.
- Rename Chat: Click the chat title to rename the chat.
- View Chat History: Access previous messages and responses in the chat history.
- Edit Profile: Update your profile information, including your avatar, school name, location and grade.
Contributions are welcome! Please refer to the Contributing Guidelines for detailed instructions.
This project is licensed under the MIT License. See the LICENSE file for more information.