Skip to content

Commit 8bbaa94

Browse files
authored
add doc (#32)
1 parent 33efaf1 commit 8bbaa94

File tree

2 files changed

+36
-39
lines changed

2 files changed

+36
-39
lines changed

apps/drizzle-run/.env.example

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
APP_NAME=Drizzle Run
22
APP_URL=http://localhost:3000
3-
DATABASE_URL=postgres://postgres.{YOUR_INSTANCE_NAME}:{POSTGRES_PASSWORD}@aws-0-eu-central-1.pooler.supabase.com:6543/postgres
4-
DATABASE_URL_MIGRATE=postgres://postgres.{YOUR_INSTANCE_NAME}:{POSTGRES_PASSWORD}@aws-0-eu-central-1.pooler.supabase.com:5432/postgres
5-
PLATFORM=development|staging|production
3+
DATABASE_URL=postgresql://postgres:postgres@localhost:54322/postgres
4+
DATABASE_URL_MIGRATE=postgresql://postgres:postgres@localhost:54322/postgres
65
SENTRY_DSN=
76
SESSION_SECRET=super-duper-s3cret
8-
SUPABASE_ANON_KEY={ANON_PUBLIC}
9-
SUPABASE_SERVICE_ROLE_KEY={SERVICE_ROLE}
10-
SUPABASE_URL=https://{YOUR_INSTANCE_NAME}.supabase.co
11-
TZ=UTC
7+
SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0
8+
SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU
9+
SUPABASE_URL=http://127.0.0.1:54321
10+
TZ=UTC
11+
NODE_ENV=development

apps/drizzle-run/README.md

+29-32
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,32 @@
55
> [!NOTE]
66
> Documentation is WIP
77
8-
## Development
9-
10-
Run the Vite dev server:
11-
12-
```shellscript
13-
npm run dev
14-
```
15-
16-
## Deployment
17-
18-
First, build your app for production:
19-
20-
```sh
21-
npm run build
22-
```
23-
24-
Then run the app in production mode:
25-
26-
```sh
27-
npm start
28-
```
29-
30-
Now you'll need to pick a host to deploy it to.
31-
32-
### DIY
33-
34-
If you're familiar with deploying Node applications, the built-in Remix app server is production-ready.
35-
36-
Make sure to deploy the output of `npm run build`
37-
38-
- `build/server`
39-
- `build/client`
8+
## How to run it locally
9+
10+
> [!IMPORTANT]
11+
> [Install Supabase CLI to self host Supabase](https://supabase.com/docs/guides/local-development/cli/getting-started)
12+
13+
___
14+
15+
> [!IMPORTANT]
16+
> To use GitHub auth, you need to create an OAuth app on GitHub and add the client ID and secret to the `.env` file at the **root** of the project.
17+
>
18+
> [Follow the docs](https://supabase.com/docs/guides/auth/social-login/auth-github)
19+
>
20+
> ```env
21+
> SUPABASE_AUTH_GITHUB_CLIENT_ID=
22+
> SUPABASE_AUTH_GITHUB_SECRET=
23+
> ```
24+
> Once done, you can restart the Supabase project with `supabase stop` and `supabase start`.
25+
26+
___
27+
28+
1. Start Supabase locally with `supabase start` and wait until it's done.
29+
2. Create a `.env` file with the required variables by running `cp .env.example .env`. It already contains all the required environment variables and their values.
30+
* NB: `DATABASE_URL_MIGRATE`, on production, it should point to the port `5432` of your db instance.
31+
3. `npm install`
32+
4. `cd apps/drizzle-run`
33+
5. Apply Drizzle migrations `npm run db:server:migration:deploy`
34+
6. Run `npm run dev` to start the development server
35+
36+
It's a npm workspace monorepo, everything is linked together so if you make changes to `packages/*`, they will be reflected in the app.

0 commit comments

Comments
 (0)