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
13 changes: 13 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Auth.js — generate a secret with: npx auth secret
AUTH_SECRET=

# GitHub OAuth app credentials (Settings → Developer settings → OAuth Apps).
# Callback URL: http://localhost:3000/api/auth/callback/github (local)
AUTH_GITHUB_ID=
AUTH_GITHUB_SECRET=

# Turso / libSQL. Local dev uses a SQLite file; prod uses a libsql:// URL + token.
# Local: TURSO_DATABASE_URL=file:local.db (leave TURSO_AUTH_TOKEN empty)
# Prod: TURSO_DATABASE_URL=libsql://<db>.turso.io
TURSO_DATABASE_URL=file:local.db
TURSO_AUTH_TOKEN=
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ yarn-error.log*

# env files (can opt-in for committing if needed)
.env*
!.env.example

# vercel
.vercel
Expand All @@ -38,6 +39,10 @@ yarn-error.log*
*.tsbuildinfo
next-env.d.ts

# local database (libSQL/SQLite)
/local.db
local.db*

# claude code
.claude/
CLAUDE.local.md
13 changes: 13 additions & 0 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineConfig } from "drizzle-kit";

export default defineConfig({
dialect: "turso",
schema: "./src/db/schema.ts",
out: "./drizzle",
dbCredentials: {
url: process.env.TURSO_DATABASE_URL ?? "file:local.db",
// The turso dialect requires a token; libSQL ignores it for file: URLs, so a
// placeholder keeps local `db:push` working without a real Turso token.
authToken: process.env.TURSO_AUTH_TOKEN || "local",
},
});
57 changes: 57 additions & 0 deletions drizzle/0000_colossal_hex.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
CREATE TABLE `account` (
`userId` text NOT NULL,
`type` text NOT NULL,
`provider` text NOT NULL,
`providerAccountId` text NOT NULL,
`refresh_token` text,
`access_token` text,
`expires_at` integer,
`token_type` text,
`scope` text,
`id_token` text,
`session_state` text,
PRIMARY KEY(`provider`, `providerAccountId`),
FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE TABLE `graph` (
`id` text PRIMARY KEY NOT NULL,
`userId` text NOT NULL,
`title` text NOT NULL,
`language` text NOT NULL,
`source` text NOT NULL,
`graph` text NOT NULL,
`createdAt` integer NOT NULL,
FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE TABLE `session` (
`sessionToken` text PRIMARY KEY NOT NULL,
`userId` text NOT NULL,
`expires` integer NOT NULL,
FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE TABLE `testimonial` (
`id` text PRIMARY KEY NOT NULL,
`userId` text NOT NULL,
`body` text NOT NULL,
`createdAt` integer NOT NULL,
FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE TABLE `user` (
`id` text PRIMARY KEY NOT NULL,
`name` text,
`email` text,
`emailVerified` integer,
`image` text
);
--> statement-breakpoint
CREATE UNIQUE INDEX `user_email_unique` ON `user` (`email`);--> statement-breakpoint
CREATE TABLE `verificationToken` (
`identifier` text NOT NULL,
`token` text NOT NULL,
`expires` integer NOT NULL,
PRIMARY KEY(`identifier`, `token`)
);
Loading
Loading