Repository navigation
[review only] kleinbem-dev/foyer full review #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| use flake |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: github-actions | ||
| directory: / | ||
| schedule: | ||
| interval: weekly | ||
| cooldown: | ||
| default-days: 7 | ||
| groups: | ||
| actions: | ||
| patterns: ["*"] | ||
| update-types: [minor, patch] | ||
|
|
||
| - package-ecosystem: npm | ||
| directory: / | ||
| schedule: | ||
| interval: weekly | ||
| cooldown: | ||
| default-days: 7 | ||
| groups: | ||
| npm-dependencies: | ||
| patterns: ["*"] | ||
| update-types: [minor, patch] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: ci | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
|
|
||
| permissions: {} | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| check: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: kleinbem/actions/nix-setup@f1b4f5fc52ea31b1f9e53ca29170570fe4651c7d # v1.7.1 | ||
| - name: Flake check | ||
| run: nix flake check | ||
| - name: Svelte check | ||
| run: | | ||
| nix develop --command npm ci | ||
| nix develop --command npm run check | ||
| - name: Build web | ||
| run: nix build .#default |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| name: fleet-lint | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| fleet-lint: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| fetch-depth: 0 # gitleaks scans every commit of the PR | ||
| persist-credentials: false | ||
| - uses: kleinbem/actions/nix-setup@f1b4f5fc52ea31b1f9e53ca29170570fe4651c7d # v1.7.1 | ||
| - uses: kleinbem/actions/lint@f1b4f5fc52ea31b1f9e53ca29170570fe4651c7d # v1.7.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| node_modules/ | ||
| .svelte-kit/ | ||
| build/ | ||
| dist/ | ||
| .env | ||
| .env.* | ||
| !.env.example | ||
| .direnv/ | ||
| result | ||
| result-* | ||
| *.log | ||
| .DS_Store |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| AGENTS.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # AGENTS.md | ||
|
|
||
| Guidance for AI assistants working on Foyer. | ||
|
|
||
| ## What Foyer is | ||
|
|
||
| Foyer is the lightweight, next-generation homelab portal and service launchpad for the kleinbem fleet (`home.kleinbem.dev`). | ||
| It replaces legacy heavy dashboards (like Homepage) with a fast, modern static SvelteKit application styled with `@kleinbem/web-config` and Tailwind CSS 4. | ||
|
|
||
| ## Key Capabilities | ||
|
|
||
| - **Fleet Design System**: Uses `@kleinbem/web-config` themes (dark/light, system preference, zero-FOUC). | ||
| - **Fleet Inventory Integration**: Reads services dynamically from `inventory.nix` data. | ||
| - **Network Reachability Indicators**: Highlights Public (Cloudflare Tunnel), Mesh-Only (NetBird), and LAN endpoints. | ||
| - **Gatus Live Health**: Queries live service statuses from `status.kleinbem.dev`. | ||
| - **Command Palette (`⌘K`)**: Instant fuzzy search across services, hosts, and tools. | ||
| - **Zero Runtime Overhead**: Packaged via Nix (`buildNpmPackage`) as a pure static SPA served directly by Caddy. | ||
|
|
||
| ## Development | ||
|
|
||
| ```bash | ||
| just dev # Run Vite dev server | ||
| just check # Run svelte-check and TypeScript checks | ||
| just build # Build static production assets | ||
| just preview # Preview production build | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| AGENTS.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| AGENTS.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Foyer 🏠 | ||
|
|
||
| > *The elegant, lightweight homelab portal and service launchpad for the kleinbem fleet.* | ||
|
|
||
| Foyer serves as the front door to [`home.kleinbem.dev`](https://home.kleinbem.dev). Built with modern SvelteKit and Tailwind CSS 4 using the shared [`@kleinbem/web-config`](https://github.com/kleinbem/web-config) design system, Foyer delivers instantaneous page loads with zero runtime overhead on host infrastructure. | ||
|
|
||
| ## ✨ Features | ||
|
|
||
| - **Fleet Design System**: Fully synchronized theme tokens, typography, and dark/light modes powered by `@kleinbem/web-config`. | ||
| - **Zero Runtime Overhead**: Packaged via Nix as a pure static SPA served directly by Caddy; no persistent Node.js or container runtime required on `core-pi`. | ||
| - **Network Reachability Awareness**: Clear visual badges for **Public** (Cloudflare Tunnel), **Mesh-Only** (NetBird), and **LAN-Only** services. | ||
| - **Real-Time Health & Uptime**: Direct live status integration with the fleet's [Gatus](https://status.kleinbem.dev) instance. | ||
| - **Command Palette (`⌘K` / `/`)**: Fast keyboard-driven fuzzy search across all services, host nodes, and quick links. | ||
| - **Host Node Filtering**: Filter services dynamically by node (`core-pi`, `nixos-nvme`, `mac-mini`, `nasbook`, `bpi-r4`). | ||
| - **Live Weather & Telemetry**: Built-in weather widget (Open-Meteo) and system clocks. | ||
|
|
||
| ## 🛠️ Development | ||
|
|
||
| ```bash | ||
| just dev # Start local development server | ||
| just check # Run Svelte and TypeScript checks | ||
| just build # Build static assets (to build/) | ||
| just preview # Preview production build | ||
| ``` | ||
|
|
||
| ## 📦 Deployment & Nix | ||
|
|
||
| Packaged using `pkgs.buildNpmPackage` with reproducible npm locks: | ||
|
|
||
| ```bash | ||
| nix build .#default | ||
| ``` | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| { | ||
| description = "Lightweight homelab portal and service launchpad for the kleinbem fleet"; | ||
|
|
||
| inputs = { | ||
| nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
| flake-utils.url = "github:numtide/flake-utils"; | ||
| }; | ||
|
|
||
| outputs = | ||
| { | ||
| nixpkgs, | ||
| flake-utils, | ||
| ... | ||
| }: | ||
| flake-utils.lib.eachDefaultSystem ( | ||
| system: | ||
| let | ||
| pkgs = nixpkgs.legacyPackages.${system}; | ||
| in | ||
| { | ||
| formatter = pkgs.nixfmt; | ||
|
|
||
| packages.default = pkgs.buildNpmPackage { | ||
| pname = "foyer"; | ||
| version = "0.1.0"; | ||
| src = ./.; | ||
| npmDeps = pkgs.importNpmLock { npmRoot = ./.; }; | ||
| npmConfigHook = pkgs.importNpmLock.npmConfigHook; | ||
| installPhase = '' | ||
| mkdir -p $out | ||
| cp -r build/* $out/ | ||
| ''; | ||
| meta = with pkgs.lib; { | ||
| description = "Lightweight homelab portal and service launchpad"; | ||
| homepage = "https://github.com/kleinbem-dev/foyer"; | ||
| license = licenses.mit; | ||
| }; | ||
| }; | ||
|
|
||
| devShells.default = pkgs.mkShell { | ||
| packages = with pkgs; [ | ||
| nodejs_22 | ||
| just | ||
| ]; | ||
| }; | ||
| } | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| default: | ||
| @just --list | ||
|
|
||
| # Start development server | ||
| dev: | ||
| npm run dev | ||
|
|
||
| # Build production assets | ||
| build: | ||
| npm run build | ||
|
|
||
| # Run type and svelte checks | ||
| check: | ||
| npm run check | ||
|
|
||
| # Preview production build locally | ||
| preview: | ||
| npm run preview |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # deepmerge has no fixed release yet (TehShrike/deepmerge#285); it comes in | ||
| # only through @sveltejs/vite-plugin-svelte (dev) and merges the local Vite | ||
| # config at build time, never request data. | ||
| [[IgnoredVulns]] | ||
| id = "GHSA-gcqx-w48m-w2h4" | ||
| ignoreUntil = 2027-02-03 | ||
| reason = "No fixed deepmerge release (TehShrike/deepmerge#285); dev-only via @sveltejs/vite-plugin-svelte, merges trusted build config" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.