/FrostByte

A Frostpunk themed Discord clone

Primary LanguageTypeScript

Getting Started With Local Development

  1. Clone this repository
# HTTPS
$ git clone https://github.com/FrostCord/FrostCord.git

# or

# SSH
$ git clone git@github.com:FrostCord/FrostCord
  1. Navigate to the project directory
cd FrostCord
  1. Head to https://app.supabase.com and sign up
  2. Create a new project and navigate to the settings/api tab
  3. Copy your project anon key and project reference id (the string of characters in the subdomain of supabase.co)
  4. Open .env.example and set:
  • NEXT_PUBLIC_SUPABASE_ANON_KEY to the anon key you just copied
  • PROJECT_ID to the project reference id from the previous step
  1. Rename .env.example to .env.local
  2. Install dependencies
npm install
  1. Prepare the local supabase containers
npx supabase start
  1. 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
  1. 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 using net stop winnat in your terminal. You can restart winnat again after using net start winnat
  1. Navigate to http://localhost:54323/project/default/storage/buckets and create 2 public buckets:
  • avatars
  • servericons
  1. Start NextJS dev server
npm run dev
  1. 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