This repository was 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 CurrentUserirm get.scoop.sh | iex
- install Supabase CLI
scoop bucket add supabase https://github.com/supabase/scoop-bucket.gitscoop 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.sampleto just.env - Update the file:
REACT_APP_SUPABASE_URL=#API URL
REACT_APP_SUPABASE_KEY=#anon key- Change the name of
.env.sampleto 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-serverand typenpx prisma db push - Open the
Studio URLand theInbucket URLprinted in your terminal after runningsupabase startin 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 Editorscreen (left hand side, looksl ike a terminal window) - paste into SQL Editor and click
RUN
- navigate to
recipes-serverin a terminal and typeyarn start:dev - navigate to
recipes-webin a separate terminal instance and typeyarn start
- navigate to http://localhost:3000/login
- enter any email and submit
- open the
Inbucket URLtab, which intercepts any emails sent from the local supabase instance - click on
Monitorin the navbar - click on the email that was just intercpeted (should only be 1 at the moment)
- In the email, click the
Log Inlink
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