# Server Package This package implements the HTTP server for the member-console application, including HTMX partial handlers. ## Overview The server uses Go's standard `net/http` package with: - Bootstrap 5 for styling - HTMX 2.0 for dynamic content updates - gorilla/csrf for CSRF protection - gorilla/sessions for session management ## Architecture The HTTP server handles several types of requests: - **Static Files** (`/static/*`) - CSS, JS, images served from embedded assets - **Page Handlers** (`/`) - Full HTML page rendering - **Partial Handlers** (`/partials/*`) - HTMX partial HTML responses - **Auth Handlers** (`/login`, `/logout`, `/callback`) - OAuth2/OIDC authentication Partial handlers interact with Temporal workflows for async operations like site provisioning. ## Files - `server.go` - Main server setup, middleware chain, route registration - `fedwiki_partials.go` - HTMX partial handlers for FedWiki site management ## HTMX Integration ### Partial Handler Pattern Partial handlers return HTML fragments (not full pages) that HTMX swaps into the DOM: ```go // Handler returns HTML fragment func (h *Handler) GetSites(w http.ResponseWriter, r *http.Request) { // ... fetch data ... w.Header().Set("Content-Type", "text/html") h.Templates.ExecuteTemplate(w, "fedwiki_sites.html", data) } ``` ```html