Skip to content

feat: Add sitemap and package search API - #5

Open
Fuyeors wants to merge 4 commits into
mainfrom
feat/add-sitemap-search-api
Open

feat: Add sitemap and package search API#5
Fuyeors wants to merge 4 commits into
mainfrom
feat/add-sitemap-search-api

Conversation

@Fuyeors

@Fuyeors Fuyeors commented Aug 21, 2026

Copy link
Copy Markdown
Member

Summary

  • Add a database-backed sitemap index at /sitemaps/index.xml.
  • Generate localized users, organizations, and packages sitemaps through /sitemaps/:locale/:module.
  • Support the existing public locales: en, fr, es, pt, de, ar, ru, ja, ko, zh-hans, and zh-hant.
  • Keep sitemap generation and XML responses entirely in the backend so nginx can proxy the exact public paths without frontend involvement.
  • Keep the package search API from the original PR: /v1/search supports npm-compatible aliases, pagination, latest SemVer selection, and frontend API/composable types.

Sitemap design

The sitemap implementation follows the structure used by Fuyeor/monorepo: the index expands every public locale and entity module, while the localized route validates the locale and module before querying the database. Each sitemap emits RFC 3339 lastmod values, escapes XML content, and percent-encodes URL segments. The supported localized files are named users.xml, organizations.xml, and packages.xml.

The frontend is not involved in sitemap generation. There is no frontend generator, static sitemap file, package script, or robots sitemap edit in this PR; nginx can proxy /sitemaps/* directly to the backend.

Validation

  • cargo fmt --check
  • cargo check --manifest-path apps/registry/back-end/Cargo.toml
  • cargo test --manifest-path apps/registry/back-end/Cargo.toml (9 tests)
  • Local PostgreSQL HTTP integration test for the index, all 11 locales, all 3 modules, XML content type, and unsupported-locale 404 behavior

Fuyeors commented Aug 21, 2026

Copy link
Copy Markdown
Member Author

Updated in commit 12604be: replaced the hardcoded sitemap with database-driven sitemap endpoints and a reproducible frontend generator. The PR now produces /sitemaps/index.xml, /sitemaps/en/users.xml, /sitemaps/en/organizations.xml, and /sitemaps/en/packages.xml.

Fuyeors commented Aug 21, 2026

Copy link
Copy Markdown
Member Author

Corrected in commit c198ca6: removed the frontend sitemap generator, frontend package script, robots sitemap edit, and static sitemap handling. Sitemap XML is now backend-only for direct nginx proxying.

Fuyeors commented Aug 21, 2026

Copy link
Copy Markdown
Member Author

Updated in commit 5956cc1: aligned FPM sitemap generation with Fuyeor/monorepo, removed the hardcoded en route, and added locale-aware index/module routing for all existing public locales.

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