11 Commits

Author SHA1 Message Date
jbrechtel 1c19d97dc8 feat: add Playwright e2e smoke test covering signup → household → chore flow
- Added smoke.spec.js with Playwright test for full user flow:
  1. Sign up (fill form, submit, click 'Go to Dashboard')
  2. Create household (fill name, submit)
  3. Create chore (fill name + date, submit)
  4. Verify session persistence (revisit dashboard)
- Server now supports --db flag for temp databases and SIS_FRESH_DB env
  to delete the db file on startup (for clean test runs)
- Server reads SIS_PORT env var for port configuration
- scripts/test-e2e: starts server with fresh db, runs tests, cleans up
- playwright.config.js: minimal config pointing at test/e2e/
2026-07-16 10:01:33 -04:00
jbrechtel 456eae4717 fix: login/signup flow working with session-based auth
- Fixed hashPasswordIO to use real PBKDF2 hashing from Sis.Auth
- Added seed route (rseed) for demo data initialization
- Replaced redirect() in update functions with success views
  (redirect uses throwError_ which broke with effectful 2.4)
- Added loginSuccessView and signupSuccessView with dashboard links
- Patched Hyperbole Socket.hs to parse WebSocket form body into Form params
- Patched Hyperbole Wai.hs to include TargetViewId in response metadata
- Fixed View/Page type mismatches (hyper wrapper vs plain view)
- Removed dead pure after redirect calls
- Verified: login submits, session set, success view rendered
2026-07-16 07:27:31 -04:00
jbrechtel a99c239852 fix: add static file serving with custom middleware
- Replaced wai-app-static with lightweight inline static file server
- Static files served from frontend/static/ under /static/ path
- Fixed ByteString/FilePath type mismatches for GHC 9.10
- Verified: CSS, manifest, login, signup, dashboard all HTTP 200
2026-07-16 07:00:41 -04:00
jbrechtel df9ad3d7c4 fix: rename route constructors to avoid type conflicts
- Renamed route constructors: RouteLogin → RLogin, RouteDashboard → RDashboard, etc.
- This fixes ambiguous occurrence errors with Types.Dashboard vs Route.Dashboard
- Fixed Layout.hs navbar links to use new constructor names
- Server verified serving HTML on /login, /rdashboard, etc.
2026-07-16 06:54:18 -04:00
jbrechtel a717d619d3 feat: Hyperbole port compiles and builds successfully
- All page modules now use proper Page es '[ViewId] type with hyper embedding
- Fixed view DSL: tag calls, String/Text conversions, polymorphic context types
- DB effect uses convenience wrappers (lowercase) with send
- HyperView instances have DB :> es, IOE :> es constraints
- Main.hs uses liveAppWith with proper router
- Static file serving deferred (will use nginx or wai-app-static)
- Warning suppressions added where needed
- Build produces working 25MB sis-server binary
2026-07-16 06:50:20 -04:00
jbrechtel 7eaf6ab7e7 feat: Hyperbole port - all modules created, Database effect working
- Database.hs: effectful DB effect with all operations + convenience wrappers
- Types.hs: stripped Aeson (kept ToJSON/FromJSON on IDs), added form types
- Route.hs, Style.hs, View/Layout.hs: support modules
- All Page modules: Login, Signup, Dashboard, Chores, Household, Activity
- Main.hs: Hyperbole app entry point with router
- Known issue: Hyperbole view DSL syntax needs cleanup in page modules
  (tag calls need $ none suffix, form elements need field wrappers)
2026-07-16 06:38:34 -04:00
jbrechtel b4e47b652f WIP: backend auth/chores/households work and frontend styling 2026-07-15 21:20:57 -04:00
jbrechtel d4f839c491 feat: add SQLite database support
- Add sqlite-simple dependency
- Create Sis.Database module with openDatabase (creates parent dir, enables WAL + FK)
- Add --db-path CLI option (default data/sis.db)
- Format all Haskell sources with fourmolu
- Fix hlint suggestions in Sis.Server
2026-07-15 15:57:44 -04:00
jbrechtel 715889a72a feat: add --db-path CLI option and open SQLite db on startup 2026-07-15 15:55:54 -04:00
jbrechtel 72b1ee1d3d Add SPA static file serving from backend
Backend (Server.hs):
- serveStaticOrSpa: serves static files from --static-dir
- SPA fallback: extensionless paths serve index.html
- MIME type mapping for html/css/js/png/svg/ico/woff2

Frontend:
- ES module imports with import map for Mithril CDN
- Build script: tsc + copy index.html + static assets

CLI:
- --static-dir flag (default: frontend/dist)
- scripts/run passes through extra args
- Dockerfile CMD points at /usr/local/share/sis/static
2026-07-15 14:59:31 -04:00
jbrechtel 72d94170b4 Initial project skeleton
Haskell backend: Orb HTTP framework, JSON-only API
Frontend: Mithril.js SPA with TypeScript, Neo Brutalism CSS
Dockerized build via flipstone/haskell-tools image

Routes:
  GET /api/health — health check

Build: ./hs stack build
Test:  ./hs stack test
Run:   ./scripts/run
2026-07-15 14:51:27 -04:00