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
This commit is contained in:
2026-07-16 06:50:20 -04:00
parent c45ae41645
commit a717d619d3
9 changed files with 62 additions and 49 deletions
+5 -5
View File
@@ -32,9 +32,9 @@ instance (DB :> es, IOE :> es) => HyperView LoginPage es where
| verifyPassword (lfPassword formData') (userPasswordHash u) -> do
saveSession (UserSession (unUserId (userId u)))
redirect (routeUri RouteDashboard)
pure (el "Redirecting...")
pure $ hyper LoginPage $ el "Redirecting..."
_ -> pure (loginView (Just "Invalid email or password"))
update Noop = pure (loginView Nothing)
update Noop = pure $ hyper LoginPage $ loginView Nothing
loginView :: Maybe Text -> View LoginPage ()
loginView mError = do
el @ att "class" nbContainerClass @ att "style" "max-width:480px;margin:4rem auto" $ do
@@ -55,11 +55,11 @@ loginView mError = do
text "Remember me"
submit (text "Log In") @ att "class" nbButtonClass @ att "style" "width:100%"
route RouteSignup $ text "Don't have an account? Sign Up"
page :: (Hyperbole :> es, DB :> es) => Eff es (View LoginPage ())
page :: (Hyperbole :> es, DB :> es, IOE :> es) => Page es '[LoginPage]
page = do
mSession <- lookupSession @UserSession
case mSession of
Just _ -> do
redirect (routeUri RouteDashboard)
pure (el "Redirecting...")
Nothing -> pure (loginView Nothing)
pure $ hyper LoginPage $ el "Redirecting..."
Nothing -> pure $ hyper LoginPage $ loginView Nothing