Daymark is a family-room information board built with SvelteKit. The UI is tuned for a 1920×1200 portrait display and combines shared household information, ambient visuals, and host health metrics in a single kiosk-friendly screen.
The product-facing rebrand from "Family Dashboard" to "Daymark" is complete. The repository name and existing production identifiers still use family-dashboard until the operational migration is performed; retaining them temporarily keeps the deployed service and countdown database compatible. See docs/daymark-rebrand.md for the remaining migration checklist.
- Hero area with:
- current time/date
- school lunch options
- optional message banner
- optional countdown list
- Weather card with:
- current conditions
- alert pills
- sunrise/sunset and moonrise/moonset
- rolling seven-day forecast (excluding today)
- One-week calendar with:
- all-day and timed events
- calendar legend with per-calendar colors/icons
- merged duplicate all-day events across calendars
- System status chips for:
- the Raspberry Pi display host
- the backend/server host
- Rotating wallpaper background with responsive photo sizes
- Optional snow overlay component (present in the repo, currently disabled in
src/routes/+layout.svelte)
Daymark's calendar cells celebrate the season while keeping events readable. All events shown below are fictional demonstration data.
Regenerate both with yarn demos:generate. See the
capture and export guide for setup, individual
scenes and social media exports.
| Layer | Responsibility | Key files |
|---|---|---|
| UI components | Clock, school lunch, weather, calendar, wallpaper, system status | src/lib/components/*.svelte |
| Shared UI logic | Calendar duplicate-merge behavior and config helpers | src/lib/calendarMerge.ts, src/lib/config/** |
| Routes | Compose the dashboard shell and page layout | src/routes/+layout.svelte, src/routes/+page.svelte |
| Server load | Prefetch weather, wallpaper metadata, and school lunch for first paint | src/routes/+layout.server.ts |
| API and media routes | Proxy upstream calendar/weather/school-menu/system data and serve photos/icons | src/routes/api/**, src/routes/photos/**, src/routes/vendor/** |
| Styling | Global tokens/app shell plus component-local styles | src/app.css, component <style> blocks, docs/css-architecture.md |
| Static assets | Lottie weather animations, SVGs, wallpapers, manifest assets | static/ |
This project uses Svelte 5 runes such as $state and $derived for local component state. Server routes proxy upstream APIs so browser clients do not need direct access to external services or credentials.
The project has been incrementally refactored toward component-owned styles.
src/app.cssowns:- global design tokens
- font-face declarations
- resets/base element styles
- app-shell layering and layout primitives
- a small set of intentional global exceptions
- Component
<style>blocks own:- component internals
- component states and modifiers
- component-local responsive behavior
- Route components may style child roots for placement, but should not style child internals.
See docs/css-architecture.md for the current rules and stylelint rollout guidance.
- Node.js 20+
- Yarn 4 with Plug'n'Play enabled
- ImageMagick (
mogrify) if you want photo resizing inyarn optimize:photos - Python 3.7+ on the Raspberry Pi if you want live Pi system metrics via the sidecar script
-
Install dependencies:
yarn install
-
Create a
.envfile in the project root. See Environment configuration. -
Add wallpaper photos if needed:
- either place JPGs under
static/photos/ - or point
PHOTO_DIRat an external photo directory
- either place JPGs under
-
Start the development server:
yarn dev
For LAN access from another device on your network:
yarn dev:lan
-
Open the URL shown in the terminal (default
http://localhost:5173).
yarn check
yarn lint
yarn lint:css
yarn test
yarn db:generate
yarn db:migrate
yarn db:seed
yarn fix:css
yarn formatNotes:
yarn lintruns Prettier in check mode, ESLint, and the scoped CSS lint script.yarn lint:css/yarn fix:csscurrently follow the scoped rollout documented indocs/css-architecture.md.yarn db:migrateapplies local Drizzle/libsql migrations for countdown events. Run it before restarting the deployed service.yarn db:seedinserts the sample countdowns fromsrc/lib/config/countdowns.tswithout overwriting existing rows.- Countdown
target_dateis stored verbatim and may be either a date-onlyYYYY-MM-DDvalue (all-day, interpreted in the viewer's display timezone) or a full ISO 8601 datetime with an explicit offset (e.g.2026-07-06T15:00:00-05:00). src/app.cssis still excluded from the package CSS lint script to avoid forcing broad global rewrites during the incremental ownership migration.
Create a .env file alongside the project root with the variables consumed by the server routes:
| Variable | Purpose |
|---|---|
CAL_URL |
Base URL for the calendar events feed |
TASKS_URL |
Optional override URL for the OmniCal tasks feed |
CAL_API_KEY |
Optional API key header sent to calendar endpoints |
CAL_CLIENT_ZONE |
Default timezone supplied to the calendar service |
DISPLAY_LOCALE |
Optional locale for absolute date/time display formatting |
DISPLAY_TIMEZONE |
Optional timezone for date/time display format |
DISPLAY_HOUR12 |
Optional 12-hour/24-hour display override |
COUNTDOWN_DB_URL |
Optional libsql URL for countdown storage; defaults to file:./data/family-dashboard.db |
COUNTDOWN_ADMIN_TOKEN |
Required token for countdown admin reads and mutations via x-admin-token |
CAL_CALENDARS_URL |
Optional separate endpoint for calendar metadata/legend |
WX_URL or AGG_WEATHER_URL |
Weather data endpoint consumed by /api/weather |
SCHOOL_MENU_URL |
Optional override for the school-menu upstream |
PHOTO_DIR |
Optional absolute/relative directory for wallpaper JPGs |
GPU_TEMP_FILE |
Optional server-side GPU temperature file path |
If PHOTO_DIR is not set, the app serves photos from static/photos.
If TASKS_URL is not set, /api/tasks derives the OmniCal tasks endpoint from CAL_URL.
DISPLAY_HOUR12 accepts common boolean forms such as true/false, 1/0, yes/no, and on/off.
DISPLAY_* settings affect display formatting only. They do not change operational scheduling or query logic such as school-menu polling, calendar bucketing/query behavior, all-day boundaries, or similar domain-time calculations.
Current v1 locale scope is intentionally narrow: locale settings apply to absolute date/time formatting via Intl, while English strings such as just now, x mins ago, Today, and Tomorrow remain hardcoded.
Example:
CAL_URL="https://example.com/api/calendar"
TASKS_URL="https://example.com/api/tasks"
CAL_API_KEY="your-api-key-here"
CAL_CLIENT_ZONE="America/Chicago"
DISPLAY_LOCALE="en-US"
DISPLAY_TIMEZONE="America/Chicago"
DISPLAY_HOUR12="true"
COUNTDOWN_DB_URL="file:./data/family-dashboard.db"
COUNTDOWN_ADMIN_TOKEN="change-me"
CAL_CALENDARS_URL="https://example.com/api/calendars"
WX_URL="https://example.com/api/weather"
SCHOOL_MENU_URL="https://example.com/api/school-menu/next"
PHOTO_DIR="/mnt/photos/dashboard"
GPU_TEMP_FILE="/sys/class/hwmon/hwmon2/temp1_input"The dashboard is served by @sveltejs/adapter-node. The production unit (systemd) runs node build from the project root with EnvironmentFile=.env.
Because the adapter-node bundle externalizes the native @libsql/client dependency, the server process must run with the Yarn Plug'n'Play runtime active, or it fails on first request with ERR_MODULE_NOT_FOUND: Cannot find package '@libsql/client'. Use one of the following:
-
Set
NODE_OPTIONSin the service environment (this repo loads it viaEnvironmentFile=.env):NODE_OPTIONS="--require /srv/apps/family-dashboard/.pnp.cjs --loader /srv/apps/family-dashboard/.pnp.loader.mjs" -
Or start the service under Yarn so PnP is set up automatically: change
ExecStarttoyarn node build.
Deploy order:
yarn installyarn buildyarn db:migrate(andyarn db:seedon first deploy). These use the sameCOUNTDOWN_DB_URLas the server (defaultfile:./data/family-dashboard.db, resolved from the working directory).- Restart the service:
sudo systemctl restart family-dashboard.
The dashboard shows system metrics for two machines:
- the server host, via
/api/server-sysinfo - the Raspberry Pi display host, via the standalone
scripts/pi_sysinfo.pysidecar
In the current UI implementation:
- development mode uses deterministic mock Pi data when the sidecar is unavailable
- non-dev builds fetch Pi metrics directly from
http://127.0.0.1:9000/sysinfoin the browser
That means the common deployment model is:
- run the dashboard on the Pi display host, and
- run
pi_sysinfo.pyon that same Pi listening on port9000
The current app does not consume a PI_SYSINFO_URL environment variable.
The scripts/pi_sysinfo.py script is a lightweight HTTP service that:
- reads Pi-specific metrics from
/proc/and related system tools - reports CPU temperature, GPU temperature, load, memory, uptime, CPU count, and IPv4 address
- exposes this data as JSON at
http://<pi-ip>:9000/sysinfo
- Python 3.7+
vcgencmd(included by default on Raspberry Pi OS)- network access if you want to test the endpoint from another machine
From your development machine:
scp scripts/pi_sysinfo.py <username>@<pi-ip>:/home/<username>/Example:
scp scripts/pi_sysinfo.py mkimitch@192.168.1.100:/home/mkimitch/SSH into your Pi and run it:
ssh <username>@<pi-ip>
python3 ~/pi_sysinfo.py --port 9000You should see:
pi-sysinfo listening on http://127.0.0.1:9000/sysinfoTest it locally on the Pi:
curl http://localhost:9000/sysinfoThis should return JSON with ipv4, cpuTempC, gpuTempC, cpuCount, load, mem, and uptimeSec.
Press Ctrl+C to stop the script once verified.
Create a service file:
sudo nano /etc/systemd/system/pi-sysinfo.serviceAdd the following configuration, replacing <username> with your actual username:
[Unit]
Description=Raspberry Pi System Info HTTP Service
After=network.target
[Service]
Type=simple
User=<username>
WorkingDirectory=/home/<username>
ExecStart=/usr/bin/python3 /home/<username>/pi_sysinfo.py --port 9000
Restart=on-failure
RestartSec=5
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.targetsudo systemctl daemon-reload
sudo systemctl enable pi-sysinfo.service
sudo systemctl start pi-sysinfo.servicesudo systemctl status pi-sysinfo.service
sudo journalctl -u pi-sysinfo.service -n 50You should see Active: active (running) in the status output.
sudo systemctl restart pi-sysinfo.service
sudo systemctl stop pi-sysinfo.service
sudo systemctl disable pi-sysinfo.service
sudo journalctl -u pi-sysinfo.service -f- Service fails with "Failed at step USER": Check that the
User=field in the service file matches your actual username. Runwhoamion the Pi to confirm. - IP shows as
unknown: The script may not be running, or the Pi is not exposing a usable IPv4 address. Check the service logs withsudo journalctl -u pi-sysinfo.service. - Metrics not updating in production: Ensure the browser host can reach
http://127.0.0.1:9000/sysinfo. The current UI expects the Pi sidecar there in non-dev mode.
src/routes/+layout.server.tsprefetches weather, wallpaper metadata, and school lunch data for the first render.SchoolMenu,WeatherCard,Calendar, andSystemStatusStubrefresh their own data on mount using the app's route proxies.Calendarloads calendar metadata from/api/calendars, event data from/api/calendar, and overlay data from/api/calendar-overlays.- Duplicate all-day events across calendars are merged client-side by
src/lib/calendarMerge.tswhenMERGE_ALLDAY_DUPLICATESis enabled. Wallpaperrotates between kiosk/mid/HQ photo variants and updates the visible background height to match the composed board layout.
Most upstream data flows through SvelteKit routes so credentials and upstream URLs stay server-side. The main exception is the Pi sidecar, which the browser reads directly from http://127.0.0.1:9000/sysinfo in non-dev mode.
| Script | Description |
|---|---|
yarn dev |
Run the Vite dev server |
yarn dev:lan |
Run the dev server on 0.0.0.0:5173 for LAN testing |
yarn check |
Run svelte-check after svelte-kit sync |
yarn check:watch |
Run svelte-check in watch mode |
yarn lint |
Run Prettier check, ESLint, and the scoped CSS lint script |
yarn lint:css |
Run the scoped stylelint pass defined in package.json |
yarn fix:css |
Apply scoped stylelint fixes, then run Prettier on those files |
yarn format |
Format the repository with Prettier |
yarn optimize:photos |
Resize/copy JPGs from photos-src/ into static/photos/{kiosk,mid,hq} |
yarn build |
Run optimize:photos, then build the adapter-node output |
yarn preview |
Preview the production build with Vite |
yarn start |
Run the built Node server |
- Wallpapers live under
static/photos/by default and are typically ignored by git to keep personal photos private. - Weather animations live under
static/lottie/weather/, are selected throughsrc/lib/weatherIcons.ts, and are rendered withlottie-webviasrc/lib/components/LottieWeatherIcon.svelte. Seedocs/weather-icons.mdfor the feed-to-icon map and data-gated families. - The repo also exposes installed weather icon packages through
src/routes/vendor/weather-icons/[...path]/+server.tsfor package-hosted SVG assets. - Static SVG assets live under
static/svg/static/. - System status SVG assets (e.g.,
rpi.svg,server.svg,cpu-filled.svg,gpu-filled.svg,uptime-1.svg) are from the Uicons by Flaticon set and require attribution when published. - Moon phase imagery derived from "Moon Phases Loop" by NASA's Scientific Visualization Studio.
- Visualizer: Ernie Wright (USRA).
- Source frames: NASA SVS ID 4310.
- Images were processed for this project by cropping, removing the black background, resizing, and exporting as transparent PNG icons.
- NASA does not endorse this project.
Create a production build:
yarn buildThis project currently uses @sveltejs/adapter-node in svelte.config.js.
Run the built server:
yarn startNotes:
yarn buildrunsyarn optimize:photosfirst; that script safely no-ops ifphotos-src/does not exist.yarn previewis still useful for local build verification, butyarn startreflects the adapter-node production target.
- Missing adapters or build startup issues: run
yarn installand make sure@sveltejs/adapter-nodeis present, since the repo is configured for adapter-node builds. - Weather or calendar data missing: verify your
.envconfiguration and confirm the upstream services are reachable from the SvelteKit server. - School lunch is empty: check
SCHOOL_MENU_URL, or verify the default upstream host is reachable from the server. - Pi metrics missing in production: make sure the browser host can reach
http://127.0.0.1:9000/sysinfo. - Wallpapers not rotating: ensure JPGs exist in
PHOTO_DIRorstatic/photos, and confirm the generated/photos/...routes can read them. - Photo optimization is not resizing: install ImageMagick so
mogrifyis available; otherwise the script copies photos without resizing.
- Branch from the current mainline.
- Run the relevant local checks before submitting changes.
- If you touch CSS ownership or style structure, consult
docs/css-architecture.md. - Summarize UI-visible changes with screenshots or short recordings when practical.

