Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions apps/dashboard/.dev.vars.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# GitHub OAuth App credentials
# 1. Go to https://github.com/settings/developers
# 2. Click "New OAuth App"
# 3. Set "Authorization callback URL" to http://localhost:3000/api/auth/callback/github
# 4. Copy the Client ID and generate a Client Secret
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=

# Random secret for encrypting sessions (at least 32 characters)
# Generate one with: openssl rand -base64 32
BETTER_AUTH_SECRET=

# Base URL for the auth server
BETTER_AUTH_URL=http://localhost:3000
1 change: 1 addition & 0 deletions apps/dashboard/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ dist
dist-ssr
*.local
.env
.dev.vars
.nitro
.tanstack
.wrangler
Expand Down
7 changes: 7 additions & 0 deletions apps/dashboard/drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from "drizzle-kit";

export default defineConfig({
out: "./drizzle",
schema: "./src/db/schema.ts",
dialect: "sqlite",
});
49 changes: 49 additions & 0 deletions apps/dashboard/drizzle/0000_pretty_the_call.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
CREATE TABLE `account` (
`id` text PRIMARY KEY NOT NULL,
`account_id` text NOT NULL,
`provider_id` text NOT NULL,
`user_id` text NOT NULL,
`access_token` text,
`refresh_token` text,
`id_token` text,
`access_token_expires_at` integer,
`refresh_token_expires_at` integer,
`scope` text,
`password` text,
`created_at` integer NOT NULL,
`updated_at` integer NOT NULL,
FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE TABLE `session` (
`id` text PRIMARY KEY NOT NULL,
`expires_at` integer NOT NULL,
`token` text NOT NULL,
`ip_address` text,
`user_agent` text,
`user_id` text NOT NULL,
`created_at` integer NOT NULL,
`updated_at` integer NOT NULL,
FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE UNIQUE INDEX `session_token_unique` ON `session` (`token`);--> statement-breakpoint
CREATE TABLE `user` (
`id` text PRIMARY KEY NOT NULL,
`name` text NOT NULL,
`email` text NOT NULL,
`email_verified` integer NOT NULL,
`image` text,
`created_at` integer NOT NULL,
`updated_at` integer NOT NULL
);
--> statement-breakpoint
CREATE UNIQUE INDEX `user_email_unique` ON `user` (`email`);--> statement-breakpoint
CREATE TABLE `verification` (
`id` text PRIMARY KEY NOT NULL,
`identifier` text NOT NULL,
`value` text NOT NULL,
`expires_at` integer NOT NULL,
`created_at` integer,
`updated_at` integer
);
Loading