How toinbox/simplerelay works
SimpleRelay is a self-hosted, multi-tenant SMTP relay with a React dashboard and FastAPI control plane. Users register and verify accounts, configure upstream providers and allowed clients, then send mail through Postfix, which routes by sender to an upstream SMTP account; the dashboard exposes logs and health. Admins manage users, proxies, provider-type limits, and relay status. The graph combines sampled call/import evidence with README-documented runtime behavior; unsampled subsystem links are omitted where their callers could not be confirmed.
Main entry points: App.jsx Dashboard app and routes · api.js Authenticated API client · database.py Database access and initialization · providers.py Provider management API
Components 34
Web dashboard
- Dashboard app and routes
frontend/src/App.jsx - Authenticated API client
frontend/src/api.js - Provider management
frontend/src/pages/Providers.jsx - Setup wizard
frontend/src/pages/Wizard.jsx - User dashboard
frontend/src/pages/Dashboard.jsx - Mail logs
frontend/src/pages/Logs.jsx - Access control UI
frontend/src/pages/Clients.jsx - User administration
frontend/src/pages/AdminUsers.jsx - Proxy administration
frontend/src/pages/AdminProxies.jsx - Provider limits UI
frontend/src/pages/AdminLimits.jsx - Admin mail logs
frontend/src/pages/AdminLogs.jsx
API and account management
- Registration and authentication
backend/routers/auth.py - Provider management API
backend/routers/providers.py - Allowed-client API
backend/routers/clients.py - Admin API
backend/routers/admin.py - Dashboard data API
backend/routers/dashboard.py - FastAPI application
backend/main.py - JWT and password auth
backend/services/auth.py - Verification email delivery
backend/services/email_sender.py - Provider detection and presets
backend/services/provider_presets.py - DNS validation
backend/services/dns_checker.py - Credential encryption
backend/services/crypto.py
SMTP relay
- Postfix configuration
backend/services/postfix_config.py - Relay access policy
backend/services/access_server.py
Persistence and monitoring
- PostgreSQL
- Relay domain models
backend/models.py - Database access and initialization
backend/database.py - Mail log service
backend/services/mail_logger.py - Provider health checks
backend/services/health_checker.py - Relay expiry checks
backend/services/expiry_checker.py
Other components
- Relay user
- Administrator
- Sending application
- Upstream SMTP
Connections 48
- Relay user → Dashboard app and routes: uses dashboard
- Administrator → Dashboard app and routes: uses admin panel
- Dashboard app and routes → Provider management: routes to
frontend/src/App.jsx - Dashboard app and routes → Setup wizard: routes to
frontend/src/App.jsx - Dashboard app and routes → User dashboard: routes to
frontend/src/App.jsx - Dashboard app and routes → Mail logs: routes to
frontend/src/App.jsx - Dashboard app and routes → Access control UI: routes to
frontend/src/App.jsx - Dashboard app and routes → User administration: routes to
frontend/src/App.jsx - Dashboard app and routes → Proxy administration: routes to
frontend/src/App.jsx - Dashboard app and routes → Provider limits UI: routes to
frontend/src/App.jsx - Dashboard app and routes → Admin mail logs: routes to
frontend/src/App.jsx - Provider management → Authenticated API client: calls
frontend/src/pages/Providers.jsx - Setup wizard → Authenticated API client: calls
frontend/src/pages/Wizard.jsx - User dashboard → Authenticated API client: calls
frontend/src/pages/Dashboard.jsx - Mail logs → Authenticated API client: calls
frontend/src/pages/Logs.jsx - Access control UI → Authenticated API client: calls
frontend/src/pages/Clients.jsx - User administration → Authenticated API client: calls
frontend/src/pages/AdminUsers.jsx - Proxy administration → Authenticated API client: calls
frontend/src/pages/AdminProxies.jsx - Provider limits UI → Authenticated API client: calls
frontend/src/pages/AdminLimits.jsx - Admin mail logs → Authenticated API client: calls
frontend/src/pages/AdminLogs.jsx - Authenticated API client → FastAPI application: sends API requests
- FastAPI application → Database access and initialization: initializes
backend/main.py - FastAPI application → Registration and authentication: registers routes
backend/main.py - FastAPI application → Provider management API: registers routes
backend/main.py - FastAPI application → Allowed-client API: registers routes
backend/main.py - FastAPI application → Dashboard data API: registers routes
backend/main.py - FastAPI application → Admin API: registers routes
backend/main.py - Registration and authentication → JWT and password auth: authenticates users
backend/routers/auth.py - Registration and authentication → Verification email delivery: sends verification mail
backend/routers/auth.py - Provider management API → Provider detection and presets: uses provider presets
backend/routers/providers.py - Provider management API → DNS validation: validates DNS
backend/routers/providers.py - Provider management API → Credential encryption: encrypts credentials
backend/routers/providers.py - Provider management API → Postfix configuration: updates relay config
backend/routers/providers.py - Allowed-client API → Postfix configuration: reloads policy config
backend/routers/clients.py - Admin API → Credential encryption: tests encrypted credentials
backend/routers/admin.py - Database access and initialization → Relay domain models: creates model tables
backend/database.py - Database access and initialization → PostgreSQL: stores records
backend/database.py - JWT and password auth → Database access and initialization: queries users
backend/services/auth.py - Provider management API → Database access and initialization: reads and writes providers
backend/routers/providers.py - Allowed-client API → Database access and initialization: reads and writes clients
backend/routers/clients.py - Admin API → Database access and initialization: manages admin data
backend/routers/admin.py - Dashboard data API → Database access and initialization: queries dashboard data
backend/routers/dashboard.py - Relay user → Sending application: configures relay
- Sending application → Postfix configuration: submits SMTP mail
- Postfix configuration → Upstream SMTP: routes by sender
- Postfix configuration → Relay access policy: checks relay access
- Relay access policy → Database access and initialization: checks allowed clients
backend/services/access_server.py - Provider management API → Provider health checks: requests health checks
backend/routers/providers.py