A mobile app that scans a Rubik's Cube with your camera and guides you through solving it step by step.
- Scan — Point your camera at each of the 6 faces. The app samples pixel colors in real time to detect the color of each tile.
- Solve — Once all 6 faces are scanned, the app sends the cube state to a FastAPI backend which runs the Kociemba two-phase algorithm to compute an optimal solution.
- Animate — The solution is played back move by move on an interactive 3D cube model, so you can follow along physically.
Mobile (React Native / Expo)
react-native-vision-camera— real-time frame processing for color detection@react-three/fiber+@react-three/drei— 3D cube rendering and animationreact-native-reanimated+react-native-worklets-core— performant worklet-based frame analysisexpo-router— file-based tab navigation
Backend (Python)
FastAPI— REST API serverkociemba— two-phase Rubik's Cube solving algorithm, typically solves in ≤20 moves
cd backend
pip install fastapi uvicorn kociemba
uvicorn main:app --host 0.0.0.0 --port 8000cd frontend
npm expo startMake sure the mobile app's API base URL points to your backend (update in scripts/solve-cube.ts).
├── app/
│ ├── (tabs)/
│ │ ├── index.tsx # Scan screen
│ │ └── solve.tsx # Solve & animate screen
│ └── _layout.tsx # Tab navigator
├── components/
│ └── rubiks-cube.tsx # 3D cube component
├── scripts/
│ ├── solve-cube.ts # API call to backend
│ └── organize-cube.ts # Color parsing & cube validation
├── constants/
│ └── variables.ts # Color range thresholds
└── backend/
└── main.py # FastAPI + kociemba solver