Appearance
Reference architecture
Gatelin is the entry point of a three-service stack. It authenticates callers and proxies to Megadex (users) and Foxnox (credentials), which in turn call each other directly.
┌─────────────────────────────────────────────────┐
│ Reverse Proxy │
│ (Traefik) │
│ http://your-domain.com │
└────────────┬─────────────────────┬───────────────┘
│ │
┌─────────▼─────────┐ ┌────────▼──────────┐
│ Admin Panels │ │ Gatelin │
│ (Angular) │ │ BFF /api/* │
└───────────────────┘ └────────┬──────────┘
│ internal network only
┌──────────────────────┼──────────────────────┐
│ │ │
┌────────▼──────────┐ │ ┌────────▼──────────┐
│ Megadex │◄──────────┴─────────────┤ Foxnox │
│ /megadex │ USER_SEARCH_URL │ /foxnox /web │
│ (Node.js) ├────────────────────────►│ (Node.js) │
└────────┬──────────┘ PWD_CREATE_URL └────────┬──────────┘
│ │
┌────────▼──────────┐ ┌────────▼──────────┐
│ PostgreSQL │ │ PostgreSQL │
│ (megadex DB) │ │ (foxnox DB) │
└───────────────────┘ └───────────────────┘Each service owns its own database and knows the others only by HTTP contract.
| Service | Owns | Never does |
|---|---|---|
| Gatelin | Sessions, JWTs, routes, roles, permissions, CORS | Store password hashes or user profiles |
| Megadex | Users, role assignment, social links, preferences, lookups | Store credentials or issue sessions |
| Foxnox | Password hashes, 2FA, tokens, trusted devices, workflow pages | Mint JWTs or store user profiles |
Users are identified by email at the edge and by numeric userId everywhere else. Megadex is the only place that translates one into the other.
Sign-in
Account creation
Password recovery
Who calls whom
| Caller | Callee | Variable | Purpose |
|---|---|---|---|
| Gatelin | Megadex | USER_SEARCH_URL | Resolve email to userId at login |
| Gatelin | Foxnox | PWD_CHECK_URL | Verify the password |
| Gatelin | Foxnox | PWD_CHALLENGES_URL, PWD_TRUSTED_DEVICES_URL, PWD_LOGIN_TICKET_URL | Mid-login 2FA and expired-password steps |
| Foxnox | Megadex | USER_SEARCH_URL | Resolve email in recovery, unlock and 2FA recovery |
| Megadex | Foxnox | PWD_CREATE_URL | Create a password on user creation, archive it on user archival |
| Gatelin | Megadex, Foxnox | Route and permission seeds | Proxy admin and self-service traffic with consumer and ACL headers |
Boundaries to keep in mind
- Trust: Megadex and Foxnox trust Gatelin's
x-consumer-*andx-acl-*headers, so only Gatelin (and each other) may reach their ports. Neither should have a public router. - Sessions: Gatelin owns session state. Role changes or archival in Megadex take effect only when the access token expires or refresh fails. Nothing pushes a revocation.
- Coupling: creating a user in Megadex fails, and rolls back by archiving, if Foxnox is down. Gatelin sign-in fails if Megadex or Foxnox is unreachable.
- Optional: each service works with other implementations of the same HTTP contract. A custom BFF, user service or credential store can replace any one of the three.