server
server copied to clipboard
Refactor: Decouple client router from server URL resolution
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
- Changes to client routes require server changes
- Specific naming (challenge, opportunity) instead of generic levels (L0, L1, L2)
Suggested Improvements
- Server should get generic entity information instead of parsing URLs:
{
type: "opportunity",
spaceNameId: "",
challengeNameId: "",
opportunityNameId: ""
}
- Let clients define their own routes;
- Let the client decide what information is needed, not the server;
- 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