Unified repository for Moldi’s FastAPI backend and Expo mobile application.
loop/
├── apps/
│ ├── api/ # FastAPI backend (Python 3.11)
│ └── mobile/ # Expo + React Native mobile app <-- the ONLY mobile project
├── packages/
│ └── shared/ # Shared types and utilities (empty for now)
├── pnpm-workspace.yaml
├── package.json # Root workspace scripts (no app entry point, by design)
├── docker-compose.yml
├── .env
└── README.md
All mobile builds run from
apps/mobile. The repository root has noapp.json,eas.json,metro.config.jsor nativeandroid//ios/directories — it is a workspace container, not an application. A stale second Expo project used to live here; runningeas buildfrom the root now fails immediately rather than producing a build with the wrong version code and no Firebase or AppsFlyer wiring.
npm install -g pnpm)# Install Node.js dependencies (all workspaces)
pnpm install
# Install Python dependencies for backend
pnpm install:api
# Copy environment template
cp .env.example .env
# Edit .env with your configuration
# At minimum, update these values:
# - JWT_SECRET (generate a secure random string)
# - CLOUDINARY_* (if using uploads)
# - EXPO_PUBLIC_API_BASE_URL (mobile's backend URL)
# Optional: host-only overrides (recommended for local CLI commands)
# Create a .env.local with values that should override .env on your machine.
# Example (use localhost when running Alembic locally):
# DATABASE_URL=postgresql+psycopg2://loop:loop@localhost:5432/loop
# REDIS_URL=redis://localhost:6379
# Start PostgreSQL and Redis
pnpm docker:up
# Run database migrations
pnpm db:migrate
# Start both backend and mobile in parallel
pnpm dev
# Or start individually:
pnpm dev:api # Backend only (http://localhost:8000)
pnpm dev:mobile # Mobile only (Expo DevTools)
pnpm dev - Start both backend and mobile in parallelpnpm dev:api - Start backend onlypnpm dev:mobile - Start mobile onlypnpm install:api - Install Python dependenciespnpm docker:up - Start Docker services (PostgreSQL + Redis)pnpm docker:down - Stop Docker servicespnpm db:migrate - Run Alembic migrationspnpm db:revision - Create new migration (pass -m "message")pnpm ios - Run iOS app via @loop/mobile workspacepnpm android - Run Android app via @loop/mobile workspacecd apps/api
source .venv/bin/activate
# Development
uvicorn app.main:app --reload
# Database
alembic upgrade head
alembic revision --autogenerate -m "migration name"
alembic downgrade -1
# Testing
pytest
cd apps/mobile
# Development
pnpm start # Start Expo DevTools
pnpm android # Open on Android device
pnpm ios # Open on iOS device
# Utilities
pnpm seed:messages # Seed test messages
pnpm triage:android-launch # Collect launch/crash diagnostics from adb
pnpm triage:ios-launch # Collect launch/crash diagnostics from xcrun simctl
Key Features:
Key Features:
Defined in pnpm-workspace.yaml:
packages:
- 'apps/*'
- 'packages/*'
Dependencies are hoisted to root node_modules/ for efficiency.
Mobile app uses metro.config.js to resolve dependencies from monorepo root:
watchFolders: [monorepoRoot]node_modules/ pathsServices:
The backend reads .env and then .env.local (local overrides win). Use .env.local for host-only settings (e.g., localhost DB/Redis) while keeping Docker defaults in .env.
See .env.example for full list. Key variables:
DATABASE_URL - PostgreSQL connection stringJWT_SECRET - Secret for JWT token signingGOOGLE_OAUTH_* - Google Sign-In server-side verification configCLOUDINARY_* - Image upload credentialsSENTRY_DSN - Error monitoringREVENUECAT_WEBHOOK_SECRET - Payment webhooksEXPO_PUBLIC_API_BASE_URL - Backend API URL (e.g., http://localhost:8000/api)EXPO_PUBLIC_GOOGLE_*_CLIENT_ID - OAuth credentialsNote: Expo only exposes variables with EXPO_PUBLIC_ prefix to the app.
python3.11 --versioncd apps/api && source .venv/bin/activatedocker ps (should show postgres:16).env has DATABASE_URL setcd apps/mobile && pnpm start --clearnode_modules/ exists at root: ls node_modules/expolocalhost with your computer’s local IP in .env:
EXPO_PUBLIC_API_BASE_URL=http://192.168.x.x:8000/api
0.0.0.0 (not 127.0.0.1)DEVELOPER_ERROR (Play closed testing)cd apps/mobile && pnpm triage:google-signin
Setup -> App integrity), copy SHA-1/SHA-256 from App signing certificateAPIs & Services -> Credentials), update Android OAuth client for package com.moldi.app with those fingerprintsdocker pspsql postgresql://loop:loop@localhost:5432/looppnpm docker:down
docker volume rm loop_pgdata
pnpm docker:up
pnpm db:migrate
This monorepo consolidates:
/Users/ardaerdogan/Documents/GitHub/loop-backend/backend/ → apps/api//Users/ardaerdogan/loop-mobile/ → apps/mobile/Git history was reset for simplicity. Old repositories remain at original paths for reference.
# Start everything
pnpm dev
This runs:
# Backend only
pnpm dev:api
# Mobile only
pnpm dev:mobile
pnpm dev:apiifconfig | grep "inet ".env:
EXPO_PUBLIC_API_BASE_URL=http://192.168.x.x:8000/api
pnpm dev:mobileThis project is proprietary software. All rights reserved. See LICENSE for details.