PolicyEngine / PolicyEngine/policyengine-app-v2
Remove country prefix from global routes
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 1
- Forks
- 3
- Avg merge
- 1d 50m
- Merged PRs (30d)
- 39
Description
Problem
Many routes don't need country context but still require /us or /uk prefix, creating URL clutter:
/us/research→ same content globally/us/team→ same content globally/us/ai-inequality→ global research tool/us/donate,/us/supporters,/us/privacy,/us/terms,/us/brand/*→ all global
Proposed solution
Move global routes outside the /:countryId nesting while keeping country prefix for pages that need it (calculator, reports, policies, simulations).
Target URL structure
# Global routes (no country prefix)
/research
/research/:slug
/ai-inequality
/2025-year-in-review
/team
/donate
/supporters
/privacy
/terms
/brand/*
# Country-specific routes (keep prefix)
/us/calculator
/us/reports
/us/policies
/uk/calculator
...
Implementation
- Restructure
WebsiteRouter.tsx- Move global routes outside/:countryIdchildren - Keep
CalculatorRouter.tsxas-is - All calculator/data routes need country - Update header/nav - Country selector on global pages sets preference for calculator entry
- Update internal links - Any links from global pages to country routes need to include country
- Handle
RedirectToCountry- Root/could go directly to global homepage
Files to modify
app/src/WebsiteRouter.tsxapp/src/components/Header.tsx(if country selector logic needs updating)- Any pages with links to country-specific routes
Notes
- The country architecture is well-documented in
app/src/docs/ARCHITECTURE-COUNTRY-ID.md - ~321 files reference countryId but most are in calculator routes that will keep the prefix
- This is a targeted change, not a full architecture rewrite
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with app/src/docs/ARCHITECTURE-COUNTRY-ID.md and app/src/WebsiteRouter.tsx, then inspect app/src/components/Header.tsx and links from the listed global pages. Move only the specified global routes outside the country nesting, preserve country prefixes for calculator, reports, policies, and simulations, and verify that global navigation and country-specific links resolve to the target URL structure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100