How metavert-io/lastsaas works
LastSaaS is a Go and React SaaS foundation. The main user workflow runs from browser sign-in and tenant selection through protected application or admin features, which call the backend API. The product also provides billing and entitlements, tenant and user administration, branding, webhooks, telemetry and analytics, health and financial dashboards, and CLI/MCP operations. Frontend routing and several context/API interactions are evidenced in excerpts; many backend and feature-specific connections are based on README capabilities and remain unverified.
Main entry points: handlers Product API handlers · client.ts REST API client · App.tsx Route application · main.go HTTP server
Components 22
Frontend experience
- Route application
frontend/src/App.tsx - Authentication screens
frontend/src/pages/auth - Auth session
frontend/src/contexts/AuthContext.tsx - Tenant context
frontend/src/contexts/TenantContext.tsx - REST API client
frontend/src/api/client.ts - Customer workspace
frontend/src/pages/app - Admin console
frontend/src/pages/admin - Branding context
frontend/src/contexts/BrandingContext.tsx - Theme preferences
frontend/src/contexts/ThemeContext.tsx
Backend services
- HTTP server
backend/cmd/server/main.go - Auth endpoints
backend/internal/api/handlers/auth.go - Product API handlers
backend/internal/api/handlers - Tenant and RBAC
backend/internal/middleware - Telemetry analytics
backend/internal/telemetry/service.go - Webhook delivery
backend/internal/webhooks/dispatcher.go - MongoDB data
backend/internal/db/mongodb.go
Operations and integrations
- Stripe billing
backend/internal/stripe/stripe.go - Email delivery
backend/internal/email/resend.go - Health monitoring
backend/internal/health - Admin CLI and MCP
backend/cmd/lastsaas - External services
Other components
- SaaS user
Connections 28
- SaaS user → Route application: opens
frontend/src/App.tsx - Route application → Authentication screens: routes
frontend/src/App.tsx - Route application → Customer workspace: routes
frontend/src/App.tsx - Route application → Admin console: routes
frontend/src/App.tsx - Authentication screens → Auth session: uses session
frontend/src/pages/auth/AuthCallbackPage.tsx - Auth session → REST API client: calls auth
frontend/src/contexts/AuthContext.tsx - Tenant context → Auth session: reads memberships
frontend/src/contexts/TenantContext.tsx - Tenant context → REST API client: sets tenant header
frontend/src/contexts/TenantContext.tsx - Customer workspace → REST API client: requests data
frontend/src/pages/app/settings/SessionsTab.tsx - Admin console → REST API client: requests data
frontend/src/pages/admin/PlansPage.tsx - Branding context → REST API client: loads branding
frontend/src/contexts/BrandingContext.tsx - Theme preferences → REST API client: updates preference
frontend/src/contexts/ThemeContext.tsx - REST API client → HTTP server: sends API requests
- HTTP server → Auth endpoints: routes requests
- HTTP server → Product API handlers: routes requests
- Auth endpoints → Tenant and RBAC: enforces access
- Product API handlers → Tenant and RBAC: enforces access
- Auth endpoints → MongoDB data: reads and writes
- Product API handlers → MongoDB data: reads and writes
- Product API handlers → Stripe billing: handles billing
- Product API handlers → Email delivery: sends messages
- Product API handlers → Webhook delivery: dispatches events
- Product API handlers → Telemetry analytics: records events
- Health monitoring → MongoDB data: checks metrics
- External services → Stripe billing: provides billing
- External services → Email delivery: provides delivery
- Webhook delivery → External services: sends webhooks
- Admin CLI and MCP → HTTP server: administers