Skip to content

Latest commit

 

History

History
137 lines (104 loc) · 2.97 KB

File metadata and controls

137 lines (104 loc) · 2.97 KB

Team Development Setup Guide

🌐 Making the App Work for Everyone

Quick Setup for Team Members

Method 1: Local Development (Recommended)

  1. Get Your IP Address:

    # Windows
    ipconfig
    
    # Mac/Linux  
    ifconfig
  2. Update API Configuration:

    • Open constants/apiConfig.js
    • Update the getLocalIP() function with your IP:
    const getLocalIP = () => {
      return 'YOUR_IP_HERE'; // Replace with your actual IP
    };
  3. Start Backend Server:

    cd backend
    npm install  # Only needed first time
    npm start
  4. Start Frontend:

    npx expo start

Method 2: Use ngrok (Global Access)

  1. Install ngrok:

    npm install -g ngrok
  2. Start your backend server:

    cd backend && npm start
  3. In a new terminal, expose your backend:

    ngrok http 5000
  4. Copy the ngrok URL (looks like https://abc123.ngrok.io)

  5. Update apiConfig.js:

    const API_CONFIG = {
      DEVELOPMENT: {
        BASE_URL: 'https://abc123.ngrok.io', // Your ngrok URL
        API_URL: 'https://abc123.ngrok.io/api'
      }
    };

Method 3: Deploy Backend (Production)

  1. Deploy to Heroku/Railway/Vercel
  2. Update apiConfig.js:
    const useProduction = true; // Enable production mode
  3. Set your production URL in PRODUCTION config

🔄 For Each Team Member

Quick Steps:

  1. Clone the repo
  2. Install dependencies: npm install (frontend) and cd backend && npm install
  3. Update your IP in constants/apiConfig.js
  4. Start backend: cd backend && npm start
  5. Start frontend: npx expo start

Current Team IPs:

  • Team Member 1: 192.168.21.95 (original setup)
  • Team Member 2: 192.168.0.105 (current)
  • Your IP: ___________ (fill in your IP)

🚀 Recommended: Deploy Backend for Permanent Solution

Free Hosting Options:

  • Railway.app (easiest for Node.js)
  • Heroku (popular choice)
  • Render.com (free tier)
  • Vercel (for API routes)

One-time setup benefits:

  • ✅ Works for everyone automatically
  • ✅ No IP address changes needed
  • ✅ Works on mobile devices
  • ✅ Professional deployment

🛠️ Troubleshooting

"Network Error"

  • Backend server not running
  • Wrong IP address in config
  • Firewall blocking connections

"Can't connect"

  • Check if backend is running on port 5000
  • Verify IP address is correct
  • Make sure you're on the same network

"Module not found"

  • Run npm install in both frontend and backend
  • Restart metro bundler: npx expo start --clear

📱 Testing Checklist

  • Backend server starts without errors
  • Database connects successfully
  • Frontend can reach backend API
  • Login/registration works
  • App navigation flows properly

Need help? Check the console logs for specific error messages!