Skip to content

Development - #1

Merged
mtsthibau merged 12 commits into
mainfrom
development
Aug 6, 2026
Merged

Development#1
mtsthibau merged 12 commits into
mainfrom
development

Conversation

@mtsthibau

@mtsthibau mtsthibau commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

📋 PR Description — developmentmain

## What

Complete architectural plan, documentation, engineering standards, CI/CD pipeline,
and development infrastructure for the HERMES frontend — preparing the monorepo for
Phase 1 development (Login + Shell foundation).

**20 new documents. 46 planned tasks. 3 independent reviews. 8 blockers resolved.**

---

## Architecture Decisions (9 ADRs)

| ADR | Decision |
|---|---|
| ADR-001 | Dual-mode API client: `@hermes/api/server` (SSR) + `@hermes/api/client` (browser) — explicit imports, no runtime detection |
| ADR-002 | Shared `WebSocketProvider` connecting to `hermes-radio-daemon` on `localhost:8081` with event-based subscriptions |
| ADR-003 | HttpOnly cookie auth (production) + localStorage (development) with single-flight token refresh mutex |
| ADR-004 | IndexedDB offline message queue with UUID idempotency (500 messages per conversation, 90-day eviction) |
| ADR-005 | Offline maps via PMTiles + MapLibre GL JS (zero external tile servers, 200MB local file on microSD) |
| ADR-006 | React Context + custom hooks for state management (no Redux, no Zustand) with `ServerState<T>` pattern |
| ADR-007 | nginx reverse proxy: `/` → shell, `/gps` → GPS, `/chat` → chat. Each app independently deployable. |
| ADR-008 | **sBitx canonical target**: Raspberry Pi 4 ARM64, 7-inch 800×480 touchscreen, Chromium kiosk, fully air-gapped, all services on `localhost` |
| ADR-009 | PWA for companion devices (Service Worker + Web App Manifest). Replaces Capacitor entirely. |

## Development Roadmap (3 Phases, 46 Tasks)

| Phase | Duration | Deliverable |
|---|---|---|
| **Phase 1** | Weeks 1–2 | Login, auth, app scaffolding, design system, CI/CD pipeline (17 tasks) |
| **Phase 2** | Weeks 3–5 | GPS viewer with offline map, real-time tracking, breadcrumbs (12 tasks) |
| **Phase 3** | Weeks 6–9 | Chat with offline queue, file uploads, encryption, radio info (17 tasks) |

## Independent Reviews Completed

| Review | Scope | Critical Findings |
|---|---|---|
| **HF Digital Specialist** | 10 architectural concerns validated against HF radio reality (Mercury 750bps throughput, store-and-forward model, propagation windows) | Rejected: typing indicators, presence indicators, 30MB file limits → 500KB. All addressed. |
| **Senior Project Reviewer** | 18 findings across architecture, security, testing, DevOps | 5 critical (no CD pipeline, no ARM64 cross-compile, no test coverage targets, API transport ambiguity, token refresh race). All addressed. |

## Engineering Infrastructure

-**`.github/workflows/ci.yml`** — PR CI: lint, typecheck, unit tests, build, E2E, bundle size
-**`.github/workflows/release.yml`** — ARM64 build → deploy to staging (main merge) → deploy to production (git tag)
-**`.github/pull_request_template.md`** — 12-item checklist (TypeScript, i18n, a11y, viewport testing, theme testing)
-**`.commitlintrc.json`** — Conventional Commits (10 types, 13 scopes)
-**`.prettierrc`** — With Tailwind CSS plugin
-**`packages/config/eslint/next.mjs`** — Strict rules: no-any, no-console, jsx-a11y, React performance, no-restricted-imports
-**`.env.example`** — All required variables for sBitx deployment

## 8 Blockers Resolved

1. `turbo.json` merge conflicts resolved
2. `package.json` missing scripts added (`dev:shell`, `dev:gps`, `dev:chat`, `typecheck`, `test`)
3. PoC apps excluded from npm workspaces (only final apps listed)
4. `pnpm-workspace.yaml` removed (npm workspaces only)
5. `commitlint` config created
6. `.prettierrc` created
7. ESLint config created with strict rules
8. Root `.env.example` created

## Files Changed

docs/
├── project-brief.md ← Executive summary
├── development-plan.md ← Full roadmap + workflow
├── adr/ ADR-001 through ADR-009 ← 9 architecture decisions
├── tasks/ phase-1/2/3.md ← 46 tasks with acceptance criteria
├── architecture/ frontend-overview.md ← System context, component tree, data flow
│ auth-flow.md ← Login, token refresh, cross-app auth
│ performance-expectations.md ← Memory/CPU/bundle budgets for sBitx
├── audit/ 2026-08-06-hf-digital-specialist-review.md
│ 2026-08-06-senior-reviewer-assessment.md
└── governance/ engineering-standards.md ← Code patterns, commits, PRs, testing

.github/
├── workflows/ ci.yml + release.yml
└── pull_request_template.md

.claude/agents/ 5 agent definitions

turbo.json ← Merge conflicts resolved
package.json ← Scripts fixed, PoC excluded
.env.example ← Created
.commitlintrc.json ← Created
.prettierrc ← Created


## How to Test

