Deployment - Kaleemunnisa/CS691-Spring2025-Team6 GitHub Wiki
# π Deployment Manual
This document provides step-by-step instructions to deploy and run the application in a **production or local setup** environment. It is designed for **developers outside the original team** to get the app running smoothly.
---
## π Project Overview
- **Frontend**: Expo (React Native, SDK 52) β requires Node.js v18 or above (tested with v22)
- **Backend**: FastAPI β requires Python 3
- **Startup Script**: `start.sh` handles both frontend and backend launch
- **Environment**: `.env` required for frontend
---
## β
Prerequisites
Ensure you have the following installed on your system:
- Node.js (v18+ recommended)
- Python 3 and pip3
- Git
- Expo CLI:
```bash
npm install -g expo-cli
```
You can run the entire app (both frontend and backend) using the provided script:
chmod +x start.sh
./start.sh
This will:
- Start the FastAPI backend (on port 8000)
- Start the Expo frontend development server
π Ensure environment variables are set correctly before running the script.
npm install --legacy-peer-deps
β οΈ Use this to avoid common peer dependency conflicts.
If a dependency causes issues, install it via Expo:
npx expo install <module-name>
Create a .env
file in the frontend root directory.
You can copy from .env.example
:
cp .env.example .env
# π API Keys
GEOAPIFY_KEY=your_geoapify_api_key_here
TICKETMASTER_API_KEY=your_ticketmaster_api_key_here
# π₯ Firebase Configuration
FIREBASE_API_KEY=your_firebase_api_key
FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
FIREBASE_PROJECT_ID=your_project_id
FIREBASE_STORAGE_BUCKET=your_project_storage_bucket
FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id
FIREBASE_APP_ID=your_firebase_app_id
# π Backend API Endpoint
RECOMMEND_API_URL=http://your-backend-host:8000/events/recommend
β οΈ Do not commit the actual.env
file. Use.env.example
in version control.
Hereβs the revised section with a recommendation to use a Python virtual environment (venv) for better isolation and manageability:
It's best practice to use a virtual environment to avoid dependency conflicts:
python3 -m venv venv
source venv/bin/activate # On Linux or macOS
# OR
venv\Scripts\activate # On Windows
Make sure you are in the backend directory:
pip3 install -r requirements.txt
Recommended production command using uvicorn
:
uvicorn main:app --host 0.0.0.0 --port 8000 --workers 4
π This allows the backend to be accessed from external devices (like mobile phones on the same network).
Set the backend URL in your frontend .env
:
RECOMMEND_API_URL=http://<your-ip>:8000/events/recommend
π§ Replace
<your-ip>
with your local IP address or public server IP.
Let me know if you'd like this change added to the full markdown file again.
-
Backend: Open a browser and visit
http://<your-ip>:8000/docs
to access the Swagger UI. - Frontend: The Expo Dev Tools UI should launch automatically. Use QR code or emulator to test.
- Use consistent environments across team members (Node.js 18+, Python 3)
- Use
npx expo install
to avoid breaking SDK compatibility - Keep
.env
files private - Use
start.sh
for hassle-free local development
-
Port already in use? Use
lsof -i :8000
(or:19000
for Expo) to identify and kill conflicting processes. - Expo not detecting device? Ensure your phone and computer are on the same network.