This repository has been archived by the owner on Jan 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Local development
Paul Hultgren edited this page Jan 4, 2023
·
2 revisions
- Configure
env.local
(and setMULTI_TENANCY=true
if working on Cloud) -
yarn dev
(unless you need to migrate usingDATABASE_URL
env var) and migrate up
Runs on :3000
npm install
- Setup your environment configuration:
cp .env.example .env.local
Enter the required config from Supabase .env.local
.
- Run the DB migrations:
DATABASE_URL=postgresql://postgres:<YOUR_SUPABASE_DB_PASSWORD>@<YOUR_SUPABASE_DB_HOST>:5432/postgres yarn migrate up
- Start the development server:
npm run dev
# or
yarn dev
- Open http://localhost:3000 with your browser.
- Install Docker on your machine
- Build the container:
docker build -t squeak .
- Run the container:
docker run \\
-e "NEXT_PUBLIC_SUPABASE_URL=<YOUR URL>" \\
-e "NEXT_PUBLIC_SUPABASE_ANON_KEY=<YOUR ANON KEY>" \\
-e "SUPABASE_SERVICE_ROLE_KEY=<YOUR SERVICE ROLE KEY>" \\
-e "DATABASE_URL=<YOUR DATABASE_URL>" \\
-p 3000:3000 squeak
To run the database migrations, run:
DATABASE_URL=<YOUR_DATABASE_URL> yarn migrate up
After running a migration, you can generate typescript types for the database schema:
npx openapi-typescript "<https://YOUR_DATABASE_URL.supabase.co/rest/v1/?apikey=><YOUR_NEXT_PUBLIC_SUPABASE_ANON_KEY>" --output @types/supabase.d.ts
- Add API key and values to the
<Squeak />
component insrc/main.tsx
- Run
yarn dev