Skip to content

Split API routes by domain with versioned namespacing#417

Open
smog123 wants to merge 1 commit into
Smartdevs17:mainfrom
smog123:feat/split-api-routes
Open

Split API routes by domain with versioned namespacing#417
smog123 wants to merge 1 commit into
Smartdevs17:mainfrom
smog123:feat/split-api-routes

Conversation

@smog123
Copy link
Copy Markdown

@smog123 smog123 commented May 29, 2026

Closes #123

Refactor API routing into a versioned, domain-based structure to improve organization, scalability, and maintainability.

What Changed

  • Added api/src/routes/v1/ for versioned API routes

  • Split routes into domain-specific files:

    • lending.routes.ts
    • health.routes.ts
    • protocol.routes.ts
  • Introduced centralized API router in api/src/routes/index.ts

  • Updated api/src/app.ts to mount routes under /api/v1/*

  • Removed legacy flat lending.routes.ts

Benefits

  • Clear API versioning strategy
  • Better route organization by domain
  • Easier future expansion (v2, new domains, etc.)
  • Improved maintainability and reduced routing complexity
  • No changes to controllers, middleware, or business logic

Endpoint Structure

All routes now follow:

/api/v1/<domain>/<endpoint>

Examples:

  • /api/v1/lending/prepare
  • /api/v1/health/live
  • /api/v1/protocol/stats

@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

@smog123 is attempting to deploy a commit to the smartdevs17's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant