โ Armadillo
Architecture
This document describes what Armadillo actually does today, grounded in the current code โ not the longer-term scaffolding roadmap (see the README for that list).
Overview
Armadillo is a single Go binary (cmd/api/main.go) that runs an HTTP API on :3001 by default (configurable via PORT). It currently implements one thing end to end: a JWT-based auth service that other containers in the deployment can sit behind.
cmd/api/main.go entrypoint โ wires config, token service, and HTTP handlers
lib/auth/
config.go env-driven config (demo credentials, JWT secret, token TTL)
token.go TokenService โ issues and verifies HS256 JWTs
handler.go HTTP handlers โ /api/auth/login, /logout, /me
HTTP surface
| Route | Method | Purpose |
|---|---|---|
/api/auth/login | POST | Verifies email/password against configured demo credentials (constant-time compare) and issues a signed JWT |
/api/auth/logout | POST | No-op 200 (tokens are stateless; nothing to invalidate server-side yet) |
/api/auth/me | GET | Verifies the Authorization: Bearer <token> header and returns the decoded claims (userId, role, scopeSpaceId) |
/health | GET | Liveness check |
/info | GET | Service name, commit hash, and build time (set via -ldflags at build time) |
Auth model
- Tokens are signed HS256 JWTs (
golang-jwt/jwt/v5), issued with anIssuerofarmadillo, a subject, arole, and an optionalscope_space_idclaim. - Credentials are currently a single configured demo account (
DEMO_EMAIL/DEMO_PASSWORDenv vars) โ there’s no user store or database yet. JWT_SECRETandDEMO_PASSWORDare required env vars (the process exits at startup if they’re unset);TOKEN_TTLdefaults to 86400 seconds.
Deployment
- Docker: multi-stage
Dockerfilebuilds a static binary into ascratchimage, exposing:8080. Build argsGIT_HASHandBUILD_TIMEget baked into/info. - docker-compose.yaml: runs Armadillo alongside Traefik, another service (
ibis), and annginxstatic file server on a sharedwebDocker network. This is the personal homelab deployment shape today โ there’s no notion yet of separate personal/experimental/production deployment tiers, though that’s on the roadmap. - Traefik:
traefik.d/service-armadillo.yamlandconfig/traefik/traefik.d/service-armadillo.yamlregister Armadillo as a Traefik service/router (routed onPathPrefix('/api')).traefik.d/service-ibis.yamlshows the intended pattern for gating other services: aforwardAuthmiddleware that callshttp://armadillo:8080/authbefore letting a request through toibis.
What isn’t implemented yet
Per the README’s original feature list, the following are aspirational and not present in the code today:
- Scaffolding a new service’s UI
- Importing an existing service into the stack
- Initializing CLI or workflow boilerplate for a new service
- Building/updating infra and opening PRs against a target repo
- Deployment-tier selection (personal / experimental / production) driving the deployment stack
- Migrations
Test coverage exists for the auth package (lib/auth/handler_test.go, lib/auth/token_test.go); there is no integration or end-to-end test suite yet.