• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
ashryanio

ashryanio

routineTrackerApp

Public
Like
4
routineTrackerApp
Home
Code
9
backend
4
frontend
2
shared
2
.vtignore
AGENTS.md
RASPBERRY_PI_SETUP.md
README.md
deno.json
H
main.tsx
Environment variables
2
Branches
1
Pull requests
Remixes
2
History
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
2/16/2026
Viewing readonly version of main branch: v178
View latest version
README.md

Routine Tracker

Single-user routine checklist app for after-school tasks, with optional timers and per-action parent PIN checks.

Current architecture

  • main.tsx: HTTP entrypoint (export default app.fetch)
  • backend/index.ts: Hono app + routes + HTML bootstrap
  • backend/parentAuth.ts: parent PIN verification helpers
  • backend/schedule.ts: global routine schedule store + active routine calculation
  • backend/weather.ts: Open-Meteo fetch + cached "today" weather summary
  • frontend/index.html: app shell
  • frontend/index.tsx: React UI with boundary-driven refresh
  • shared/routines.ts: routine labels, task lists, and default schedule windows
  • shared/types.ts: shared TypeScript contracts

Parent PIN

Protected tasks require a 4-digit environment variable:

  • Env key: ROUTINE_PARENT_PIN
  • Value format: exactly 4 digits (example: 9854)

There is no parent unlock session. Each protected action requires entering the parent PIN.

Refresh interval (kiosk/dev)

The client does a coarse watchdog refresh on an interval controlled by:

  • Env key: ROUTINE_REFRESH_INTERVAL_SECONDS
  • Default: 1800 (30 minutes)
  • Valid range: 5 to 86400 seconds

Suggested values:

  • Development kiosk: 15 or 30
  • Stable display: 1800

When this heartbeat runs, the app also checks the deployed build ID and automatically reloads the page if code has changed.

Global schedule control

Routine timing is globally controlled by one Blob key:

  • Blob key: routine_schedule_config_v1
  • Default timezone: Asia/Tokyo
  • Default windows:
    • Morning: 06:30-08:30 (daily)
    • After school: 15:00-19:00 (Mon-Fri)
    • Bedtime: 20:00-21:30 (daily)

On first run, the app auto-creates this config if missing.

Smart freshness model (always-on display)

The UI does not poll every minute. It refreshes by:

  • scheduling one timer for nextChangeAt
  • re-syncing on visibilitychange, focus, and online
  • coarse 30-minute watchdog refresh

Weather uses a separate 30-minute refresh in the client and a 15-minute server cache in backend/weather.ts.

API routes

  • POST /api/parent/verify: verify parent PIN for a protected action
  • GET /api/routine/active: active routine, tasks, and next boundary
  • GET /api/routine/schedule: current global schedule config
  • GET /api/weather/today: today weather for Kyoto (current temp, high/low, sunrise/sunset, and next rain time/probability in the next 24 hours)
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.