A full-stack application for forecasting city-to-city migration patterns using time-series analysis and machine learning. The system enables scenario-based simulations (e.g., Spring Festival, COVID-19) and provides interactive visualizations of migration flows.
This project combines time-series forecasting models (XGBoost) with interactive geospatial visualization to predict and analyze inter-city migration patterns. Users can explore different scenarios and visualize migration flows through an intuitive web interface powered by Kepler.gl.
The project is organized into four main components:
- Frontend: React + TypeScript web application with Kepler.gl for interactive map visualizations
- Backend: FastAPI REST API handling data requests and forecasting operations
- Model: XGBoost-based time-series forecasting models and two-stage method with scenario simulation capabilities
- Data: City-to-city migration datasets with geographic coordinates
- Python 3.8+ with pip
- Node.js 16+ with npm
-
Install Python dependencies:
pip install -r requirements.txt
-
Start the FastAPI server:
cd backend uvicorn main:app --reloadThe API will be available at
http://localhost:8000
-
Install Node.js dependencies:
cd frontend npm install -
Start the development server:
npm run dev
The frontend will be available at
http://localhost:5173
- Ensure both backend and frontend servers are running
- Open
http://localhost:5173in your browser - Select scenarios, date ranges, and geographic filters to explore migration forecasts
migration-project/
├── backend/ # FastAPI application
├── frontend/ # React + TypeScript application
├── prediction_model/ # XGBoost forecasting models & two stage method
├── requirements.txt # Python dependencies
└── README.md # This file
This project is intended for coursework or demonstration purposes.