chore: cleanup TypeScript, update docs, scripts, Dockerfile

- Delete all frontend TypeScript source (src/, index.html, package.json, etc.)
- Move static assets to frontend/static/ (style.css, manifest.json)
- Update scripts/build and scripts/test (no npm steps)
- Update Dockerfile (no frontend build step)
- Update README.md and AGENTS.md for Hyperbole stack
This commit is contained in:
2026-07-16 06:51:11 -04:00
parent a717d619d3
commit 1d5ecd0829
14 changed files with 115 additions and 1831 deletions
+46 -36
View File
@@ -2,8 +2,8 @@
## Project Overview
Sis is a shared household chore/task tracker with a Haskell backend and
TypeScript/Mithril.js SPA frontend.
Sis is a shared household chore/task tracker written entirely in Haskell using
Hyperbole, a serverside web framework. There is zero application JavaScript.
## Build & Tooling
@@ -12,7 +12,7 @@ TypeScript/Mithril.js SPA frontend.
`hpack`, `fourmolu`, `hlint`.
- **Build script:** `./scripts/build` — formats (fourmolu), lints (hlint),
builds with stack, copies binary to `build/`.
- **Test script:** `./scripts/test` fourmolu check, hlint, `stack test`.
- **Test script:** `./scripts/test` — hlint, `stack test`.
- **Run script:** `./scripts/run` — starts server in Docker via `stack exec`.
- **hpack:** `package.yaml` is the source of truth for dependencies. After
editing it, run `./hs hpack` to regenerate `sis-server.cabal`. (If `hpack`
@@ -20,53 +20,63 @@ TypeScript/Mithril.js SPA frontend.
## Haskell Conventions
- **Style:** fourmolu-formatted. The `./scripts/test` script checks this.
Run `./hs fourmolu --mode inplace app/ src/ test/` before committing.
- **Style:** fourmolu-formatted. Run `./hs fourmolu --mode inplace app/ src/ test/` before committing.
- **Lint:** hlint clean required. Fix any hints before committing.
- **Warnings:** `-Wall -Werror` in `package.yaml`. All warnings are fatal.
- **Module qualifiers:** Use qualified imports with descriptive aliases
(e.g., `import Data.Text qualified as T`).
- **JSON:** Aeson instances live in the same module as the types they
serialize (`Sis.Types`).
- **Architecture:** The backend uses [Orb](https://github.com/flipstone/orb)
for HTTP routing (`Sis.Server`), with WAI/Warp underneath. Route types
(like `HealthCheck`) implement `Orb.HasHandler`.
- **Architecture:** The backend uses [Hyperbole](https://github.com/seanhess/hyperbole)
for serverside HTML rendering and interactivity via WebSocket. Pages are
Haskell functions returning `Page es '[ViewId]`, with interactive components
as `HyperView` instances.
- **Database:** Custom `effectful` `DB` effect in `Sis.Database`. All DB
operations go through the effect (use the lowercase convenience functions
like `findUserByEmail`, not the raw constructors).
## Frontend Conventions
- **SPA framework:** [Mithril.js](https://mithril.js.org/) v2 with TypeScript.
- **CSS:** [Neo Brutalism](https://unpkg.com/neobrutalismcss@latest) CDN.
- **Build:** `npm run build` (or `cd frontend && npx tsc` for dev).
- **API client:** Thin fetch wrapper in `frontend/src/api.ts`. Base path `/api`.
- **Dev server:** `npm run serve` serves the built frontend on port 5000.
- **Framework:** [Hyperbole](https://github.com/seanhess/hyperbole) — Haskell
serverside web framework. All HTML rendered in Haskell.
- **CSS:** [Neo Brutalism](https://unpkg.com/neobrutalismcss@latest) CDN +
`frontend/static/style.css` for custom styles.
- **Build:** No npm/build step for frontend. All pages rendered in Haskell.
- **Interactive components:** HyperViews with typed Actions and server-side
updates via VirtualDOM over WebSocket.
## Project Structure
```
sis/
├── app/Main.hs # Server entry point, CLI options, Warp setup
├── app/Main.hs # Hyperbole app entry, Warp setup, route dispatch
├── src/
│ ├── Sis.hs # Top-level re-exports
│ ├── Sis/Server.hs # Orb HTTP routes, WAI app, SPA serving
│ ├── Sis/Types.hs # Core domain types (Task, User, etc.)
── Sis/Database.hs # SQLite connection management
├── test/Spec.hs # Hspec test suite
│ ├── Sis.hs # Top-level re-exports
│ ├── Sis/Route.hs # Route ADT with Route instance
│ ├── Sis/Types.hs # Core domain types
── Sis/Database.hs # effectful DB effect, SQLite operations
│ ├── Sis/Auth.hs # Password hashing
│ ├── Sis/Page/
│ │ ├── Login.hs # Login page
│ │ ├── Signup.hs # Signup page
│ │ ├── Dashboard.hs # Dashboard with stats + due/completed items
│ │ ├── Chores.hs # Chore list + create/edit form
│ │ ├── Household.hs # Members, invites, household management
│ │ └── Activity.hs # Activity log with pagination
│ ├── Sis/View/
│ │ └── Layout.hs # Shell: document head, navbar, page wrapper
│ └── Sis/Style.hs # Neo Brutalism class helpers
├── frontend/
── src/
├── index.ts # Mithril mount point
── api.ts # Backend API client
│ │ └── components/ # Mithril components
│ └── public/style.css
── static/
├── style.css # Custom CSS
── manifest.json # PWA manifest
├── test/Spec.hs # Hspec test suite
├── docs/
│ ├── specs/ # Design specs
│ └── plans/ # Implementation plans
├── scripts/ # build, test, run
├── package.yaml # Haskell deps (hpack source of truth)
├── sis-server.cabal # Generated by hpack
├── stack.yaml # Stack resolver config
── docker-compose.yml # Deployment stack
├── Dockerfile # Production image
└── FEATURES.org # Feature roadmap
│ ├── specs/ # Design specs
│ └── plans/ # Implementation plans
├── scripts/ # build, test, run
├── package.yaml # Haskell deps (hpack source of truth)
├── sis-server.cabal # Generated by hpack
├── stack.yaml # Stack resolver config
── Dockerfile # Production image
```
## Commit Style
@@ -76,5 +86,5 @@ sis/
- Run `./scripts/test` before committing. Tests must pass.
## Agent Autonomy
- As changes are completed then verify functionality using Playwright
- As changes are completed then verify functionality using Playwright
- Once functionality is confirmed then commit and push changes