A1: foundation scaffold (Next.js 15, shadcn/Radix, Drizzle+Postgres, Vitest, Docker)
- Next.js 15 + TS strict + Tailwind 4 + ESLint 9 - shadcn/ui initialized (Radix, CSS variables); cn() util - Drizzle + postgres driver + Zod; db client + schema placeholder (A2) - Vitest with passing cn() test; GitHub Actions CI - Portable container stack: multi-stage non-root Dockerfile, docker-compose (app + Postgres on host 5433) - Verified: typecheck, lint, test (3), build, docker build, HTTP 200 on :3000 - Records the 5 pre-build decisions (email-only launch, SMS deferred)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import postgres from "postgres";
|
||||
import { drizzle } from "drizzle-orm/postgres-js";
|
||||
import * as schema from "./schema";
|
||||
|
||||
/**
|
||||
* Database client (postgres.js + Drizzle). Reads DATABASE_URL from the
|
||||
* environment — provided by docker-compose in production, or .env locally.
|
||||
*
|
||||
* Phase A2: this client is the single entry point for all DB access. Domain
|
||||
* logic (src/domain/**) must NOT touch the DB directly.
|
||||
*/
|
||||
const connection = postgres(process.env.DATABASE_URL!, {
|
||||
max: 10,
|
||||
});
|
||||
|
||||
export const db = drizzle(connection, { schema });
|
||||
|
||||
export { schema };
|
||||
export * from "./schema";
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Database schema — Phase A2 populates the full data model here.
|
||||
*
|
||||
* Full spec: ARCHITECTURE.md §4 (users, roles, services, instances, slots,
|
||||
* assignments, the skill taxonomy, notifications outbox, etc.).
|
||||
*
|
||||
* Conventions (from the spec):
|
||||
* - `id` is a UUIDv7 text column
|
||||
* - timestamps are `*_at` in UTC ISO-8601
|
||||
* - dates are `*_date` in the church's local timezone
|
||||
* - soft-delete only where noted; no hard deletes in the taxonomy graph
|
||||
*/
|
||||
|
||||
// Placeholder: A2 replaces this object with the real tables.
|
||||
export const schema = {};
|
||||
|
||||
export type Schema = typeof schema;
|
||||
Reference in New Issue
Block a user