feat(api): schematics catalog (backend + data model + 3 CC0 seed SVGs) - #45
Merged
Conversation
First PR of the schematics MVP series. Establishes the read-only catalog that follow-ups (PR #2: viewer, PR #3: DTC cross-link) will build on. Schema: * New 'schematics' table with slug, series, system, file_path, mime, license, tags, year range, etc. Idempotent migration via CREATE TABLE IF NOT EXISTS. API: * GET /api/schematics — list/filter (series, system, q substring). * GET /api/schematics/<slug> — single row, 404 if unknown, 503 if the asset file is missing on disk (distinct from not-in-catalog). Files served by nginx from /static/schematics/<slug>.svg, never through Python (same pattern the rest of the API uses). Seed (CC0, hand-drawn): * e89-z4-rcd3302-power-can — RCD 3302 retrofit, power + K-CAN tap * e90-cas3-pinout — CAS3/4 connector pin reference (e90) * e60-n54-dme-power — N54 DME main-relay + power tree (e60) Wiring: * bootstrap_dtc.py seeds schematics alongside DTCs on every deploy. * No new Python deps. Stdlib-only, matches the rest of the backend. Tests: * test_schematics.py — 18 unit tests (schema, list filters, slug lookup, mime→extension map, seed idempotency). * test_app_schematics_endpoints.py — 8 HTTP integration tests against a live ThreadingHTTPServer. * Full suite: 109/109 passing. Out of scope (follow-ups): viewer UI, DTC cross-link, community upload pipeline, hotspot annotations, desktop bundling. Protected paths: none touched (this PR is backend-only). Closes: schematics-mvp#1 of the agreed 3-PR plan.
Contributor
|
ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR. |
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.
First PR of the schematics MVP series. Establishes the read-only catalog that follow-ups (PR #2: viewer, PR #3: DTC cross-link) will build on.
Schema:
API:
Files served by nginx from /static/schematics/.svg, never through Python (same pattern the rest of the API uses).
Seed (CC0, hand-drawn):
Wiring:
Tests:
Out of scope (follow-ups): viewer UI, DTC cross-link, community upload pipeline, hotspot annotations, desktop bundling.
Protected paths: none touched (this PR is backend-only).
Closes: schematics-mvp#1 of the agreed 3-PR plan.
What this adds
For data contributions (community/*.toml)
proprietary software
For code contributions
cargo fmtandcargo clippyare clean