server icon indicating copy to clipboard operation
server copied to clipboard

Refactor: Decouple client router from server URL resolution

Open coderabbitai[bot] opened this issue 9 months ago • 1 comments
trafficstars

Context

Currently, the server is tightly coupled with client routing by building and parsing entity URLs with specific path segments (challenges, opportunities).

This was discussed in PR #4883.

Issues

  1. Changes to client routes require server changes
  2. Specific naming (challenge, opportunity) instead of generic levels (L0, L1, L2)

Suggested Improvements

  1. Server should get generic entity information instead of parsing URLs:
{
  type: "opportunity",
  spaceNameId: "",
  challengeNameId: "",
  opportunityNameId: ""
}
  1. Let clients define their own routes;
  2. Let the client decide what information is needed, not the server;
  3. Consider using naming like spaceNameL0, spaceNameL1, spaceNameL2

Benefits

  • Decoupled client routing from server
  • More robust architecture
  • Easier to maintain and modify routes
  • Generic naming allows for future flexibility

coderabbitai[bot] avatar Feb 13 '25 14:02 coderabbitai[bot]