🚧 Installation
Clone the Repository​
git clone https://github.com/jorge-menjivar/unSAGED.git
Install Dependencies​
npm install -g pnpm
pnpm install
Generate Supabase Tables​
Run the Generation Script in the Supabase SQL editor.
This will do the following:
- Create the tables required by unSAGED.
- Create the authentication schema and tables required by Auth.js.
- Enable Row Level Security for the tables required by unSAGED.
- Apply the Row Level Security policies required by unSAGED.
Expose the next_auth
schema​
Expose the next_auth
schema in the API settings by adding next_auth
to the "Exposed schemas" list.
More information here.
Then copy the output and save it for the next step.
Switch to the apps/web
directory​
The apps/web
directory contains the unSAGED app. All following commands should be run from this directory.
cd apps/web
Set Environment Variables​
The .env.local
file is the main configuration file for unSAGED. It should be located in the apps/web
directory of the project.
Create the apps/web/.env.local
file to set your environment variables.
Set Auth Secret​
Create your secret with the following command:
openssl rand -base64 32
Set the NEXTAUTH_SECRET
environment variable to the secret you just created.
NEXTAUTH_SECRET=my_secret
See Auth.js Documentation for more information.
Set Supabase Variables​
NEXT_PUBLIC_SUPABASE_URL="https://xxxxxxxxxxxxxxxx.supabase.co"
NEXT_PUBLIC_SUPABASE_ANON_KEY=supabase_anon_key
SUPABASE_JWT_SECRET=supabase_jwt_secret
SUPABASE_SERVICE_ROLE_KEY=supabase_service_role_key
Run App​
Run Locally​
pnpm run dev
Run in Docker​
When running in docker set the following environment variable:
docker build -t unsaged -f apps/web/Dockerfile . --rm
docker run --env-file=.env.local -p 127.0.0.1:3000:3000 --name unsaged unsaged
Running in Production​
To run in production, you will need to set the following environment variable.
See Auth.js Documentation for more information.
NEXTAUTH_URL=https://yourdomain.com