diff --git a/README.md b/README.md index 3894e21..28e7e64 100644 --- a/README.md +++ b/README.md @@ -362,11 +362,11 @@ src/context.ts RequestContext handed to handlers + buildContext() src/config.ts Env loader — Ory endpoints, cookie/CSRF secrets, JWKS, port; validated at boot src/plugin.ts definePlugin() + the host's plugin discovery/router (planned) views/ Core EJS templates (index, 403/404/500, partials/) -public/ Static assets under /public/ (css/, favicon, robots.txt) +public/ Static assets under /public/ (css/styles.css + auth.css, favicon, robots.txt) config/menu.ts Central menu override + branding (planned) plugins/ Drop-in plugin folders, auto-discovered (planned) -html-css-foundation/ Raw HTML/CSS design reference — the source for the - building-block partials; not served. +html-css-foundation/ HTML design mockups — the source for the building-block + partials; reference the stylesheets in public/css/. ``` Comments and docs cite roadmap phases as `§N` — the sections in `todo.md`. diff --git a/html-css-foundation/App Shell.html b/html-css-foundation/App Shell.html index 03797d2..ff6ae1f 100644 --- a/html-css-foundation/App Shell.html +++ b/html-css-foundation/App Shell.html @@ -4,7 +4,7 @@ App Shell — Template - + diff --git a/html-css-foundation/Auth.html b/html-css-foundation/Auth.html index f4c96a9..8ae40c5 100644 --- a/html-css-foundation/Auth.html +++ b/html-css-foundation/Auth.html @@ -4,8 +4,8 @@ Sign in — Console - - + + diff --git a/html-css-foundation/auth.css b/public/css/auth.css similarity index 100% rename from html-css-foundation/auth.css rename to public/css/auth.css diff --git a/public/css/style.css b/public/css/style.css deleted file mode 100644 index 5aa0962..0000000 --- a/public/css/style.css +++ /dev/null @@ -1,75 +0,0 @@ -:root { - color-scheme: light dark; - --bg: #ffffff; - --fg: #1a1a1a; - --muted: #5a5a5a; - --accent: #2563eb; - --border: #e5e5e5; -} - -@media (prefers-color-scheme: dark) { - :root { - --bg: #15171a; - --fg: #e8e8e8; - --muted: #9aa0a6; - --accent: #6ea8fe; - --border: #2a2d31; - } -} - -* { - box-sizing: border-box; -} - -body { - margin: 0; - background: var(--bg); - color: var(--fg); - font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; -} - -.site-header { - display: flex; - align-items: center; - justify-content: space-between; - gap: 1rem; - padding: 1rem 1.5rem; - border-bottom: 1px solid var(--border); -} - -.site-header .brand { - font-weight: 700; - text-decoration: none; - color: var(--fg); -} - -.site-header nav a { - color: var(--muted); - text-decoration: none; -} - -.site-header nav a:hover { - color: var(--accent); -} - -main, -footer { - max-width: 42rem; - margin: 0 auto; - padding: 1.5rem; -} - -footer { - color: var(--muted); - border-top: 1px solid var(--border); -} - -a { - color: var(--accent); -} - -code { - background: color-mix(in srgb, var(--fg) 8%, transparent); - padding: 0.1rem 0.35rem; - border-radius: 4px; -} diff --git a/html-css-foundation/styles.css b/public/css/styles.css similarity index 100% rename from html-css-foundation/styles.css rename to public/css/styles.css diff --git a/src/app.test.ts b/src/app.test.ts index 7e0f01a..5b5783f 100644 --- a/src/app.test.ts +++ b/src/app.test.ts @@ -29,11 +29,11 @@ test("serves the home page as HTML", async () => { }); test("serves a static file: GET sends body + content-type, HEAD sends headers only", async () => { - const get = await fetch(base + "/public/css/style.css"); + const get = await fetch(base + "/public/css/styles.css"); assert.equal(get.status, 200); assert.match(get.headers.get("content-type") ?? "", /text\/css/); - const head = await fetch(base + "/public/css/style.css", { method: "HEAD" }); + const head = await fetch(base + "/public/css/styles.css", { method: "HEAD" }); assert.equal(head.status, 200); assert.ok(Number(head.headers.get("content-length")) > 0); assert.equal((await head.text()).length, 0); @@ -83,7 +83,7 @@ test("renders the 500 HTML page when a handler throws", async () => { test("renders the 403 error page as HTML", async () => { const html = await ejs.renderFile(join(viewsDir, "403.ejs"), { title: "Forbidden" }); assert.match(html, /403/); - assert.match(html, /style\.css/); + assert.match(html, /styles\.css/); }); test("rejects unsafe static request paths (encoded traversal, NUL) with 403", async () => { @@ -94,7 +94,7 @@ test("rejects unsafe static request paths (encoded traversal, NUL) with 403", as test("resolveStaticPath blocks traversal and control chars, allows nested files", () => { assert.equal(resolveStaticPath("/srv/public", "../app.ts"), null); assert.equal(resolveStaticPath("/srv/public", "a\x00b"), null); - assert.equal(resolveStaticPath("/srv/public", "css/style.css"), "/srv/public/css/style.css"); + assert.equal(resolveStaticPath("/srv/public", "css/styles.css"), "/srv/public/css/styles.css"); }); test("contentTypeFor maps known and unknown extensions", () => { diff --git a/todo.md b/todo.md index 857997c..0f64033 100644 --- a/todo.md +++ b/todo.md @@ -25,7 +25,7 @@ everything via Docker. - [x] Remove all usage of NODE_ENV - add a new core principle to the project that the app should at all times be unaware of what environment it is running in. Configuration should be explicit, like "disable email" or "cache templates". → Dropped NODE_ENV everywhere; added **environment-agnostic** principle (AGENTS.md §4 + README). Behaviour is now explicit toggles: `CACHE_TEMPLATES`, `REQUIRE_SECURE_SECRETS` (parsed/validated in `config.ts`, wired via `server.ts`); compose files set them per deployment. `app.ts` no longer reads `process.env`. ## 1. Building blocks — extract from `html-css-foundation/` (no Ory needed; render mock data) -- [ ] Move `styles.css` + `auth.css` into `public/css/`; remove existing `style.css`. +- [x] Move `styles.css` + `auth.css` into `public/css/`; remove existing `style.css`. → `git mv` from `html-css-foundation/` into `public/css/`; dropped the placeholder `style.css`; views + tests now reference `styles.css`; foundation mockups repointed to `../public/css/`. - [ ] Lucide icon sprite from `lucide-static` (dep added) → `views/partials/icons.ejs`; serve/inline only the icons used. - [ ] App-shell partial (sidebar + topbar + content slot). - [ ] Nav-tree partial — recursive, header/leaf × clickable/static, counts, `aria-current`. diff --git a/views/403.ejs b/views/403.ejs index e9a0688..60770bf 100644 --- a/views/403.ejs +++ b/views/403.ejs @@ -4,7 +4,7 @@ <%= title %> - +
diff --git a/views/404.ejs b/views/404.ejs index 400f3ed..5d1987a 100644 --- a/views/404.ejs +++ b/views/404.ejs @@ -4,7 +4,7 @@ <%= title %> - +
diff --git a/views/500.ejs b/views/500.ejs index 828bfdd..774d8d5 100644 --- a/views/500.ejs +++ b/views/500.ejs @@ -4,7 +4,7 @@ <%= title %> - +
diff --git a/views/index.ejs b/views/index.ejs index 1eda4cf..2d4b785 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -4,7 +4,7 @@ <%= title %> - +