A web application that displays metro status information using React (Next.js) frontend and Flask backend.
- Python 3.11+
- Node.js 20+
- pip
- npm
# Navigate to backend directory
cd backend
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt -r requirements-dev.txt
# Run development server
gunicorn src.app:APP --bind 0.0.0.0:5001 --reload
# Run tests
pytest
# Run linting
pylint src/ tests/# Navigate to frontend directory
cd frontend
# Install dependencies
npm install
# Create .env.local file
echo "NEXT_PUBLIC_API_URL=http://localhost:5000" > .env.local
# Run development server
npm run dev
# Run tests
npm test
# Run linting
npm run lint- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
GET /api/health- Health check endpointGET /api/metro-status- Get metro status information
METRO_API_URL- URL of the external metro API
NEXT_PUBLIC_API_URL- URL of the backend API
# Build and run backend
cd backend
docker build -t metro-api .
docker run -p 5000:8080 metro-apicd backend
pytest # Run tests
tox # Run tests, linting, and type checkingcd frontend
npm test # Run tests
npm run lint # Run linting
npm run type-check # Run type checkingThe repository includes CI/CD workflows for both frontend and backend:
- Automated testing
- Linting
- Type checking
- Deployment to GCP (on develop branch)
.
├── backend/
│ ├── src/
│ │ ├── __init__.py
│ │ └── app.py
│ ├── tests/
│ ├── Dockerfile
│ └── requirements.txt
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ └── pages/
│ └── package.json
└── README.md