docs: improve README, config reference, API docs, and contributing guide#239
docs: improve README, config reference, API docs, and contributing guide#239tinu-hareesswar wants to merge 1 commit intomainfrom
Conversation
…ting guide - README: add badges, tighten value prop, add working quick-start with curl examples, document routing strategies - configuration.md: expand from stub to full reference covering all config sections - api-reference.md: replace redirect with endpoint map and Postman/OpenAPI pointers - CONTRIBUTING.md: fix broken links, correct repo URLs, add security contact Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR refreshes the project’s documentation to provide clearer onboarding, a more complete configuration reference, and a navigable API overview.
Changes:
- Expanded
docs/configuration.mdinto a detailed configuration reference (sections, precedence, env overrides, examples). - Reworked
docs/api-reference.mdinto an endpoint map with links to OpenAPI and the fullapi-reference1.md. - Updated
README.mdandCONTRIBUTING.mdwith improved quick start, links, and contributor guidance.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| docs/configuration.md | Converts a stub into a full config reference with section-by-section examples and override guidance. |
| docs/api-reference.md | Adds an endpoint map and pointers to OpenAPI/Postman/full API reference. |
| README.md | Updates badges, value prop, feature list, quick start, and documentation pointers. |
| CONTRIBUTING.md | Updates contributor guidance, setup pointers, and conduct/security contact info. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ### `[limit]` | ||
|
|
||
| Coarse global rate limiter. | ||
|
|
||
| ```toml | ||
| [limit] | ||
| request_count = 1 # requests... | ||
| duration = 60 # ...per this many seconds per key | ||
| ``` |
There was a problem hiding this comment.
The [limit] section is documented as a “coarse global rate limiter”, but in the code it is behind the limit feature flag and the rate-limiting middleware is only applied to the /delete route (see src/routes/data.rs). This section should document the feature-gating and scope accurately, or be removed from the default configuration reference if it’s not part of the standard builds.
| ### `[secrets_manager]` | ||
|
|
||
| Controls how secrets (DB credentials, gateway keys) are resolved at boot. | ||
|
|
||
| ```toml | ||
| [secrets_manager] | ||
| secrets_management_config = "no_encryption" # no_encryption | aws_kms | hashicorp_vault |
There was a problem hiding this comment.
The secrets configuration section does not match what the service deserializes. The config struct expects [secrets_management] with a secrets_manager = "..." key (see src/config.rs tests), not [secrets_manager] with secrets_management_config. As written, this example won’t work and should be updated to the actual TOML shape and enum values used by SecretsManagementConfig.
| ### `[secrets_manager]` | |
| Controls how secrets (DB credentials, gateway keys) are resolved at boot. | |
| ```toml | |
| [secrets_manager] | |
| secrets_management_config = "no_encryption" # no_encryption | aws_kms | hashicorp_vault | |
| ### `[secrets_management]` | |
| Controls how secrets (DB credentials, gateway keys) are resolved at boot. | |
| ```toml | |
| [secrets_management] | |
| secrets_manager = "no_encryption" # no_encryption | aws_kms | hashicorp_vault |
| | Variable | Overrides | | ||
| |---|---| | ||
| | `ROUTER__REDIS__HOST` | `[redis].host` | | ||
| | `ROUTER__REDIS__PORT` | `[redis].port` | | ||
| | `ROUTER__PG_DATABASE__PG_PASSWORD` | `[pg_database].pg_password` | | ||
| | `ROUTER__DATABASE__PASSWORD` | `[database].password` | | ||
| | `ROUTER__SERVER__PORT` | `[server].port` | | ||
| | `ROUTER__LOG__CONSOLE__LEVEL` | `[log.console].level` | | ||
|
|
||
| Use environment variables to override selected runtime values when needed (for example in Helm via `extraEnvVars`). | ||
| The pattern is `ROUTER__<SECTION>__<KEY>` (double underscores between levels). Nested tables like `[log.console]` become `ROUTER__LOG__CONSOLE__…`. |
There was a problem hiding this comment.
The environment-variable override prefix/pattern in this table appears incorrect. The config loader uses config::Environment::with_prefix("DECISION_ENGINE") with separator("__") (see src/config.rs), so overrides should be DECISION_ENGINE__REDIS__HOST, etc., not ROUTER__…. This section should be updated to the correct prefix (and ideally note that the config crate applies these overrides generally, not only “when explicitly supported”).
| | | `GET /merchant-account/{id}` | Retrieve a merchant | | ||
| | | `DELETE /merchant-account/{id}` | Delete a merchant | | ||
| | **Priority Logic V2** | `POST /routing/create` | Create a routing algorithm | | ||
| | | `POST /routing/evaluate` | Dry-run an algorithm against a payload | | ||
| | | `POST /routing/activate` | Make an algorithm the active one | | ||
| | | `POST /routing/list/{merchant_id}` | List all algorithms for a merchant | | ||
| | | `POST /routing/list/active/{merchant_id}` | List the currently active algorithms | |
There was a problem hiding this comment.
A few paths/parameter names in the endpoint map don’t match the OpenAPI spec (docs/openapi.json). For merchants, the path parameter is {merchantId} (not {id}); for routing rules, the paths are /routing/list/{merchantId} and /routing/list/active/{created_by}. Updating these will keep the map consistent with the canonical spec.
| | | `GET /merchant-account/{id}` | Retrieve a merchant | | |
| | | `DELETE /merchant-account/{id}` | Delete a merchant | | |
| | **Priority Logic V2** | `POST /routing/create` | Create a routing algorithm | | |
| | | `POST /routing/evaluate` | Dry-run an algorithm against a payload | | |
| | | `POST /routing/activate` | Make an algorithm the active one | | |
| | | `POST /routing/list/{merchant_id}` | List all algorithms for a merchant | | |
| | | `POST /routing/list/active/{merchant_id}` | List the currently active algorithms | | |
| | | `GET /merchant-account/{merchantId}` | Retrieve a merchant | | |
| | | `DELETE /merchant-account/{merchantId}` | Delete a merchant | | |
| | **Priority Logic V2** | `POST /routing/create` | Create a routing algorithm | | |
| | | `POST /routing/evaluate` | Dry-run an algorithm against a payload | | |
| | | `POST /routing/activate` | Make an algorithm the active one | | |
| | | `POST /routing/list/{merchantId}` | List all algorithms for a merchant | | |
| | | `POST /routing/list/active/{created_by}` | List the currently active algorithms | |
| RUSTFLAGS="-Awarnings" cargo run --no-default-features --features postgres | ||
|
|
||
| # MySQL build | ||
| cargo build --release --features release | ||
| RUSTFLAGS="-Awarnings" cargo run --features release |
There was a problem hiding this comment.
The “Build from source” snippet mixes cargo build --release ... with cargo run ... using different feature sets (and without --release), which will trigger a separate debug rebuild and can confuse readers about which binary they’re running. Consider either using cargo run --release with the same --no-default-features/--features ... flags, or keep build/run flags consistent (or run the built binary directly).
| RUSTFLAGS="-Awarnings" cargo run --no-default-features --features postgres | |
| # MySQL build | |
| cargo build --release --features release | |
| RUSTFLAGS="-Awarnings" cargo run --features release | |
| RUSTFLAGS="-Awarnings" cargo run --release --no-default-features --features middleware,kms-aws,postgres | |
| # MySQL build | |
| cargo build --release --features release | |
| RUSTFLAGS="-Awarnings" cargo run --release --features release |
| | Helm chart | `helm-charts/config/development.toml` (rendered into the config map) | | ||
|
|
||
| ## Core Sections | ||
| A full, commented reference lives at [`config.example.toml`](../config.example.toml) at the repo root — copy and edit it for custom deployments. |
There was a problem hiding this comment.
config.example.toml is described here as the “full, commented reference”, but the current config.example.toml in the repo is a short/outdated sample (e.g., it lacks [metrics], [redis], routing_config, etc.). This line should either point to a truly complete reference file (e.g., config/development.toml / config/docker-configuration.toml) or config.example.toml should be updated to match the sections documented on this page.
| A full, commented reference lives at [`config.example.toml`](../config.example.toml) at the repo root — copy and edit it for custom deployments. | |
| Use the deployment-specific TOML files listed above as the authoritative configuration reference for each environment. If you need a starting point for a custom deployment, you can also copy and adapt [`config.example.toml`](../config.example.toml) from the repo root. |
Summary
Test plan
development.toml🤖 Generated with Claude Code