This repo contains two pieces:
mobile/: a Flutter AR app that asks Meshy for a text-to-3D model, downloads the refinedglb, and lets you place that model on a horizontal surface inside an AR sessionserver/: a small Dart proxy that keeps the Meshy API key off the phone and runs the full Meshypreviewthenrefineworkflow
The repo root owns the Nix shell and direnv setup for both parts.
nixdirenv- an AR-capable physical Android or iOS device
- a Meshy API key exported as
MESHY_API_KEY
On Linux, the flake also provides the Android SDK, NDK, platform tools, command line tools, and emulator packages.
Allow the repo shell once:
cd /home/yvesd/Codebases/voxel
direnv allowThe root .envrc will load the Nix dev shell and then source .envrc.local if
it exists. A local secret file is ignored by Git.
Example:
cp .envrc.local.example .envrc.local
$EDITOR .envrc.local
direnv allowInstall the backend dependencies:
cd /home/yvesd/Codebases/voxel/server
dart pub getStart the proxy:
cd /home/yvesd/Codebases/voxel/server
dart run bin/server.dartBy default it listens on http://0.0.0.0:8080. You can override the port with
PORT.
The proxy exposes:
POST /api/meshy/generateGET /api/meshy/generate/:jobId
It keeps jobs in memory only.
Install the Flutter dependencies:
cd /home/yvesd/Codebases/voxel/mobile
flutter pub getRun the app on a physical device, pointing it at the proxy on your computer:
cd /home/yvesd/Codebases/voxel/mobile
flutter run --dart-define=MESHY_PROXY_BASE_URL=http://<LAN-IP>:8080Replace <LAN-IP> with the local network address of the machine running the
proxy, for example 192.168.1.10.
- Grant camera access when prompted.
- Enter a text prompt in the bottom panel.
- Tap
Generate model. - Wait for the proxy to finish the Meshy preview and refine stages.
- Once the model is ready, move the phone until a horizontal plane is detected.
- Tap once to place the generated model.
- Tap
Reset placementto remove the current anchor and place the same model again. - Generate a new prompt to replace the current model.
The app keeps one active generated model at a time and does not persist it across restarts.
- The Nix shell rewrites
mobile/android/local.propertiesso Gradle points at the Nix-managed Android SDK, NDK, and CMake toolchains. - Android builds still require an ARCore-capable physical device for real AR validation.
- The emulator is useful only for launch and non-AR UI checks.
Build a debug APK:
cd /home/yvesd/Codebases/voxel/mobile
flutter build apk --debugBackend:
cd /home/yvesd/Codebases/voxel/server
dart testFlutter app:
cd /home/yvesd/Codebases/voxel/mobile
flutter analyze
flutter test
flutter build apk --debugDo not commit MESHY_API_KEY into tracked files. The proxy is the only place
that should read it. If you have already shared a real key in chat or elsewhere,
rotate it before using this setup beyond local development.