Instruction file imported from DevonJames/RoamEasy (
.cursor/rules/implementation_plan.mdc). Copyright stays with the author.
Update this rule if user requested changes to the project requirement, etc.
Implementation plan
Phase 1: Environment Setup
- Prevalidation: In the project root, check for
package.jsonorios/&android/folders; if present, abort init to avoid redundancy. (Project Requirements Document: Core Features) - Check Node.js: Run
node -vand verify it returns v20.2.1. (Tech Stack Document: Core Tools) - Install Node.js v20.2.1: If step 2 fails, install from https://nodejs.org/dist/v20.2.1/ and validate again. (Tech Stack Document: Core Tools)
- Check Yarn: Run
yarn -vand verify Yarn v1.22.x is installed; if not, runnpm install --global yarn@1.22.19. (Tech Stack Document: Core Tools) - Initialize Git: If
.gitfolder is missing, rungit init && git add . && git commit -m "chore: initial commit". (Project Requirements Document: Process) - Create Cursor metrics file: In project root, create
cursor_metrics.mdand referencecursor_project_rules.mdcfor usage. (Development Tools: Cursor) - Setup .cursor directory: If missing, run
mkdir .cursorand thentouch .cursor/mcp.json. (Development Tools: Cursor) - Ignore MCP config: Append
.cursor/mcp.jsonto.gitignore. (Development Tools: Cursor) - Configure Supabase MCP: In
.cursor/mcp.json, add:
// macOS { "mcpServers": { "supabase": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-postgres", "<connection-string>"] } }} // Windows { "mcpServers": { "supabase": { "command": "cmd", "args": ["/c", "npx", "-y", "@modelcontextprotocol/server-postgres", "<connection-string>"] } }} (Tech Stack Document: Backend)
- Obtain Supabase connection string: Visit https://supabase.com/docs/guides/getting-started/mcp#connect-to-supabase-using-mcp and paste your
<connection-string>into the JSON above. (Tech Stack Document: Backend) - Verify MCP connection: In Cursor’s Settings → MCP you should see a green “active” status next to “supabase.” (Development Tools: Cursor)
Phase 2: Frontend Development
- Initialize React Native TS project: Run:
npx react-native init RoamEasy --template react-native-template-typescript --npm (Tech Stack Document: Mobile)
- Validation: Confirm
package.jsonhasreact-nativeandtypescriptentries. (Tech Stack Document: Mobile) - Create environment file: At project root, add
.envwith keys:
GOOGLE_MAPS_API_KEY= OPENAI_API_KEY= SUPABASE_URL= SUPABASE_ANON_KEY= Then add .env to .gitignore. (Tech Stack Document: Backend)
- Install navigation & core libs: Run:
yarn add @react-navigation/native@6.1.6 @react-navigation/native-stack@6.9.12 yarn add react-native-async-storage@1.17.11 react-native-sqlite-storage@5.0.0 yarn add @react-native-community/netinfo@8.2.0 react-native-push-notification@8.1.1 axios@1.3.4 yarn add react-native-maps@0.32.2 (Tech Stack Document: Mobile)
- Validation: Run
npx pod-install iosand thenyarn react-native run-iosto confirm the app boots. (Tech Stack Document: Mobile) - Setup navigation container: Create
/src/navigation/AppNavigator.tsxwith React Navigation boilerplate. (Application Flow) - Home Screen skeleton: Create
/src/screens/HomeScreen.tsxwith placeholder header “RoamEasy” and bottom tab navigation. (Application Flow) - Route Planner UI: Create
/src/screens/RoutePlannerScreen.tsxwith inputs for start/end location, max driving time selector, and scenery preference dropdown. (PRD Section: Smart Route Planner) - Itinerary Screen: Create
/src/screens/ItineraryScreen.tsxto list saved stops with reorder handles. (PRD Section: Trip Itinerary Management) - Resort Details Screen: Create
/src/screens/ResortDetailsScreen.tsxshowing photo, rates, rating, phone, and booking link button. (PRD Section: Resort Suggestions) - Offline service: Create
/src/services/OfflineService.tsw/ methodscacheMapTiles(),cacheResortData(), andgetCachedItinerary(). (PRD Section: Offline Access) - Maps service: Create
/src/services/MapsService.tsusing Axios to call Google Maps Directions API and OpenRouteService if fallback. (PRD Section: Smart Route Planner) - AI service: Create
/src/services/OpenAIService.tswith functionrefineStops(prompt)to call GPT-4-Turbo. (PRD Section: Smart Route Planner) - Notification service: Create
/src/services/NotificationService.tsregistering push channels and scheduling departure reminders. (PRD Section: Notifications) - Calendar service: Create
/src/services/CalendarService.tswith export functions for Google Calendar, iCloud, and iCal. (PRD Section: Calendar Export) - Accessibility: In each screen, add large tap targets, high-contrast color tokens (greens, oranges, blues), and call ElevenLabs Conversation API in
AccessibilityService.tsfor voiceover. (PRD Section: Accessibility) - Validation: Run
yarn lintandyarn test(set up Jest later) and confirm zero errors in/srcfolder. (Tech Stack Document: Core Tools)
Phase 3: Backend Development
- Initialize Supabase project: In Supabase Console, create a new project in
us-east-1; noteproject URL&anon key. (Tech Stack Document: Backend) - Define Postgres schema: Create
supabase/schema.sqlwith:
-- users (RLS enabled) create table users (id uuid primary key, email text unique, created_at timestamp default now()); -- trips create table trips (id uuid primary key, user_id uuid references users(id), name text, created_at timestamp default now()); -- stops create table stops (id uuid primary key, trip_id uuid references trips(id), order smallint, lat numeric, lng numeric, notes text); -- resorts create table resorts (id uuid primary key, stop_id uuid references stops(id), name text, rating numeric, cost_per_night numeric, amenities jsonb, site_number text); (Tech Stack Document: Backend)
- Create tables via MCP: Run:
npx @modelcontextprotocol/server-postgres "<connection-string>" < supabase/schema.sql (Tech Stack Document: Backend)
- Validation: Run
npx @modelcontextprotocol/server-postgres "<connection-string>" --list-tablesand confirm tables exist. (Tech Stack Document: Backend) - Configure Auth providers: In Supabase Console → Auth → Settings → External OAuth, enable Google and Apple with client IDs. (Q&A: Authentication)
- Enable RLS: In Supabase SQL Editor, run
alter table trips enable row level security;and add a policyusing (auth.uid() = user_id);. (Tech Stack Document: Security) - Install Supabase client: In frontend, run
yarn add @supabase/supabase-js@2.8.0. (Tech Stack Document: Backend) - Supabase service: Create
/src/services/SupabaseService.tsto initcreateClient(SUPABASE_URL, SUPABASE_ANON_KEY)and export auth & db methods. (Tech Stack Document: Backend) - Validation: In
/src/screens/LoginScreen.tsx, callsupabase.auth.signInWithPassword()and verify successful login. (Q&A: Authentication)
Phase 4: Integration
- Route planning flow: In
RoutePlannerScreen.tsx, callMapsService.getRoute()thenOpenAIService.refineStops(); display results inItineraryScreen. (Application Flow) - Resort suggestions: For each stop, call
OpenAIServiceto fetch resorts, cache viaOfflineService, then render inResortDetailsScreen.tsx. (PRD Section: Resort Suggestions) - Trip CRUD: Wire up
SupabaseServiceto save/retrieve trips and stops; on save, write to Supabase and Local SQLite. (PRD Section: Trip Itinerary Management) - Offline sync: Detect offline via NetInfo; read/write only to SQLite, then sync to Supabase on reconnect. (PRD Section: Offline Access)
- Calendar export: From
ItineraryScreen, invokeCalendarService.exportToCalendar()and handle user consent. (PRD Section: Calendar Export) - Sharing feature: Add
Sharebutton inItineraryScreenthat generates a simplified PDF/HTML itinerary and invokes React Native Share API. (PRD Section: Sharing) - Validation: Simulate offline in emulator and confirm itinerary and maps display correctly; test share and calendar export. (PRD Section: Offline Access)
Phase 5: Deployment
- CI pipeline: Create
.github/workflows/ci.ymlwith jobs forbuild-ios(macos-latest) andbuild-android(ubuntu-latest) that runyarn install,yarn lint,yarn test, and build commands. (Tech Stack Document: Deployment) - Fastlane for iOS: In
ios/fastlane/Fastfile, add lanesbetaandreleaseusingmatchfor code signing andgymto build.ipa. (Tech Stack Document: Deployment) - Fastlane for Android: In
android/fastlane/Fastfile, add lanesbetaandreleaseusinggradleaction to build.apk/.aab. (Tech Stack Document: Deployment) - App Store setup: Register bundle ID
com.yourcompany.roameasyin Apple Developer, configure TestFlight in App Store Connect. (PRD Section: Release Plan) - Play Store setup: Create app in Google Play Console, set application ID
com.yourcompany.roameasy, upload Android App Bundle. (PRD Section: Release Plan) - Validation: After CI artifacts are generated, trigger Fastlane lanes and confirm builds upload to TestFlight and Google Play internal tracks. (PRD Section: Release Plan)
All steps reference the provided documents and enforce exact versions and paths as specified.