Skip to content

chore: migrate rust/photo_gallery to icp-cli#1406

Draft
marc0olo wants to merge 1 commit into
masterfrom
chore/migrate-rust-photo-gallery-to-icp-cli
Draft

chore: migrate rust/photo_gallery to icp-cli#1406
marc0olo wants to merge 1 commit into
masterfrom
chore/migrate-rust-photo-gallery-to-icp-cli

Conversation

@marc0olo

Copy link
Copy Markdown
Member

Summary

  • Replaces dfx.json with icp.yaml using @dfinity/rust@v3.3.0 and @dfinity/asset-canister@v2.2.1
  • Renames backend crate from pictures-site-backend to backend; updates Cargo.toml, Cargo.lock, and renames .did file to backend.did
  • Replaces dfx-generated declarations with @icp-sdk/bindgen (icpBindgen Vite plugin); adds frontend/src/actor.js using safeGetCanisterEnv
  • Updates vite.config.js to use the bindgen plugin and removes vite-plugin-environment / dotenv dependencies
  • Updates App.tsx to import from actor.js and fixes image URL construction to use canister env instead of DFX-specific env vars
  • Adds Makefile with 6 tests covering upload_image, list_images, and http_request (including 404 case)
  • Adds CI workflow photo_gallery.yml for the rust-photo_gallery job using ghcr.io/dfinity/icp-dev-env-rust:1.0.0
  • Removes dfx.json, BUILD.md, .devcontainer/, root tsconfig.json, and old .did file

Test plan

  • icp network start -d && icp deploy completes successfully
  • make test passes all 6 tests
  • Frontend loads and photo upload/display works via HTTP gateway

🤖 Generated with Claude Code

- Replace dfx.json with icp.yaml using @dfinity/rust@v3.3.0 and @dfinity/asset-canister@v2.2.1
- Rename backend package from pictures-site-backend to backend; update Cargo.toml and Cargo.lock
- Rename pictures-site-backend.did to backend.did
- Add rust-toolchain.toml
- Replace dfx-generated declarations with @icp-sdk/bindgen (icpBindgen Vite plugin)
- Add frontend/src/actor.js using safeGetCanisterEnv from @icp-sdk/core
- Update frontend/vite.config.js to use icpBindgen plugin; remove vite-plugin-environment
- Update App.tsx to import from actor.js; fix image URL construction to use canister env
- Add Makefile with tests for upload_image, list_images, and http_request
- Add CI workflow (.github/workflows/photo_gallery.yml) for rust-photo_gallery job
- Delete dfx.json, BUILD.md, .devcontainer/, tsconfig.json (root), .env

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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