Getting Started With Local Development
- Clone this repository
# HTTPS
$ git clone https://github.com/FrostCord/FrostCord.git
# or
# SSH
$ git clone git@github.com:FrostCord/FrostCord
- Navigate to the project directory
cd FrostCord
- Head to https://app.supabase.com and sign up
- Create a new project and navigate to the settings/api tab
- Copy your project anon key and project reference id (the string of characters in the subdomain of supabase.co)
- Open
.env.example
and set:
NEXT_PUBLIC_SUPABASE_ANON_KEY
to the anon key you just copiedPROJECT_ID
to the project reference id from the previous step
- Rename
.env.example
to.env.local
- Install dependencies
npm install
- Prepare the local supabase containers
npx supabase start
- Install the livekit server by following instructions here
- If you're on Linux or Mac, you'll be ready to move onto the next step
- But if you're on windows, you'll want to make sure that the executable is somewhere that's on your system PATH
- Run livekit in dev mode
# linux/mac
livekit-server --dev
# or for windows users
livekit-server.exe --dev
- If you're on windows and get an error mentioning
bind: An attempt was made to access a socket in a way forbidden by its access permissions.
, you'll want to disable winnat usingnet stop winnat
in your terminal. You can restart winnat again after usingnet start winnat
- Navigate to http://localhost:54323/project/default/storage/buckets and create 2 public buckets:
- avatars
- servericons
- Start NextJS dev server
npm run dev
- Navigate http://localhost:3000 and sign up/log in
You can start editing the page by modifying pages/index.tsx
. The page auto-updates as you edit the file.
API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.ts
.
The pages/api
directory is mapped to /api/*
. Files in this directory are treated as API routes instead of React pages.
This project uses next/font
to automatically optimize and load Inter, a custom Google Font.
Generating Types
For maximum type safety on the Supabase API client some configuration is needed. Follow this for how to install the Supabase CLI.
Quick guide here
npm i supabase
npx supabase init
supabase login
supabase link --project-ref <string>
Once installed and configured, you are safe to run the npm script inside the package.json
npm run update-types
This command will generate the appropriate types for your Supabase API client. More info here and here