```bash
# Verify the plan is complete
ls docs/adr/ docs/tasks/ docs/architecture/ docs/audit/ docs/governance/

# Verify CI config
cat .github/workflows/ci.yml

# Read the development plan
cat docs/development-plan.md
cat docs/project-brief.md

Post-Merge

Phase 1 development begins. First task: docs/tasks/phase-1-shell-foundation-login.md → Task 1.1.0 — Configure sBitx viewport and design token constraints.


---

This is the PR description ready to paste into the GitHub PR. It covers all 9 commits, 20 new documents, 3 review reports, CI/CD setup, 8 resolved blockers, and the path forward for Phase 1 development.

mtsthibau added 12 commits April 8, 2026 13:36
…management

- Introduced `useSendMessage` hook for handling message sending with file upload support.
- Added `useStationAlias` hook to manage station aliases.
- Created `LocaleProvider` and `ThemeProvider` for managing application localization and theme settings.
- Implemented Tailwind CSS configuration for styling.
- Established TypeScript configuration for apps and packages.
- Added ESLint configuration for Next.js projects.
- Created utility functions for conversation and message handling in the `@platform/utils` package.
- Developed UI components including dialogs, banners, and input fields in the `@platform/ui` package.
- Set up workspace management with pnpm and Turbo for efficient development.
Covers all architectural decisions for the Hermes frontend:
- ADR-001: Dual-mode API client (server/client explicit imports)
- ADR-002: Shared WebSocket provider for radio-daemon
- ADR-003: HttpOnly cookie auth + single-flight token refresh
- ADR-004: IndexedDB offline message queue
- ADR-005: PMTiles + MapLibre GL JS for offline maps
- ADR-006: React Context + hooks state management
- ADR-007: nginx reverse proxy multi-app deployment
- ADR-008: sBitx canonical deployment target (Raspberry Pi, 7-inch touchscreen)
- ADR-009: PWA strategy for companion devices (replaces Capacitor)
Phase 1 (17 tasks): Shell, Foundation & Login — sBitx design tokens,
shared-auth package, app scaffolding, auth flow, PWA setup, CSP,
CI/CD pipeline, ARM64 cross-compilation, IndexedDB verification

Phase 2 (12 tasks): GPS Application — WebSocket provider,
offline map with PMTiles, real-time GPS tracking, breadcrumb trail

Phase 3 (17 tasks): Chat Application — messaging data layer,
message list/bubble/input, offline queue, file uploads, encryption,
radio info dashboard, station discovery
- Frontend overview: system context with sBitx as canonical target,
  component tree for all three apps, data flow diagrams (server state
  fetching, WebSocket events, offline queue), design decisions summary
- Auth flow: token lifecycle, login sequence diagram, auth provider
  state machine, cross-app auth (co-deployed + standalone + dev modes),
  token refresh with single-flight pattern, logout flow
- HF Digital Specialist review: 10 architectural concerns validated
  against HF radio reality (Mercury throughput, store-and-forward model,
  typing indicators rejected, presence indicators rejected,
  file size limits corrected to 500KB, Docker dev-only confirmed)
- Senior Project Reviewer assessment: 18 findings across architecture,
  security, testing, DevOps — 5 critical, 2 high-severity.
  All findings addressed in updated ADRs and task lists
Defines all code patterns and conventions for the project:
- Commit conventions (Conventional Commits with 10 types, 13 scopes)
- Branch strategy (feature/fix/a11y/perf/refactor/docs/chore)
- Pull request conventions (template, 12-item checklist, review requirements)
- Code patterns (component, hook, API route, design tokens, i18n, a11y)
- Directory structure conventions (apps/, packages/, naming)
- TypeScript standards (strict mode, forbidden patterns)
- Testing standards (coverage targets per module type)
- ESLint configuration (no-any, no-console, jsx-a11y, performance)
- Anti-patterns: 10 explicit do-not-carry-forward rules from PoC
- Project brief: executive summary — what HERMES is, what we're building,
  architecture diagram, key decisions, technology stack, repository structure
- Development plan: 3-phase roadmap (9 weeks, 46 tasks), fully automated
  workflow diagram (5 manual steps), branch strategy, quick start guide
- CI pipeline: lint, typecheck, unit tests, build, E2E, bundle size check
- Release pipeline: ARM64 cross-compilation, staging auto-deploy (main),
  production deploy (git tags), rollback support
- PR template: 12-item checklist covering TypeScript, i18n, a11y, testing
- Frontend Architect, Project Manager, HF Digital Specialist,
  and Senior Reviewer agent definitions
- turbo.json: resolve merge conflicts, add typecheck + test tasks
- package.json: add dev:shell, dev:gps, dev:chat, typecheck, test scripts
- package.json: exclude PoC apps from workspaces (only final apps)
- .env.example: create with all required variables for sBitx deployment
- .commitlintrc.json: enforce Conventional Commits (10 types, 13 scopes)
- .prettierrc: add with Tailwind CSS plugin
- packages/config/eslint/next.mjs: add strict rules (no-any, no-console,
  jsx-a11y, react performance, no-restricted-imports)
- Remove pnpm-workspace.yaml (using npm workspaces only)
Defines concrete performance targets for the sBitx deployment:
- Memory budget: per-process targets (shell 0MB static, GPS 80MB, Chat 80MB,
  Chromium 350MB). System-level budget for 2GB and 4GB Pi.
- CPU targets: startup times (login <2s, GPS map <3s, chat load <2s),
  interaction latency (touch <100ms, scroll 60fps, message send <500ms)
- Bundle size budgets: shell <100KB JS, GPS <200KB, chat <250KB gzipped
- MapLibre GPU rendering: 30fps at zoom 10-14 on VideoCore VI, tile cache limits
- DOM node budget: <5,000 nodes per page, lazy pagination keeps it bounded
- Cold boot sequence: power-on to GPS map visible in ~26 seconds
- Load scenarios: GPS+Chat simultaneous, 10k-message conversation, high zoom map
- Performance testing checklist per phase with specific measurements
- Explicitly documents what we DON'T optimize: SSR, SW caching, virtual scrolling,
  Web Workers, CDN (not relevant for localhost-only deployment)
@mtsthibau
mtsthibau merged commit dde5b62 into main Aug 6, 2026
0 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant