> ## Documentation Index
> Fetch the complete documentation index at: https://docs.joinfindu.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Common Development Tasks

> How to perform common development operations

# Common Development Tasks

This guide covers how to perform common development tasks across the FindU platform. Since we no longer have a centralized CLI, each task is performed directly in the relevant repository.

## Repository Management

### Cloning Repositories

```bash theme={null}
# Create workspace
mkdir ~/findu && cd ~/findu

# Clone the repositories you need
git clone https://github.com/findu-app/ios_app.git
git clone https://github.com/findu-app/web_app.git
git clone https://github.com/findu-app/matching-algorithm.git
git clone https://github.com/findu-app/data_scraping.git
git clone https://github.com/findu-app/docs.git
```

### Keeping Repositories Updated

```bash theme={null}
# Update all repositories
for repo in */; do
  echo "Updating $repo..."
  cd "$repo"
  git pull origin main
  cd ..
done
```

## Environment Setup

### Web App

```bash theme={null}
cd web_app
npm install
cp .env.example .env  # Then add your credentials
npm run dev
```

### iOS App

```bash theme={null}
cd ios_app
# Create Secrets.xcconfig with your credentials
open ios_app.xcodeproj
```

### Matching Algorithm

```bash theme={null}
cd matching-algorithm
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env  # Then add your credentials
cd api_v2 && python main.py
```

## Running Tests

### Web App Tests

```bash theme={null}
cd web_app
npm run test
npm run test:e2e
npm run typecheck
npm run lint
```

### Matching Algorithm Tests

```bash theme={null}
cd matching-algorithm
pytest
pytest --cov=src --cov-report=html
```

### iOS App Tests

```bash theme={null}
cd ios_app
# Run tests in Xcode with Cmd+U
xcodebuild test -scheme ios_app -destination 'platform=iOS Simulator,name=iPhone 15'
```

## Database Operations

### Using Supabase CLI

```bash theme={null}
# Install if needed
brew install supabase/tap/supabase

# Login and link to project
supabase login
supabase link --project-ref your-project-id

# Create a migration
supabase migration new your_migration_name

# Run migrations locally
supabase db reset
supabase migration up

# Push to production (be careful!)
supabase db push --linked
```

### Generate TypeScript Types

```bash theme={null}
cd web_app
supabase gen types typescript --linked > src/types/supabase.ts
```

## Documentation

### Preview Documentation Locally

```bash theme={null}
cd docs
npm install -g @mintlify/cli  # If not installed
mintlify dev
# Opens at http://localhost:3000
```

### Create New Documentation

```bash theme={null}
cd docs
# Create a new MDX file in the appropriate directory
# Update mint.json navigation if needed
```

## Deployment

### Web App Deployment

```bash theme={null}
cd web_app
# Commits to main branch auto-deploy via Railway
git add .
git commit -m "Your changes"
git push origin main
```

### Matching Algorithm Deployment

```bash theme={null}
cd matching-algorithm
# Commits to main branch auto-deploy via Railway
git add .
git commit -m "Your changes"
git push origin main
```

### iOS App Deployment

```bash theme={null}
cd ios_app
# Use Xcode to archive and upload to TestFlight
# Product → Archive → Distribute App
```

## Data Scripts

### Update School Data

```bash theme={null}
cd data_scraping/fetch-api
npm install
npx ts-node index.ts
```

### Scrape School Images

```bash theme={null}
cd data_scraping/scrape-images
npm install
npm start  # Full run
npm test -- SCHOOL_ID  # Test single school
```

### Enhance School Data

```bash theme={null}
cd data_scraping/enhance-colleges
pip install -r requirements.txt
python enhance_colleges.py --test  # Test 5 schools
python enhance_colleges.py --limit 50  # Process 50 schools
```

## Common Workflows

### Starting Your Day

```bash theme={null}
# 1. Update all repositories
cd ~/findu
for repo in */; do
  cd "$repo" && git pull origin main && cd ..
done

# 2. Start the services you need
cd web_app && npm run dev &
cd ../matching-algorithm/api_v2 && python main.py &
```

### Before Creating a PR

```bash theme={null}
# 1. Run tests
npm run test  # or pytest

# 2. Check linting
npm run lint  # or flake8

# 3. Verify types
npm run typecheck

# 4. Test locally against production
# (Be careful with production data!)
```

### Debugging Production Issues

```bash theme={null}
# 1. Check Railway logs
# Go to Railway dashboard for the service

# 2. Check Supabase logs
# Go to Supabase dashboard → Logs

# 3. Query production data (read-only)
supabase db execute --sql "SELECT * FROM students WHERE email LIKE '%test%'" --linked
```

## Quick Reference

| Task               | Command                  | Location                     |
| ------------------ | ------------------------ | ---------------------------- |
| Start web app      | `npm run dev`            | `web_app/`                   |
| Start matching API | `python main.py`         | `matching-algorithm/api_v2/` |
| Run web tests      | `npm run test`           | `web_app/`                   |
| Run Python tests   | `pytest`                 | `matching-algorithm/`        |
| Create migration   | `supabase migration new` | Any directory                |
| View docs          | `mintlify dev`           | `docs/`                      |
| Update schools     | `npx ts-node index.ts`   | `data_scraping/fetch-api/`   |

## Tips

1. **Always work with test data** when developing against production
2. **Check logs frequently** in Railway and Supabase dashboards
3. **Use feature branches** and get PR reviews before merging
4. **Keep dependencies updated** but test thoroughly
5. **Document your changes** in code comments and PRs

***

For more detailed information about specific components, check their individual README files or the [architecture overview](/architecture).
