Skip to main content

Gateway Architecture

This document covers the internal architecture of the Gateway service, including the middleware stack, handler organization, and request lifecycle.

Component Overview

Middleware Stack

Middleware is applied in order, each adding functionality:

Middleware Files

Handler Organization

Handlers are organized by domain, each handling a specific resource type:

Handler Files

Request Lifecycle

Standard Request Flow

Authentication Flow

gRPC Client

The wallet client wraps gRPC calls to wallet-core:

Route Registration

Routes are registered in cmd/server/main.go:

Error Handling

Standard Error Response

gRPC Error Mapping

Configuration Loading

Next Steps

Authentication

Detailed auth configuration

Configuration

config.yaml reference