guildhall/apps/guildhall_web/lib/guildhall_web_web/router.ex
Tyler J King c0959a5376 feat(guildhall): minimum viable guildhall — OIDC, guilds, schematics, members
Implements the full founding-guild onboarding stack across four phases:

Phase A — Keycloak OIDC auth pipeline (oidcc) + guild registration with
ceremony-engine approval (SingleApproval, hub operator approves via gRPC).
Phase B — Founding schematic templates (MSP/ISV/NSP TOML), gRPC clients
for ceremony-service and ffc-schematic-server, schematic fork/bind/realize
LiveView with DB audit trail in guild_schematics.
Phase C — RealizationPoller GenServer polling realization status every 5s,
PubSub broadcast, live realization dashboard showing 7 reconciler sections.
Phase D — Self-service member onboarding (join request → guild master
approval via ceremony), member management LiveView, auto-create guild
master on guild approval via Ecto.Multi transaction.

Includes K8s manifests for ceremony-service (port 50053) and
ffc-schematic-server (port 9091) as ClusterIP services, plus updated
guildhall deployment with OIDC and gRPC service URL env vars.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Tyler J King <tking@guildhouse.dev>
2026-05-15 15:03:50 -04:00

52 lines
1.6 KiB
Elixir

defmodule GuildhallWeb.Router do
use GuildhallWeb, :router
import GuildhallWeb.Plugs.Auth, only: [fetch_current_user: 2]
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_live_flash
plug :put_root_layout, html: {GuildhallWeb.Layouts, :root}
plug :protect_from_forgery
plug :put_secure_browser_headers
plug :fetch_current_user
end
pipeline :api do
plug :accepts, ["json"]
end
# Public auth routes (no auth required)
scope "/auth", GuildhallWeb do
pipe_through :browser
get "/login", AuthController, :login
get "/callback", AuthController, :callback
get "/logout", AuthController, :logout
end
# Authenticated LiveView routes
scope "/", GuildhallWeb do
pipe_through :browser
live_session :authenticated, on_mount: {GuildhallWeb.AuthHooks, :require_auth} do
live "/", DashboardLive, :index
live "/ceremonies", CeremonyLive.Index, :index
live "/artifacts", ArtifactLive.Index, :index
live "/guilds", GuildLive.Index, :index
live "/guilds/register", GuildLive.Register, :new
live "/guilds/:slug", GuildLive.Show, :show
live "/guilds/:slug/schematic", GuildLive.Schematic, :schematic
live "/guilds/:slug/realization", GuildLive.Realization, :realization
live "/guilds/:slug/join", GuildLive.Join, :join
live "/guilds/:slug/members", GuildLive.Members, :members
end
end
# Health check endpoint for Kubernetes probes + LB targets.
scope "/health", GuildhallWeb do
pipe_through :api
get "/", HealthController, :check
end
end