This app uses Descope authentication and FGA (fine-grain authorization - ReBAC) to share notes between users.
- Front-end is written using React Typescript with Vite starting template
- Backend is written in NodeJS with Express and Postgres as the database
- Clone the repo
- Navigate to the server folder
cd server
- Set the following
.env
file in the server directory We recommend connecting with a managed backend service like Neon. You can get the Descope Project ID and Management Key from your Descope Dashboard.
PGHOST=<DB-Host> # e.g 'ep-happy-flower-125243-pooler.us-west-2.aws.neon.tech'
PGDATABASE=<DB-name> # e.g 'neondb'
PGUSER=<DB-User> # e.g 'sarah'
PGPASSWORD=<DB-Password> # 'passwordless'
DESCOPE_PROJECT_ID=<Your-Project-ID>
DESCOPE_MANAGEMENT_KEY=<Your-Management-Key>
- Run the server
npm install
npm start
- Navigate to the client folder
cd client
- Set the following
.env
file in the client directory Use the same Project ID as used in the server.
VITE_DESCOPE_PROJECT_ID=<Your-Project-ID>
- Add
email
to JWT in Descope flow
Navigate to your Descope console, select the flow you'd like to run (the default is sign-up-or-in
) and add this field to the JWT. This way, the middleware in the backend will be able to access the email directly from the jwt.
- Run the client
npm install
npm run dev
You client should be running on http://localhost:5173
and the server on http://localhost:3000