Add SvelteKit SSR with Caddy reverse proxy#147
Merged
Conversation
…ement features Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Introduce $lib/api/server.ts with createServerClient(fetch, url) that centralizes INTERNAL_API_BASE_URL resolution for all SSR load functions. Add SSR-safety comment to the Proxy in client.ts. Update Svelte.md with SSR child route inheritance warning and createServerClient usage pattern. Update WebApiDesign.md with /api/pages/ namespace convention. Remove the hello world SSR scaffold (backend endpoint, frontend route, and test) now that the real title detail page is ready to take its place. Update stale /hello references in Hosting.md routing table and the frontend SPA routing test. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add page endpoint GET /api/pages/title/{slug} in catalog app, tagged
private, reusing existing _detail_qs() and _serialize_title_detail().
Replace CSR +layout.ts with SSR +layout.server.ts using the new
createServerClient helper. Convert edit-history child route to SSR.
Add explicit ssr=false to interactive child routes (edit, media,
media/upload) that import the browser client or read auth state.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds Reviewing.md with project-specific review priorities and checks (app boundaries, claims, SSR/CSR, page APIs, deployment). Points CLAUDE.md and AGENTS.md at it so Claude reads the checklist before reviewing code. Updates Development.md hub to link to the new doc. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Each app's api module now declares a `routers` list of (prefix, router) tuples. config/api.py discovers them by scanning INSTALLED_APPS at import time, eliminating the manual import/registration boilerplate. Adding a new router no longer requires touching config/api.py. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Agents repeatedly try to stage schema.d.ts and miss running make api-gen after adding endpoints. Promote to a dedicated subsection in agent docs. Also add SSRConversion.md and link it from Development.md. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The generator writes 2-space indentation but the project uses tabs, causing phantom diffs every time make api-gen runs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add /api/pages/manufacturer/{slug} page endpoint reusing existing
queryset and serializer. Replace CSR layout/edit-history loaders with
server loaders using createServerClient. Classify child routes: edit,
media, and media/upload opt out of SSR; systems and sources inherit it.
Remove the now-redundant GET /{slug} detail endpoints from both the
manufacturers and titles routers, migrating all test GETs to the page
endpoints. Delete test_page_endpoints.py whose coverage was a strict
subset of the migrated tests.
Update SSRConversion.md with endpoint removal checklist, gotchas, and
guidance on when migrated tests replace vs. supplement new tests.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add /api/pages/model/{slug} page endpoint reusing existing queryset and
serializer. Replace CSR layout/edit-history loaders with server loaders
using createServerClient. Convert +page.ts redirect logic (single-model
title → /titles/{slug}) to +page.server.ts for proper 301 headers.
Classify child routes: edit, media, and media/upload opt out of SSR;
sources inherits it.
Remove the now-redundant GET /{slug} detail endpoint from the models
router, migrating all test GETs to the page endpoint — including 4
in apps/media/tests that a scoped grep would have missed.
Update SSRConversion.md: document non-trivial +page.ts conversion
and emphasize grepping the full backend/ tree for scattered tests.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…backs --color-danger was referenced in 11 CSS rules but never defined in app.css, causing every use to fall back to hardcoded hex values that ignored dark mode. Additionally, 26 files had unnecessary fallback values on --color-error (#c0392b or #c53030) even though the token is always defined. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…rRangeInput Add :where() rules for text inputs, textareas, selects, focus states, and placeholders to app.css, then strip the identical copy-pasted CSS from 11 component files — keeping only genuine overrides (custom padding, font-size, border-radius, transition, compact widths). Extract YearRangeInput from the identical year-range markup+CSS+JS duplicated in TitleFilterSidebar and ManufacturerFilterSidebar. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ules Eliminate 5 :global(svg) icon-sizing rules by giving FaIcon an optional size prop that sets width/height via Svelte style directives. Wrap SearchBox icon in a parent-owned span for layout positioning. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Svelte.md: replace open-ended SSR/CSR heuristics with a concrete three-tier decision matrix (SSR, prerendered shell + client fetch, CSR-only), add authoring conventions section, and add prerender caveat about deferring request-time state to onMount. SSRConversion.md: add "check if page should be SSR" gate at the top and tighten the intro. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/api/,/admin/,/media/,/static/to Django and everything else to SvelteKit.+layout.server.ts/+page.server.tsloaders.YearRangeInput, addssizeprop toFaIcon, defines--color-dangertoken, adds global form input base styles, and removes:global(svg)workarounds.Deployment checklist
/api/healthto/__healthINTERNAL_API_BASE_URLdefaults tohttp://127.0.0.1:8000in the DockerfileSECRET_KEY,DEBUG,ALLOWED_HOSTS,CSRF_TRUSTED_ORIGINS) unchangedTest plan
make testpasses (backend pytest + frontend vitest)make lintpasses/titles/<slug>,/manufacturers/<slug>,/models/<slug>/__healthreturns 200🤖 Generated with Claude Code