Unity-based AR mobile application for QR-driven organic produce traceability.
OrganicTraceAR is a Unity 6 mobile project that combines Vuforia QRbarcode scanning with a lightweight AR overlay to present produce traceability insights in a user-friendly format. After a QR code is scanned, the app extracts the batch ID, sends it to the Insight Engine API, and displays a persistent world-space overlay with batch-level quality and trust information.
This repository contains the Unity project scaffold, auth flow, AR overlay logic, scene generator, and supporting scripts required to run the application.
- Unity 6000.3.2f1
- UI System uGUI + TextMeshPro
- Render Pipeline URP
- Target Platform Android (portrait)
- AR Scanning Vuforia Engine
- Networking UnityWebRequest
- Backend Integration Insight Engine REST API
- Splash, Auth, and AR scenes
- Login, Signup, and Forgot Password screens
- Direct Login Signup navigation to
ARScene - QR barcode scanning through Vuforia
- Insight Engine API call using scanned batch ID
- Persistent world-space AR summary overlay
- Mock auth API service for rapid UI testing
- Editor tool to generate all scenes from code
OrganicTraceAR_UnityProject
├── Assets
│ └── OrganicTraceAR
│ ├── Docs
│ ├── Editor
│ ├── Scenes
│ └── Scripts
├── Packages
├── ProjectSettings
└── README_GIT_REPO.md
AssetsOrganicTraceAREditor- scene generator toolsAssetsOrganicTraceARScriptsAR- scanner, overlay, and AR data presentationAssetsOrganicTraceARScriptsUIAuth- login, signup, and forgot-password controllersAssetsOrganicTraceARScriptsManagers- navigation, panel switching, session handlingAssetsOrganicTraceARDocs- quick setup documentation
SplashSceneAuthSceneARScene
- Login success -
ARScene - Signup success -
ARScene - Forgot Password - mock success status message
- User scans a QR code
- Batch ID is extracted from the QR content
- App calls the Insight Engine API
- Response is parsed into app models
- AR overlay is populated and displayed in world space
- Overlay remains visible until a new QR is scanned
Open this folder in Unity 6000.3.2f1.
Wait until Unity finishes importing packages and scripts.
Run
Tools OrganicTraceAR Generate All Scenes
This generates
SplashSceneAuthSceneARScene
Open
AssetsOrganicTraceARScenesAuthScene.unity- or
AssetsOrganicTraceARScenesARScene.unity
Vuforia is not bundled in this repo because installation and licensing depend on the local Unity environment.
- Install Vuforia Engine through Unity Package Manager or your preferred package workflow
- Enter the Vuforia license key in
Project Settings Vuforia Engine
- Add confirm the required Vuforia barcode component on the
BarcodeGameObject inARScene - Ensure the AR camera has
VuforiaBehaviour- tag set to
MainCamera
In ARScene, select the Barcode object and configure the scanner fields in the Inspector
- Insight Engine Base Url
- Endpoint Prefix
Example
- Base URL
httpYOUR_SERVER_IP8000 - Endpoint Prefix
apiretailerhistory
The final request format is
{BaseUrl}apiretailerhistory{batchId}
BarcodeInsightScanner.cs- reads scanned barcode data
- calls the Insight Engine API
- passes results to the overlay presenter
ARInsightOverlayPresenter.cs- binds API response fields to the AR UI
PersistentAROverlayAnchor.cs- places the overlay in world space and keeps it visible after the QR leaves view
BatchInsightModels.cs- response models for the Insight Engine payload
LoginFormController.csSignupFormController.csForgotPasswordFormController.csAuthViewController.csMockApiService.cs
SceneNavigator.csPanelManager.csSplashController.csOrganicTraceARSceneGenerator.cs
If Vuforia is not fully configured yet, the project includes a debug-friendly workflow for scanner testing.
Use the BarcodeInsightScanner debug options if present in the Inspector or component context menu to simulate a scan with a known batch ID.
- Clean portrait mobile layout
- Login, Signup, Forgot Password panels
- Panel-based navigation using
PanelManager
- World-space summary card
- Screen-space statusdebug text
- Persistent overlay root separated from the tracked barcode object
- Overlay updates when a new batch is scanned
- Vuforia initialization in Unity Editor can be sensitive to webcam availability and local setup
- If Vuforia fails to initialize after scene or hierarchy changes, try
- reopening Unity
- deleting the
Libraryfolder and reopening the project - reimporting the Vuforia package
MainSceneis intentionally skipped in the current fast-path flow; Login and Signup go directly toARScene
For Unity repos, make sure .gitignore excludes generated folders such as
LibraryTempLogsobjBuild.vsUserSettings
Use Unity's standard .gitignore template for best results.
- Open project in Unity 6000.3.2f1
- Generate scenes from
Tools OrganicTraceAR Generate All Scenes - Install and configure Vuforia
- Set the Insight Engine base URL on the
Barcodeobject - Open
AuthScene - Login or Signup
- Continue directly to
ARScene - Scan QR and verify the overlay response
This repository is intended as the project codebase for the OrganicTraceAR research and prototype implementation.