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:
Tiel Coder
2026-11-17 18:09:24 +00:00
commit c595865496
39 changed files with 10908 additions and 0 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

+121
View File
@@ -0,0 +1,121 @@
@import "tailwindcss";
@plugin "tailwindcss-animate";
:root {
--radius: 0.625rem;
--background: oklab(1 0 0);
--foreground: oklab(0.145 0 0);
--card: oklab(1 0 0);
--card-foreground: oklab(0.145 0 0);
--popover: oklab(1 0 0);
--popover-foreground: oklab(0.145 0 0);
--primary: oklab(0.205 0 0);
--primary-foreground: oklab(0.985 0 0);
--secondary: oklab(0.97 0.006 0.015);
--secondary-foreground: oklab(0.205 0 0);
--muted: oklab(0.97 0.006 0.015);
--muted-foreground: oklab(0.451 0 0);
--accent: oklab(0.97 0.006 0.015);
--accent-foreground: oklab(0.205 0 0);
--destructive: oklab(0.583 0.185 -0.047);
--destructive-foreground: oklab(0.985 0 0);
--border: oklab(0.922 0.005 0.082);
--input: oklab(0.922 0.005 0.082);
--ring: oklab(0.708 0 0);
--chart-1: oklab(0.646 0.222 0.107);
--chart-2: oklab(0.6 0.115 -0.064);
--chart-3: oklab(0.398 0.063 0.064);
--chart-4: oklab(0.826 0.185 -0.024);
--chart-5: oklab(0.89 0.049 0.344);
--sidebar: oklab(0.985 0 0);
--sidebar-foreground: oklab(0.145 0 0);
--sidebar-primary: oklab(0.205 0 0);
--sidebar-primary-foreground: oklab(0.985 0 0);
--sidebar-accent: oklab(0.97 0.006 0.015);
--sidebar-accent-foreground: oklab(0.205 0 0);
--sidebar-border: oklab(0.922 0.005 0.082);
--sidebar-ring: oklab(0.708 0 0);
}
.dark {
--background: oklab(0.145 0 0);
--foreground: oklab(0.985 0 0);
--card: oklab(0.205 0 0);
--card-foreground: oklab(0.985 0 0);
--popover: oklab(0.205 0 0);
--popover-foreground: oklab(0.985 0 0);
--primary: oklab(0.985 0 0);
--primary-foreground: oklab(0.205 0 0);
--secondary: oklab(0.269 0 0);
--secondary-foreground: oklab(0.985 0 0);
--muted: oklab(0.269 0 0);
--muted-foreground: oklab(0.637 0 0);
--accent: oklab(0.269 0 0);
--accent-foreground: oklab(0.985 0 0);
--destructive: oklab(0.396 0.141 -0.093);
--destructive-foreground: oklab(0.985 0 0);
--border: oklab(0.269 0 0);
--input: oklab(0.269 0 0);
--ring: oklab(0.544 0 0);
--chart-1: oklab(0.488 0.24 -0.021);
--chart-2: oklab(0.617 0.229 -0.111);
--chart-3: oklab(0.395 0.124 0.174);
--chart-4: oklab(0.714 0.203 -0.028);
--chart-5: oklab(0.691 0.128 -0.042);
--sidebar: oklab(0.205 0 0);
--sidebar-foreground: oklab(0.985 0 0);
--sidebar-primary: oklab(0.488 0.24 -0.021);
--sidebar-primary-foreground: oklab(0.985 0 0);
--sidebar-accent: oklab(0.269 0 0);
--sidebar-accent-foreground: oklab(0.985 0 0);
--sidebar-border: oklab(0.269 0 0);
--sidebar-ring: oklab(0.544 0 0);
}
@theme inline {
--radius: 0.625rem;
--font-sans: var(--font-geist-sans);
--font-mono: var(--font-geist-mono);
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-card: var(--card);
--color-card-foreground: var(--card-foreground);
--color-popover: var(--popover);
--color-popover-foreground: var(--popover-foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--color-secondary: var(--secondary);
--color-secondary-foreground: var(--secondary-foreground);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);
--color-accent: var(--accent);
--color-accent-foreground: var(--accent-foreground);
--color-destructive: var(--destructive);
--color-destructive-foreground: var(--destructive-foreground);
--color-border: var(--border);
--color-input: var(--input);
--color-ring: var(--ring);
--color-chart-1: var(--chart-1);
--color-chart-2: var(--chart-2);
--color-chart-3: var(--chart-3);
--color-chart-4: var(--chart-4);
--color-chart-5: var(--chart-5);
--color-sidebar: var(--sidebar);
--color-sidebar-foreground: var(--sidebar-foreground);
--color-sidebar-primary: var(--sidebar-primary);
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
--color-sidebar-accent: var(--sidebar-accent);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-ring: var(--sidebar-ring);
}
@layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
font-family: var(--font-sans);
}
}
+34
View File
@@ -0,0 +1,34 @@
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
const geistSans = Geist({
variable: "--font-geist-sans",
subsets: ["latin"],
});
const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin"],
});
export const metadata: Metadata = {
title: "Media Team Hub",
description: "Church media team scheduling and training platform.",
};
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
{children}
</body>
</html>
);
}
+103
View File
@@ -0,0 +1,103 @@
import Image from "next/image";
export default function Home() {
return (
<div className="font-sans grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20">
<main className="flex flex-col gap-[32px] row-start-2 items-center sm:items-start">
<Image
className="dark:invert"
src="/next.svg"
alt="Next.js logo"
width={180}
height={38}
priority
/>
<ol className="font-mono list-inside list-decimal text-sm/6 text-center sm:text-left">
<li className="mb-2 tracking-[-.01em]">
Get started by editing{" "}
<code className="bg-black/[.05] dark:bg-white/[.06] font-mono font-semibold px-1 py-0.5 rounded">
src/app/page.tsx
</code>
.
</li>
<li className="tracking-[-.01em]">
Save and see your changes instantly.
</li>
</ol>
<div className="flex gap-4 items-center flex-col sm:flex-row">
<a
className="rounded-full border border-solid border-transparent transition-colors flex items-center justify-center bg-foreground text-background gap-2 hover:bg-[#383838] dark:hover:bg-[#ccc] font-medium text-sm sm:text-base h-10 sm:h-12 px-4 sm:px-5 sm:w-auto"
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
className="dark:invert"
src="/vercel.svg"
alt="Vercel logomark"
width={20}
height={20}
/>
Deploy now
</a>
<a
className="rounded-full border border-solid border-black/[.08] dark:border-white/[.145] transition-colors flex items-center justify-center hover:bg-[#f2f2f2] dark:hover:bg-[#1a1a1a] hover:border-transparent font-medium text-sm sm:text-base h-10 sm:h-12 px-4 sm:px-5 w-full sm:w-auto md:w-[158px]"
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
Read our docs
</a>
</div>
</main>
<footer className="row-start-3 flex gap-[24px] flex-wrap items-center justify-center">
<a
className="flex items-center gap-2 hover:underline hover:underline-offset-4"
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="/file.svg"
alt="File icon"
width={16}
height={16}
/>
Learn
</a>
<a
className="flex items-center gap-2 hover:underline hover:underline-offset-4"
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="/window.svg"
alt="Window icon"
width={16}
height={16}
/>
Examples
</a>
<a
className="flex items-center gap-2 hover:underline hover:underline-offset-4"
href="https://nextjs.org?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="/globe.svg"
alt="Globe icon"
width={16}
height={16}
/>
Go to nextjs.org →
</a>
</footer>
</div>
);
}
+36
View File
@@ -0,0 +1,36 @@
import * as React from "react"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
const badgeVariants = cva(
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
{
variants: {
variant: {
default:
"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
secondary:
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
destructive:
"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
outline: "text-foreground",
},
},
defaultVariants: {
variant: "default",
},
}
)
export interface BadgeProps
extends React.HTMLAttributes<HTMLDivElement>,
VariantProps<typeof badgeVariants> {}
function Badge({ className, variant, ...props }: BadgeProps) {
return (
<div className={cn(badgeVariants({ variant }), className)} {...props} />
)
}
export { Badge, badgeVariants }
+56
View File
@@ -0,0 +1,56 @@
import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
const buttonVariants = cva(
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
{
variants: {
variant: {
default: "bg-primary text-primary-foreground hover:bg-primary/90",
destructive:
"bg-destructive text-destructive-foreground hover:bg-destructive/90",
outline:
"border border-input bg-background hover:bg-accent hover:text-accent-foreground",
secondary:
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
ghost: "hover:bg-accent hover:text-accent-foreground",
link: "text-primary underline-offset-4 hover:underline",
},
size: {
default: "h-10 px-4 py-2",
sm: "h-9 rounded-md px-3",
lg: "h-11 rounded-md px-8",
icon: "h-10 w-10",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
}
)
export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
asChild?: boolean
}
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : "button"
return (
<Comp
className={cn(buttonVariants({ variant, size, className }))}
ref={ref}
{...props}
/>
)
}
)
Button.displayName = "Button"
export { Button, buttonVariants }
+79
View File
@@ -0,0 +1,79 @@
import * as React from "react"
import { cn } from "@/lib/utils"
const Card = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn(
"rounded-lg border bg-card text-card-foreground shadow-sm",
className
)}
{...props}
/>
))
Card.displayName = "Card"
const CardHeader = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn("flex flex-col space-y-1.5 p-6", className)}
{...props}
/>
))
CardHeader.displayName = "CardHeader"
const CardTitle = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn(
"text-2xl font-semibold leading-none tracking-tight",
className
)}
{...props}
/>
))
CardTitle.displayName = "CardTitle"
const CardDescription = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn("text-sm text-muted-foreground", className)}
{...props}
/>
))
CardDescription.displayName = "CardDescription"
const CardContent = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
))
CardContent.displayName = "CardContent"
const CardFooter = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn("flex items-center p-6 pt-0", className)}
{...props}
/>
))
CardFooter.displayName = "CardFooter"
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
+22
View File
@@ -0,0 +1,22 @@
import * as React from "react"
import { cn } from "@/lib/utils"
const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
({ className, type, ...props }, ref) => {
return (
<input
type={type}
className={cn(
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
className
)}
ref={ref}
{...props}
/>
)
}
)
Input.displayName = "Input"
export { Input }
+26
View File
@@ -0,0 +1,26 @@
"use client"
import * as React from "react"
import * as LabelPrimitive from "@radix-ui/react-label"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
const labelVariants = cva(
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
)
const Label = React.forwardRef<
React.ElementRef<typeof LabelPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
VariantProps<typeof labelVariants>
>(({ className, ...props }, ref) => (
<LabelPrimitive.Root
ref={ref}
className={cn(labelVariants(), className)}
{...props}
/>
))
Label.displayName = LabelPrimitive.Root.displayName
export { Label }
+19
View File
@@ -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";
+17
View File
@@ -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;
+18
View File
@@ -0,0 +1,18 @@
import { describe, it, expect } from "vitest";
import { cn } from "@/lib/utils";
describe("cn (class merge)", () => {
it("collapses conflicting classes to the last one", () => {
expect(cn("bg-red-500", "bg-green-500")).toBe("bg-green-500");
expect(cn("px-2", "px-4")).toBe("px-4");
});
it("combines non-conflicting classes", () => {
expect(cn("px-2", "py-4", "text-sm")).toBe("px-2 py-4 text-sm");
});
it("ignores falsy values", () => {
expect(cn(false, undefined, null, "", "keep")).toBe("keep");
expect(cn()).toBe("");
});
});
+10
View File
@@ -0,0 +1,10 @@
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
/**
* Merge Tailwind class names, resolving conflicts (e.g. `bg-red-500 bg-green-500`
* collapses to the last one). This is the standard shadcn/ui helper.
*/
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}