diff --git a/Dockerfile b/Dockerfile index b0be801..fbbad09 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,8 @@ ARG COMMIT_SHA ARG NEXT_PUBLIC_SENTRY_DSN # sentry.server/edge configs skipped — no server runtime in a static export -COPY public ./public +# no `public/` dir: static assets (favicon, robots.txt) live under src/app. +# Re-add `COPY public ./public` here if one is ever introduced. COPY src ./src COPY tsconfig.json next.config.ts postcss.config.mjs ./ diff --git a/README.md b/README.md index 4dcd66e..7cd636c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,75 @@ -# StegNet frontend website +# StegNet frontend -Welcome to the StegNet frontend website repo! \ No newline at end of file +The public StegNet website. A statically-exported [Next.js](https://nextjs.org) +site, served by Caddy from a small Docker image and self-hosted behind Traefik. + +## Stack + +- **Next.js 16** (App Router) — exported to static HTML (`output: "export"`) +- **Bun** — package manager and build runtime +- **Tailwind CSS v4** + **shadcn** (Base UI) components +- **Sentry** — client error tracking, releases, source maps +- **LogTape** — structured logging +- **Caddy** — static file server in the runtime image + +## Local development + +```bash +bun install +bun dev +``` + +Then open http://localhost:3000. + +### Environment + +Local env lives in `.env.local` (gitignored). The site reads: + +| Variable | Purpose | +| --- | --- | +| `NEXT_PUBLIC_SENTRY_DSN` | Sentry DSN (public) | +| `NEXT_PUBLIC_APP_VERSION` | Version shown in the footer (set at build) | +| `NEXT_PUBLIC_COMMIT_SHA` | Commit shown in the footer (set at build) | + +Sentry `environment` is derived at runtime from the hostname (`staging.*` → +staging, `localhost` → development, otherwise production), so one build serves +every environment. + +## Build + +```bash +bun run build +``` + +Produces a static site in `out/`. + +## Docker + +The image builds the static export and serves it with Caddy on port **8080** +(non-root). TLS is terminated upstream by Traefik. + +```bash +docker build \ + --build-arg VERSION=1.2.3 \ + --build-arg COMMIT_SHA="$(git rev-parse HEAD)" \ + --build-arg NEXT_PUBLIC_SENTRY_DSN="$NEXT_PUBLIC_SENTRY_DSN" \ + --secret id=SENTRY_AUTH_TOKEN,env=SENTRY_AUTH_TOKEN \ + -t stegnet-frontpage . +``` + +## Release & deploy + +Deploys are driven by **git tags**. Pushing a `vX.Y.Z` tag triggers +`.github/workflows/publish-image.yml`, which: + +1. builds the image (version + commit baked in) and creates the Sentry release + with source maps, +2. pushes `ghcr.io/stegnet/frontpage:` and `:latest` to GHCR, +3. records a Sentry deploy and calls the Portainer webhook to roll out. + +```bash +git tag v1.2.3 +git push origin v1.2.3 +``` + +Portainer pulls the new tag from GHCR and Caddy serves it behind Traefik. diff --git a/public/file.svg b/public/file.svg deleted file mode 100644 index 004145c..0000000 --- a/public/file.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/globe.svg b/public/globe.svg deleted file mode 100644 index 567f17b..0000000 --- a/public/globe.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/next.svg b/public/next.svg deleted file mode 100644 index 5174b28..0000000 --- a/public/next.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/vercel.svg b/public/vercel.svg deleted file mode 100644 index 7705396..0000000 --- a/public/vercel.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/window.svg b/public/window.svg deleted file mode 100644 index b2b2a44..0000000 --- a/public/window.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/app/globals.css b/src/app/globals.css index 82eaaaa..392643c 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -48,10 +48,6 @@ --radius-4xl: calc(var(--radius) * 2.6); } -h1 { - font-size: xx-large; -} - :root { --background: oklch(1 0 0); --foreground: oklch(0.145 0 0); diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx new file mode 100644 index 0000000..6d9d814 --- /dev/null +++ b/src/app/not-found.tsx @@ -0,0 +1,31 @@ +import Link from "next/link"; + +export default function NotFound() { + return ( +
+
+ +

+ 404 +

+ +

+ This page wandered off. +

+ +

+ The page you're after doesn't exist — or isn't ready yet. +

+ + + Back home + +
+ ); +} diff --git a/src/app/page.tsx b/src/app/page.tsx index 8b0ebf2..08110da 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -9,12 +9,31 @@ export default function Home() { useEffect(() => { logger.info('Rendering home page...', { platform: navigator.userAgent }); }, [logger]); - + return ( -
-

We are cooking up something awesome...

-
-

Pardon the lack of detail, we will reach out when we have more info for you. Check back soon-ish!

-
+
+ {/* Soft background accent — decorative only. */} +
+ + + + + + + StegNet + + +

+ We're cooking up something awesome. +

+ +

+ Pardon the lack of detail — we'll reach out when we have more for + you. Check back soon-ish. +

+
); }