ForumAI is an online platform which enables AI assistance in structured academic forums, facilitating discussions between students and faculty.
- 24/7 AI assistance to help answer questions about course material, assignments and general logistics
- Discussions boards and Q&A forums for interaction between students, instructors and teaching assistants
- Anonymous posting and messaging for safe and inclusive discussions
- Node.js
- Yarn or npm
- Supabase CLI
- Deno (required for running tests)
- Docker (required for supabase start)
Clone the project
git clone https://github.com/ubclaunchpad/forum.git
- Download and install the latest version of Node.js from nodejs.org
cd forum/frontend
yarn install # or npm install
Create a .env
file with:
NEXT_PUBLIC_SUPABASE_URL=YOUR_PUBLIC_SUPABASE_URL
NEXT_PUBLIC_SUPABASE_ANON_KEY=YOUR_SUPABASE_ANON_KEY
OPENAI_API_KEY=YOUR_OPENAI_API_KEY
DATABASE_URL=YOUR_DATABASE_URL
NEXT_PUBLIC_API_BASE_URL=YOUR_API_BASE_URL
Check here for details on how to find your environment variables
yarn dev # or npm run dev
- Follow the instructions here to install the Supabase CLI: Supabase CLI
Ensure Docker is installed and running before executing this command.
supabase start
supabase db up
- Follow the instructions here to install Deno: Deno Installation
- For VSCode users, you can also install the Deno extension: Deno Extension
deno test --allow-all --coverage --env-file=./.env.local
If you do not have the Deno extension installed in your IDE, you can run the tests using the following command:
deno test --allow-all --coverage --env-file=./.env.local --unstable --watch
Create a .env
file with in the supabase folder with:
SUPABASE_URL="your_supabase_url"
SUPABASE_ANON_KEY="your_supabase_anon_key"
SUPABASE_SERVICE_ROLE_KEY="your_supabase_service_role_key"
DATABASE_URL="your_database_url"
OPENAI_API_KEY=your_key_here
AUTH_MIDDLEWARE_ENABLED=true # or false
DEV_USER_EMAIL=your_email_here
DEV_USER_PASSWORD=your_password_here
DEV_LOGIN=true # or false
ENV=development # or production
- When you do
supabase start
, you will get an API URL, anon key, and service role key. Make sure you populate these in the.env
file. - For most cases you will need to have the
AUTH_MIDDLEWARE_ENABLED
set totrue
and theDEV_USER_EMAIL
andDEV_USER_PASSWORD
set to your email and password- On your Supabase project, go to the
Auth
section and create a new user (you can manually set the email and password); then use these credentials in the.env
file
- On your Supabase project, go to the
- Go on OpenAI and create a new project (or use an existing one)
- You do not need this unless you use the OpenAI API
- Supabase CLI Documentation: Supabase CLI
- Supabase Edge Functions: Supabase Edge Functions
- Deno Documentation: Deno Manual
- Deno Setup for VSCode: Deno Extension
supabase start
- Start the Supabase serversupabase stop
- Stop the Supabase serversupabase db up
- Apply database migrationssupabase db reset
- Reset the database
supabase functions new function_name
- Create a new edge functionsupabase functions deploy function_name
- Deploy an edge function
deno test --allow-all --coverage=coverage
- Run tests with coveragedeno coverage --html
- Generate an HTML coverage report
Contributions are always welcome!
See CONTRIBUTING.md
for ways to get started.