Skip to content

feat: Adding routes handling, always going through ROUTES instead of hardcoded everywhere#6886

Draft
DennisGaida wants to merge 11 commits intolouislam:masterfrom
DennisGaida:feature/route-reorganization
Draft

feat: Adding routes handling, always going through ROUTES instead of hardcoded everywhere#6886
DennisGaida wants to merge 11 commits intolouislam:masterfrom
DennisGaida:feature/route-reorganization

Conversation

@DennisGaida
Copy link

Summary

I am fully aware this touches a lot of files, but in the end it all references back to routes.ts. Even if you don't like the URLs I am proposing (/admin/...), these could be easily changed in the routes.ts to the previous URLs/paths, but we would get away from those hardcoded paths.

In this pull request, the following changes are made:

  • Implemented routes.ts so all routes go through it for UX/UI and pretty URLs

  • Removes all hardcoded URLs / paths everywhere and I hope I haven't missed a spot

  • I tried testing all paths and all functionalities as well as setting up a completely new UK instance

  • All legacy URLs are being redirected automatically (see routes.js on the bottom) - no broken bookmarks/links

  • Documentation & Tests never reference paths directly hence nothing to update

  • I don't know how to do CI tests locally, so I didn't do that next to npm run dev, npm run tsc and node server/server.js, maybe there are some automatic GH actions?

  • Resolves Consistent routes / URIs for easier security hardening #2505

Please follow this checklist to avoid unnecessary back and forth (click to expand)
  • ⚠️ If there are Breaking change (a fix or feature that alters existing functionality in a way that could cause issues) I have called them out
  • 🧠 I have disclosed any use of LLMs/AI in this contribution and reviewed all generated content.
    I understand that I am responsible for and able to explain every line of code I submit.
  • 🔍 Any UI changes adhere to visual style of this project.
  • 🛠️ I have self-reviewed and self-tested my code to ensure it works as expected.
  • 📝 I have commented my code, especially in hard-to-understand areas (e.g., using JSDoc for methods).
  • 🤖 I added or updated automated tests where appropriate.
  • 📄 Documentation updates are included (if applicable).
  • 🧰 Dependency updates are listed and explained.
  • ⚠️ CI passes and is green.

@DennisGaida DennisGaida marked this pull request as draft February 7, 2026 16:29
@DennisGaida DennisGaida marked this pull request as ready for review February 7, 2026 16:29
@DennisGaida DennisGaida marked this pull request as draft February 7, 2026 16:29
@github-actions github-actions bot added the pr:needs review this PR needs a review by maintainers or other community members label Feb 7, 2026
@CommanderStorm
Copy link
Collaborator

Looks interesting.
It oes not currenty pass CI though, because of some TS-issue.

@DennisGaida
Copy link
Author

DennisGaida commented Feb 7, 2026

  • PR title: ❌ can't fix, no permissions to prefix with feat:
  • e2e-tests: ✅ fixed, by using new paths hardcoded. Not sure whether I like this, but maybe tests need to have hardcoded paths
  • CI tests: ✅ only failed for node 20 through some weird quirk with import("routes") using the ts version instead of the js version. All a bit weird with the *.ts and *.js files lying in the same folder and manually having to adjust these files as stated in the util.js comment.
  • linters: ✅ fixed (would be fixed easily if tsconfig.json was just configured with "removeComments": false because tsc is actually throwing the comments away which the linters want again - I changed this setting now for tsconfig-backend so the linters don't complain when throwing JSDoc comments away)

@CommanderStorm CommanderStorm changed the title Adding routes handling, always going through ROUTES instead of hardcoded everywhere feat: Adding routes handling, always going through ROUTES instead of hardcoded everywhere Feb 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:needs review this PR needs a review by maintainers or other community members

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consistent routes / URIs for easier security hardening

2 participants