This repository has been archived by the owner on Mar 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Local Development Setup
Adam Gardner edited this page Jun 30, 2022
·
3 revisions
- create a directory for the projects:
mkdir recipes
- cd into new directory:
cd recipes
- clone web:
git clone https://github.com/Summer-Coding/recipes-web.git
- clone server:
git clone https://github.com/Summer-Coding/recipes-server.git
- install docker: https://docs.docker.com/get-docker/
- install scoop:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
irm get.scoop.sh | iex
- install Supabase CLI
scoop bucket add supabase https://github.com/supabase/scoop-bucket.git
scoop install supabase
- Login to Supabase:
- Create an account at https://app.supabase.com/
- Create Access Token at https://app.supabase.com/account/tokens
- Important Copy token before moving on!!
-
supabase login
(paste Access Token when prompted from previous step)
- Start Supbase local
- create directory
mkdir recipes-database
(you can name it whatever you want, but recipes-database makes the most sense to me) - cd into project
cd recipes-database
- init:
supbase init
- start:
supabase start
- create directory
Note: after last command run, it will print out environment configuration variables required for the Config section below.
- Change the name of
.env.sample
to just.env
- Update the file:
REACT_APP_SUPABASE_URL=#API URL
REACT_APP_SUPABASE_KEY=#anon key
- Change the name of
.env.sample
to just.env
- Update the file:
DATABASE_URL=#DB URL
SUPABASE_URL=#API URL
SUPABASE_KEY=#anon key
SUPABASE_PRIVATE_KEY=#service_role key
SUPABASE_JWT_SECRET= # is not in printed config - generate a random 32 chracter string.
- in a termal navigate to
recipes-server
and typenpx prisma db push
- Open the
Studio URL
and theInbucket URL
printed in your terminal after runningsupabase start
in a web browser - Copy the code found here: https://github.com/Summer-Coding/recipes-sql/blob/main/local-setup.sql
- In the Studio tab, navigate to the
SQL Editor
screen (left hand side, looksl ike a terminal window) - paste into SQL Editor and click
RUN
- navigate to
recipes-server
in a terminal and typeyarn start:dev
- navigate to
recipes-web
in a separate terminal instance and typeyarn start
- navigate to http://localhost:3000/login
- enter any email and submit
- open the
Inbucket URL
tab, which intercepts any emails sent from the local supabase instance - click on
Monitor
in the navbar - click on the email that was just intercpeted (should only be 1 at the moment)
- In the email, click the
Log In
link
That's it! You have a user and everything is running.
- When you are logged in, navigate to http://localhost:3000/profile
- fill out form and click submit