Skip to content

Open-source document signature platform. Not affiliated with DocuSign.

TypeScript

Replace the Supabase CLI with a plain migration runner

Claude8a0656844126
diff --git a/.gitignore b/.gitignore
index 5fe1906..201678e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,9 +17,12 @@ dist/
*.tsbuildinfo
next-env.d.ts
-# Supabase local artifacts
-supabase/.branches/
-supabase/.temp/
+# Local development data (filesystem storage, captured emails)
+.data/
+
+# Playwright
+test-results/
+playwright-report/
# Claude Code
.claude/
diff --git a/db/migrate.mjs b/db/migrate.mjs
new file mode 100644
index 0000000..ef04b5b
--- /dev/null
+++ b/db/migrate.mjs
@@ -0,0 +1,199 @@
+#!/usr/bin/env node
+// Applies db/migrations/*.sql in filename order and records each one in the
+// signudoc_migrations table. Safe to run repeatedly: applied files are skipped.
+//
+// node db/migrate.mjs apply pending migrations (fails without a database URL)
+// node db/migrate.mjs --optional same, but exits cleanly when no database URL is set
+//
+// On Vercel this runs inside the build (see vercel.json). It only touches the
+// database for production builds unless MIGRATE_ON_PREVIEW=1 is set, because
+// preview deployments share the production database unless each preview has
+// its own database branch.
+import { existsSync } from "node:fs";
+import { readdir, readFile } from "node:fs/promises";
+import path from "node:path";
+import { fileURLToPath, pathToFileURL } from "node:url";
+
+import pg from "pg";
+
+const DEFAULT_MIGRATIONS_DIR = path.join(
+ path.dirname(fileURLToPath(import.meta.url)),
+ "migrations",
+);
+
+// Arbitrary constant shared by every migrator so two builds cannot run at once.
+const ADVISORY_LOCK_ID = 746108321;
+
+// A direct connection is preferred: session-level advisory locks and DDL do
+// not work reliably through a transaction-mode pooler.
+const DATABASE_URL_VARIABLES = [
+ "DATABASE_URL_UNPOOLED",
+ "POSTGRES_URL_NON_POOLING",
+ "DATABASE_URL",
+ "POSTGRES_URL",
+];
+
+function readConfiguredValue(env, name) {
+ const value = env[name]?.trim();
+
+ if (!value || value.toLowerCase().startsWith("replace-with-")) {
+ return undefined;
+ }
+
+ return value;
+}
+
+export function resolveMigrationDatabaseUrl(env = process.env) {
+ for (const name of DATABASE_URL_VARIABLES) {
+ const value = readConfiguredValue(env, name);
+
+ if (value) {
+ return { name, value };
+ }
+ }
+
+ return null;
+}
+
+export async function listMigrationFiles(
+ migrationsDir = DEFAULT_MIGRATIONS_DIR,
+) {
+ const entries = await readdir(migrationsDir);
+
+ return entries.filter((entry) => entry.endsWith(".sql")).sort();
+}
+
+export async function runMigrations({
+ connectionString,
+ log = console.log,
+ migrationsDir = DEFAULT_MIGRATIONS_DIR,
+}) {
+ const client = new pg.Client({
+ application_name: "signudoc-migrate",
+ connectionString,
+ connectionTimeoutMillis: 15_000,
+ });
+
+ await client.connect();
+
+ try {
+ await client.query("select pg_advisory_lock($1)", [ADVISORY_LOCK_ID]);
+ await client.query(`
+ create table if not exists public.signudoc_migrations (
+ version text primary key,
+ applied_at timestamptz not null default now()
+ )
+ `);
+
+ const appliedResult = await client.query(
+ "select version from public.signudoc_migrations",
+ );
+ const appliedVersions = new Set(
+ appliedResult.rows.map((row) => row.version),
+ );
+ const files = await listMigrationFiles(migrationsDir);
+ const applied = [];
+
+ for (const file of files) {
+ const version = file.replace(/\.sql$/, "");
+
+ if (appliedVersions.has(version)) {
+ continue;
+ }
+
+ const sql = await readFile(path.join(migrationsDir, file), "utf8");
+
+ await client.query("begin");
+
+ try {
+ await client.query(sql);
+ await client.query(
+ "insert into public.signudoc_migrations (version) values ($1)",
+ [version],
+ );
+ await client.query("commit");
+ } catch (error) {
+ await client.query("rollback").catch(() => undefined);
+ throw new Error(
+ `Migration ${file} failed: ${error instanceof Error ? error.message : String(error)}`,
+ { cause: error },
+ );
+ }
+
+ log(`[migrate] applied ${file}`);
+ applied.push(version);
+ }
+
+ return { applied, total: files.length };
+ } finally {
+ await client
+ .query("select pg_advisory_unlock($1)", [ADVISORY_LOCK_ID])
+ .catch(() => undefined);
+ await client.end().catch(() => undefined);
+ }
+}
+
+function loadLocalEnvFiles() {
+ // Next.js loads these for the app; do the same for the CLI. Values already
+ // present in the environment win.
+ for (const fileName of [".env.local", ".env"]) {
+ const filePath = path.join(process.cwd(), fileName);
+
+ if (existsSync(filePath)) {
+ process.loadEnvFile(filePath);
+ }
+ }
+}
+
+async function main() {
+ const optional = process.argv.includes("--optional");
+
+ loadLocalEnvFiles();
+
+ if (
+ process.env.VERCEL === "1" &&
+ process.env.VERCEL_ENV !== "production" &&
+ process.env.MIGRATE_ON_PREVIEW !== "1"
+ ) {
+ console.log(
+ "[migrate] skipped: not a production build. Set MIGRATE_ON_PREVIEW=1 if previews have their own database.",
+ );
+ return;
+ }
+
+ const target = resolveMigrationDatabaseUrl();
+
+ if (!target) {
+ const message = `[migrate] no database URL found (looked for ${DATABASE_URL_VARIABLES.join(", ")}).`;
+
+ if (optional) {
+ console.warn(
+ `${message} Skipping; the app applies pending migrations on first use instead.`,
+ );
+ return;
+ }
+
+ console.error(message);
+ process.exitCode = 1;
+ return;
+ }
+
+ const result = await runMigrations({ connectionString: target.value });
+
+ console.log(
+ result.applied.length > 0
+ ? `[migrate] done: applied ${String(result.applied.length)} of ${String(result.total)} migration(s) using ${target.name}.`
+ : `[migrate] done: database is up to date (${String(result.total)} migration(s), ${target.name}).`,
+ );
+}
+
+const invokedDirectly =
+ process.argv[1] !== undefined &&
+ import.meta.url === pathToFileURL(process.argv[1]).href;
+
+if (invokedDirectly) {
+ main().catch((error) => {
+ console.error("[migrate] failed:", error);
+ process.exitCode = 1;
+ });
+}
diff --git a/supabase/migrations/20260325160428_init.sql b/db/migrations/20260325160428_init.sql
similarity index 100%
rename from supabase/migrations/20260325160428_init.sql
rename to db/migrations/20260325160428_init.sql
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..fd55998
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,23 @@
+# Local Postgres for development and the end-to-end test.
+# npm run db:start start it and apply migrations
+# npm run db:stop stop it (data is kept)
+# npm run db:reset wipe it and start fresh
+services:
+ db:
+ image: postgres:17
+ environment:
+ POSTGRES_USER: signudoc
+ POSTGRES_PASSWORD: signudoc
+ POSTGRES_DB: signudoc
+ ports:
+ - "127.0.0.1:5432:5432"
+ volumes:
+ - signudoc-db:/var/lib/postgresql/data
+ healthcheck:
+ test: ["CMD-SHELL", "pg_isready -U signudoc -d signudoc"]
+ interval: 2s
+ timeout: 3s
+ retries: 30
+
+volumes:
+ signudoc-db:
diff --git a/package-lock.json b/package-lock.json
index 0545cc5..def008a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -38,7 +38,6 @@
"eslint": "^9",
"eslint-config-next": "16.1.7",
"prettier": "^3.8.1",
- "supabase": "^2.84.1",
"tailwindcss": "^4",
"typescript": "^5"
}
@@ -2473,19 +2472,6 @@
}
}
},
- "node_modules/@isaacs/fs-minipass": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz",
- "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==",
- "dev": true,
- "license": "ISC",
- "dependencies": {
- "minipass": "^7.0.4"
- },
- "engines": {
- "node": ">=18.0.0"
- }
- },
"node_modules/@jridgewell/gen-mapping": {
"version": "0.3.13",
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
@@ -3172,6 +3158,23 @@
"pako": "^1.0.10"
}
},
+ "node_modules/@playwright/test": {
+ "version": "1.63.0",
+ "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.63.0.tgz",
+ "integrity": "sha512-oxMK4vllB9RK5NQ2l1pq1IfOf2AvnEuj/vYGDj0H2nMtmtZpKtCwt/l00GEO6xjGfpBNAvjovvYdCm50dRQkpQ==",
+ "license": "Apache-2.0",
+ "optional": true,
+ "peer": true,
+ "dependencies": {
+ "playwright": "1.63.0"
+ },
+ "bin": {
+ "playwright": "cli.js"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
"node_modules/@radix-ui/number": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@radix-ui/number/-/number-1.1.1.tgz",
@@ -5672,6 +5675,70 @@
"node": ">=14.0.0"
}
},
+ "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/core": {
+ "version": "1.8.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "@emnapi/wasi-threads": "1.1.0",
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/runtime": {
+ "version": "1.8.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/wasi-threads": {
+ "version": "1.1.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@napi-rs/wasm-runtime": {
+ "version": "1.1.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "@emnapi/core": "^1.7.1",
+ "@emnapi/runtime": "^1.7.1",
+ "@tybys/wasm-util": "^0.10.1"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/Brooooooklyn"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@tybys/wasm-util": {
+ "version": "0.10.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/tslib": {
+ "version": "2.8.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "0BSD",
+ "optional": true
+ },
"node_modules/@tailwindcss/oxide-win32-arm64-msvc": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.2.2.tgz",
@@ -6987,23 +7054,6 @@
}
}
},
- "node_modules/bin-links": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/bin-links/-/bin-links-6.0.0.tgz",
- "integrity": "sha512-X4CiKlcV2GjnCMwnKAfbVWpHa++65th9TuzAEYtZoATiOE2DQKhSp4CJlyLoTqdhBKlXjpXjCTYPNNFS33Fi6w==",
- "dev": true,
- "license": "ISC",
- "dependencies": {
- "cmd-shim": "^8.0.0",
- "npm-normalize-package-bin": "^5.0.0",
- "proc-log": "^6.0.0",
- "read-cmd-shim": "^6.0.0",
- "write-file-atomic": "^7.0.0"
- },
- "engines": {
- "node": "^20.17.0 || >=22.9.0"
- }
- },
"node_modules/body-parser": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.2.tgz",
@@ -7353,16 +7403,6 @@
"node": ">=6"
}
},
- "node_modules/cmd-shim": {
- "version": "8.0.0",
- "resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-8.0.0.tgz",
- "integrity": "sha512-Jk/BK6NCapZ58BKUxlSI+ouKRbjH1NLZCgJkYoab+vEHUY3f6OzpNBN9u7HFSv9J6TRDGs4PLOHezoKGaFRSCA==",
- "dev": true,
- "license": "ISC",
- "engines": {
- "node": "^20.17.0 || >=22.9.0"
- }
- },
"node_modules/code-block-writer": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.3.tgz",
@@ -10780,29 +10820,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/minipass": {
- "version": "7.1.3",
- "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz",
- "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==",
- "dev": true,
- "license": "BlueOak-1.0.0",
- "engines": {
- "node": ">=16 || 14 >=14.17"
- }
- },
- "node_modules/minizlib": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.1.0.tgz",
- "integrity": "sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "minipass": "^7.1.2"
- },
- "engines": {
- "node": ">= 18"
- }
- },
"node_modules/mongodb": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-7.1.0.tgz",
@@ -11189,16 +11206,6 @@
"integrity": "sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA==",
"license": "MIT"
},
- "node_modules/npm-normalize-package-bin": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-5.0.0.tgz",
- "integrity": "sha512-CJi3OS4JLsNMmr2u07OJlhcrPxCeOeP/4xq67aWNai6TNWWbTrlNDgl8NcFKVlcBKp18GPj+EzbNIgrBfZhsag==",
- "dev": true,
- "license": "ISC",
- "engines": {
- "node": "^20.17.0 || >=22.9.0"
- }
- },
"node_modules/npm-run-path": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-6.0.0.tgz",
@@ -11779,6 +11786,37 @@
"node": ">=16.20.0"
}
},
+ "node_modules/playwright": {
+ "version": "1.63.0",
+ "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.63.0.tgz",
+ "integrity": "sha512-+7ziBLidS4NaNCdt57SUDT+wYmmd5fmiQejUic/kb+YsYSCPyOOE9sebzMjNmQrsnNpDJqd4WHvV/8lfKfUDUg==",
+ "license": "Apache-2.0",
+ "optional": true,
+ "peer": true,
+ "dependencies": {
+ "playwright-core": "1.63.0"
+ },
+ "bin": {
+ "playwright": "cli.js"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/playwright-core": {
+ "version": "1.63.0",
+ "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.63.0.tgz",
+ "integrity": "sha512-rYCsBF/M5HjUch52bbtVONEFjv6Xu8sm8h72dNlR5bzIE1fvC/bxgspzkjSfU+MweEMmPM8KJebG6nnyxo5mCg==",
+ "license": "Apache-2.0",
+ "optional": true,
+ "peer": true,
+ "bin": {
+ "playwright-core": "cli.js"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
"node_modules/possible-typed-array-names": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz",
@@ -11928,16 +11966,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/proc-log": {
- "version": "6.1.0",
- "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-6.1.0.tgz",
- "integrity": "sha512-iG+GYldRf2BQ0UDUAd6JQ/RwzaQy6mXmsk/IzlYyal4A4SNFw54MeH4/tLkF4I5WoWG9SQwuqWzS99jaFQHBuQ==",
- "dev": true,
- "license": "ISC",
- "engines": {
- "node": "^20.17.0 || >=22.9.0"
- }
- },
"node_modules/prompts": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz",
@@ -12227,16 +12255,6 @@
}
}
},
- "node_modules/read-cmd-shim": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-6.0.0.tgz",
- "integrity": "sha512-1zM5HuOfagXCBWMN83fuFI/x+T/UhZ7k+KIzhrHXcQoeX5+7gmaDYjELQHmmzIodumBHeByBJT4QYS7ufAgs7A==",
- "dev": true,
- "license": "ISC",
- "engines": {
- "node": "^20.17.0 || >=22.9.0"
- }
- },
"node_modules/recast": {
"version": "0.23.11",
"resolved": "https://registry.npmjs.org/recast/-/recast-0.23.11.tgz",
@@ -13254,50 +13272,6 @@
}
}
},
- "node_modules/supabase": {
- "version": "2.84.1",
- "resolved": "https://registry.npmjs.org/supabase/-/supabase-2.84.1.tgz",
- "integrity": "sha512-tp+6z1qyRZwYuCwxj1DchWvBkQB/9l6Dy6WaNnW4kmVSjpZhohlwT8JhnyrMvsfi/XCOvnot6ips33f+qE08rA==",
- "dev": true,
- "hasInstallScript": true,
- "license": "MIT",
- "dependencies": {
- "bin-links": "^6.0.0",
- "https-proxy-agent": "^8.0.0",
- "node-fetch": "^3.3.2",
- "tar": "7.5.13"
- },
- "bin": {
- "supabase": "bin/supabase"
- },
- "engines": {
- "npm": ">=8"
- }
- },
- "node_modules/supabase/node_modules/agent-base": {
- "version": "8.0.0",
- "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-8.0.0.tgz",
- "integrity": "sha512-QT8i0hCz6C/KQ+KTAbSNwCHDGdmUJl2tp2ZpNlGSWCfhUNVbYG2WLE3MdZGBAgXPV4GAvjGMxo+C1hroyxmZEg==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">= 14"
- }
- },
- "node_modules/supabase/node_modules/https-proxy-agent": {
- "version": "8.0.0",
- "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-8.0.0.tgz",
- "integrity": "sha512-YYeW+iCnAS3xhvj2dvVoWgsbca3RfQy/IlaNHHOtDmU0jMqPI9euIq3Y9BJETdxk16h9NHHCKqp/KB9nIMStCQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "agent-base": "8.0.0",
- "debug": "^4.3.4"
- },
- "engines": {
- "node": ">= 14"
- }
- },
"node_modules/supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
@@ -13377,43 +13351,6 @@
"url": "https://opencollective.com/webpack"
}
},
- "node_modules/tar": {
- "version": "7.5.13",
- "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.13.tgz",
- "integrity": "sha512-tOG/7GyXpFevhXVh8jOPJrmtRpOTsYqUIkVdVooZYJS/z8WhfQUX8RJILmeuJNinGAMSu1veBr4asSHFt5/hng==",
- "dev": true,
- "license": "BlueOak-1.0.0",
- "dependencies": {
- "@isaacs/fs-minipass": "^4.0.0",
- "chownr": "^3.0.0",
- "minipass": "^7.1.2",
- "minizlib": "^3.1.0",
- "yallist": "^5.0.0"
- },
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/tar/node_modules/chownr": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz",
- "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==",
- "dev": true,
- "license": "BlueOak-1.0.0",
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/tar/node_modules/yallist": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz",
- "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==",
- "dev": true,
- "license": "BlueOak-1.0.0",
- "engines": {
- "node": ">=18"
- }
- },
"node_modules/tiny-invariant": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz",
@@ -14154,19 +14091,6 @@
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
"license": "ISC"
},
- "node_modules/write-file-atomic": {
- "version": "7.0.1",
- "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-7.0.1.tgz",
- "integrity": "sha512-OTIk8iR8/aCRWBqvxrzxR0hgxWpnYBblY1S5hDWBQfk/VFmJwzmJgQFN3WsoUKHISv2eAwe+PpbUzyL1CKTLXg==",
- "dev": true,
- "license": "ISC",
- "dependencies": {
- "signal-exit": "^4.0.1"
- },
- "engines": {
- "node": "^20.17.0 || >=22.9.0"
- }
- },
"node_modules/wsl-utils": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/wsl-utils/-/wsl-utils-0.3.1.tgz",
diff --git a/package.json b/package.json
index 24999fe..6223b6c 100644
--- a/package.json
+++ b/package.json
@@ -7,10 +7,10 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
- "db:start": "supabase start",
- "db:stop": "supabase stop",
- "db:reset": "supabase db reset",
- "db:push": "supabase db push",
+ "db:start": "docker compose up -d --wait db && node db/migrate.mjs",
+ "db:stop": "docker compose down",
+ "db:reset": "docker compose down -v && docker compose up -d --wait db && node db/migrate.mjs",
+ "db:migrate": "node db/migrate.mjs",
"auth:generate": "auth generate --config ./src/lib/auth/better-auth.config.ts",
"typecheck": "next typegen && tsc --noEmit --incremental false",
"lint": "eslint .",
@@ -47,7 +47,6 @@
"eslint": "^9",
"eslint-config-next": "16.1.7",
"prettier": "^3.8.1",
- "supabase": "^2.84.1",
"tailwindcss": "^4",
"typescript": "^5"
}
diff --git a/supabase/config.toml b/supabase/config.toml
deleted file mode 100644
index 2b50db3..0000000
--- a/supabase/config.toml
+++ /dev/null
@@ -1,22 +0,0 @@
-project_id = "signudoc"
-
-[db]
-major_version = 17
-
-[db.seed]
-enabled = false
-
-[auth]
-enabled = false
-
-[realtime]
-enabled = false
-
-[storage]
-enabled = false
-
-[edge_runtime]
-enabled = false
-
-[inbucket]
-enabled = false