Skip to content

Create The Developer Integration Guide Which Includes the API Reference, OpenAPI Spec & Quickstart #21

Description

@grantfox-oss

Overview

SaviTools exposes a NestJS API that CrowdPay, Fluxa, and external developers will call directly. There is currently no documentation for these endpoints beyond the source code itself. Without a clear API contract, integrators have nothing to build against, errors are opaque, and onboarding new contributors takes longer than it should. This issue covers auto-generating an OpenAPI spec from the codebase and producing a complete written integration guide alongside it.

What needs to be built

OpenAPI / Swagger (in-app)

  • Add @nestjs/swagger to apps/api and decorate all controllers, DTOs, and response classes
  • Serve Swagger UI at /api/docs in development and staging environments only (disabled in production)
  • Spec must cover every existing and planned module: network, composer, sandbox, inspector, simulator, webhooks
  • All response shapes must include example values — no empty schemas
    docs/api-reference.md

Sections:

  • Base URLs — testnet vs mainnet environments, versioning strategy
  • Authentication — API key header format (X-SaviTools-Key), where to generate keys, which endpoints require auth
  • Endpoint catalogue — for every endpoint: method + path, description, full request params/body schema, full response schema, and at least one curl example
  • Error reference — Stellar/Horizon pass-through error codes vs SaviTools-originated errors, with meaning and suggested resolution for each
  • Caching behaviour — which endpoints are Redis-cached, TTL per endpoint, how to bust the cache in development
    docs/quickstart.md

End-to-end walkthrough: "From zero to a submitted Stellar transaction in 5 minutes"

  1. Generate a keypair via /sandbox/keypair
  2. Fund it on testnet via /sandbox/fund
  3. Inspect the account via /sandbox/account/:publicKey
  4. Find a payment path via /simulator/paths
  5. Build a transaction via /composer/build
  6. Submit and inspect the result via /inspector
    Each step includes the exact curl command, expected response, and a note on what could go wrong.

README.md updates

  • Link to /api/docs, docs/api-reference.md, and docs/quickstart.md from the root README
  • Add a "Documentation" section above "Contributing"

Acceptance Criteria

  • Swagger UI loads at /api/docs with all endpoints documented including request/response schemas and examples
  • Every endpoint in api-reference.md has at least one working curl example tested against the testnet environment
  • Quickstart guide is verified end-to-end on a clean testnet environment with no missing steps or broken commands
  • Docs are linked from the root README.md
  • Swagger is disabled (returns 404) when NODE_ENV=production

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaigndocumentationImprovements or additions to documentationenhancementNew feature or requestgood first issueGood for newcomers

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions