Prerequisites
- Node.js 18+ and npm
- Git for version control
- Supabase CLI for database management
- A code editor (VS Code recommended)
Clone and install
Environment variables
Create a.env.local file in apps/web/or-flow-app/ with your Supabase credentials:
Run the development server
http://localhost:3000.
Database setup
ORbit uses Supabase (PostgreSQL). To work with the database:Link Supabase CLI
Apply migrations
Create a new migration
supabase/migrations/ and are shared by both the web and iOS applications.
Project structure
Development workflow
ORbit uses a structured development workflow built around Claude Code:Feature development
Run /audit
Scans the codebase, interviews you about requirements, and creates a phased implementation plan in
docs/implementation-plan.md.Run /phase-start
Implements one phase, runs the 3-stage test gate, commits, and stops. Each phase is one atomic commit.
Repeat for each phase
Start a new session and run
/phase-start for the next phase. Continue until all phases are complete.Commands
| Command | Purpose |
|---|---|
/audit | Analyze feature spec and create implementation plan |
/phase-start | Execute the next pending phase |
/wrap-up | Commit work, log session state |
/fix | Quick targeted fix without planning overhead |
/migrate | Create a database migration |
Testing
ORbit uses a 3-stage testing gate after every phase:- Unit tests — does the new code work in isolation?
- Integration tests — does it work with what consumes it?
- Workflow tests — end-to-end scenario covering user actions before and after
Git conventions
- Feature branches:
feature/descriptive-name - One commit per phase:
feat(scope): phase N - description - Undo a phase:
git revert HEAD - Merge to main only when all phases are verified
Key rules
These rules are enforced across the codebase. Violating them causes bugs.
- Always use
useSupabaseQueryfor data fetching — never raw Supabase client calls in components - Always filter by
facility_id— RLS enforces this - Always use
facility_milestone_id— nevermilestone_type_idin case_milestones - Always filter
is_active = true— 20+ tables use soft deletes - No
anytypes — TypeScript strict mode - Use the logger — structured JSON logging, not
console.log