Skip to content

Development Guide

This guide explains how to set up and run the Sports Live project locally for development.
Follow these steps to ensure your environment is consistent with the rest of the team.


Before starting, make sure you have these tools installed:

  • Git (version control) → Download
  • Node.js (LTS)Download
  • npm (comes with Node.js) or pnpm/yarn as a package manager
  • Firebase CLIInstall
  • VS CodeDownload
  • Docker (optional, for containerized setup) → Download

Terminal window
git clone https://github.com/DevHackerGamer/sports-live.git
cd sports-live


Run the app with mock API calls (no real API usage):

Terminal window
npm start

Starts a development server using mock data. Helps avoid unnecessary API requests during development.

Run the app connected to real APIs:

Terminal window
npx vercel dev

Starts a development server connecting to actual APIs.

1.3 Combined Dev (React + Local API Proxy)

Section titled “1.3 Combined Dev (React + Local API Proxy)”

Run React with a local proxy mapping /api/* to handlers in api/:

Terminal window
npm run dev

React dev server → http://localhost:3000 Express proxy → http://localhost:3001

Login to Firebase CLI:

Terminal window
firebase login

Initialize Firebase:

Terminal window
firebase init

Select Firestore for database Select Authentication for user management

Add .env variables:

Terminal window
VITE_FIREBASE_API_KEY=<your_api_key>
VITE_FIREBASE_AUTH_DOMAIN=<your_project>.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=<your_project>
VITE_FIREBASE_STORAGE_BUCKET=<your_project>.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_ID=<your_sender_id>
VITE_FIREBASE_APP_ID=<your_app_id>
Terminal window
cd backend
npm install
npm run dev

Backend runs at http://localhost:5000

Firebase handles database and authentication.

Terminal window
cd frontend
npm install
npm run dev

Sign up: /auth/signup

Login: /auth/login → JWT or Firebase Auth token

Terminal window
npm run test
Terminal window
npm run test

Frontend runs at http://localhost:5173

Build locally: 7. Deploy to Azure (Container)

Build locally:

Terminal window
docker build \
-t sports-live:latest \
--build-arg REACT_APP_CLERK_PUBLISHABLE_KEY=pk_test_xxx .

Run locally:

Terminal window
docker run --rm -p 8080:8080 \
-e FOOTBALL_API_TOKEN=your_football_api_token \
sports-live:latest

Open http://localhost:8080

Notes:

REACT_APP_CLERK_PUBLISHABLE_KEY → public client key