Skip to content

Add parts server, shared parts library and 2D/3D part models - #2

Merged
nilres merged 1 commit into
masterfrom
feature/parts-server
Oct 20, 2026
Merged

nilres merged 1 commit into
masterfrom
feature/parts-server

Conversation

@nilres

@nilres nilres commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Workspace + shared library: the repository is now a Cargo workspace. The part model, function templates, example catalog, CSV/JSON import/export and the parts server API types live in the new openecraft-parts crate (crates/openecraft-parts). The crate depends only on serde, and both executables use it.
  • Parts server (openecraft-server): a standalone axum executable that hosts a global parts database.
    • Endpoints under /api/v1: info, parts (list and filter), parts/{number} (GET/PUT/DELETE), import and export.csv.
    • Storage: a JSON file with atomic writes.
    • Writes need a bearer token (--token / OPENECRAFT_TOKEN); without a token the server is read-only.
    • CORS is enabled, so the web build can use it.
  • Editor client: the parts database dialog has a new 🌐 Parts server panel. It can check the connection, download (merge into the local database) and upload. The server URL is persisted; the token is held in memory only.
  • 2D / 3D part models:
    • Parts can carry a 2D front view (imported from SVG) and a 3D mesh (STL or OBJ).
    • A new Graphics tab in the part editor offers preview, rotate, scale and "use model size as mounting data".
    • The 2D views are drawn in the panel front view and on mounting layout pages, and the meshes in the 3D view. Both are fitted to the part's mounting dimensions.
    • The example catalog generates models, and an Extras action refreshes the GEN.* parts.
  • Conventions: the test layout check and the glyph check now cover every workspace member. AGENTS.md, README and CI (--workspace, server artifacts) are updated.

Note for reviewers

This branch builds on feature/panel-layout (#1), so its two commits show up here as well. Please merge #1 first.

Test plan

  • cargo test --workspace: 55 tests (34 app, 12 library, 9 server)
  • cargo clippy --workspace --all-targets and the wasm clippy run are clean
  • Server checked end to end with curl and from the web build: downloaded 42 parts, then an authenticated upload ("Uploaded 42 parts, server revision 3")
  • Mounting layout page export shows the generated 2D models
  • Visual check of the 3D meshes in the panel 3D view and of the Graphics tab on desktop

🤖 Generated with Claude Code

- Turn the repo into a workspace; move the part model, catalog, CSV/JSON
  and text helpers into the openecraft-parts library crate
- Add openecraft-server: standalone axum REST server for a global parts
  database (JSON file store, bearer token for writes, CORS, CSV export)
- Add a parts server client to the editor (download, upload, status)
- Add 2D front views (SVG) and 3D models (STL/OBJ) to parts, with a
  Graphics tab in the part editor; use them in the panel front view,
  mounting layout pages and the 3D view; generate models for the
  example catalog
- Extend the test convention and glyph checks to all workspace members
- Update README, AGENTS.md and CI for the workspace

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nilres
nilres merged commit ebcc1c7 into master Oct 20, 2026
4 checks passed
@nilres
nilres deleted the feature/parts-server branch October 25, 2026 17:30
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