chore: Updated README and env types

This commit is contained in:
Aron Malcher 2024-03-28 16:59:16 +01:00
parent ede764b6f3
commit 6fb563502a
Signed by: aronmal
GPG key ID: 816B7707426FC612
2 changed files with 16 additions and 15 deletions

View file

@ -29,7 +29,7 @@ To get started with li'l Judd, follow the instructions below.
2. Install dependencies: 2. Install dependencies:
```bash ```bash
cd lil-judd cd liljudd-website
# Install pnpm if not already installed # Install pnpm if not already installed
npm i -g pnpm npm i -g pnpm
@ -50,27 +50,29 @@ To get started with li'l Judd, follow the instructions below.
VITE_DISCORD_CLIENT_SECRET=your_discord_client_secret VITE_DISCORD_CLIENT_SECRET=your_discord_client_secret
VITE_DISCORD_BOT_TOKEN=your_discord_bot_token VITE_DISCORD_BOT_TOKEN=your_discord_bot_token
VITE_DISCORD_OAUTH2_PERMISSIONS=18977581952080 VITE_DISCORD_OAUTH2_PERMISSIONS=18977581952080
VITE_AUTH_REDIRECT_URL=your_redirect_url
VITE_AUTH_SECRET=your_auth_secret
VITE_DATABASE_URL=your_database_url VITE_DATABASE_URL=your_database_url
``` ```
Recieve your discord applications `CLIENT_ID` & `CLIENT_SECRET`, as well as the bot token from the [Applications dashboard](https://discord.com/developers/applications/). Recieve your discord applications `CLIENT_ID`, `CLIENT_SECRET` & `BOT_TOKEN` from the [Applications dashboard](https://discord.com/developers/applications/).
Your `VITE_AUTH_REDIRECT_URL` should look like this: `https://<hostname>/api/auth/callback/discord`. Your `VITE_AUTH_REDIRECT_URL` should look like this: `https://<hostname>/api/auth/callback/discord`.
Composite your `VITE_DATABASE_URL` like [`postgres://postgres:adminadmin@0.0.0.0:5432/db`](https://orm.drizzle.team/docs/get-started-postgresql#postgresjs). Composite your `VITE_DATABASE_URL` like [`postgres://username:password@hostname:5432/databasename`](https://orm.drizzle.team/docs/get-started-postgresql#postgresjs).
#### Development #### Development
The duplicate `DATABASE_URL` is only needed for Drizzle Studio. The duplicate `DATABASE_URL` is only needed for Drizzle Studio.
``` ```
VITE_AUTH_REDIRECT_PROXY_URL=your_auth_redirect_proxy_url # Drizzle Studio & Tests
DATABASE_URL=your_database_url
DATABASE_URL=your_database_url #Tests
``` VITE_DISCORD_CLIENT_ID=your_discord_client_id
VITE_DISCORD_CLIENT_SECRET=your_discord_client_secret
VITE_DISCORD_BOT_TOKEN=your_discord_bot_token
```
### Usage ### Usage

3
src/types/env.d.ts vendored
View file

@ -6,8 +6,7 @@ interface ImportMetaEnv {
readonly VITE_DISCORD_BOT_TOKEN: string; readonly VITE_DISCORD_BOT_TOKEN: string;
readonly VITE_DISCORD_OAUTH2_PERMISSIONS: string; readonly VITE_DISCORD_OAUTH2_PERMISSIONS: string;
readonly VITE_AUTH_SECRET: string; readonly VITE_AUTH_REDIRECT_URL: string;
readonly VITE_AUTH_REDIRECT_PROXY_URL: string | undefined;
readonly VITE_DATABASE_URL: string; readonly VITE_DATABASE_URL: string;
} }