How raystack/frontier works
Main Components Overview
a. Client Interface Layer:
• HTTP/gRPC API Gateway
• CLI Interface
• React-based Admin UI (found in /ui directory)
• JavaScript SDK (found in /sdks/js)
b. Core Services Layer:
• Authentication Service (core/authenticate)
• Authorization Service (core/policy, core/permission)
• Organization Management (core/organization)
• User Management (core/user)
• Project Management (core/project)
• Billing Management (billing/*)
• Audit Service (core/audit)
• Event Service (core/event)
c. Storage Layer:
• PostgreSQL Database (internal/store/postgres)
• SpiceDB (internal/store/spicedb)
• Blob Storage (internal/store/blob)
Interaction Flows
a. External Interactions:
• Client requests → API Gateway
• Authentication flows with external IDPs
• Billing integration with payment providers
b. Internal Flows:
• Authentication → Authorization
• Event publishing between services
• Audit logging flows
• Data persistence flows
Key Architectural Patterns
• Service-oriented architecture with clear domain boundaries
• Event-driven communication between services
• Repository pattern for data access
• Middleware chain for request processing
Component Details
For each major component, include:
• Service name
• Key responsibilities
• External dependencies
• API endpoints (if applicable)
Specific Implementation Notes
Important implementation details:
• Authentication strategies (Email OTP, Social Login, API keys, JWT)
• Role-based access control flow
• Billing and subscription management
• Audit logging mechanism
Cross-Cutting Concerns
How these aspects interact with all components:
• Configuration management
• Error handling
• Logging
• Metrics collection
Remember to emphasize the multi-tenant nature of the system and how organization/project boundaries are maintained throughout the architecture. This is particularly important given Frontier's role as an identity and access management tool serving multiple organizations and projects.