Follow these steps to set up and run the dashboard after receiving the zip file:
- Windows:
- Right-click the zip file and select "Extract All..."
- Choose a folder and click "Extract"
- Mac:
- Double-click the zip file. A folder will appear in the same location.
- Download and install Python 3.8 or newer from python.org/downloads
- During installation, check the box that says "Add Python to PATH" (Windows only)
- Windows: Press
Win + R, typecmd, and press Enter - Mac: Open
Terminalfrom Applications > Utilities
- Type
cd(with a space), then drag the unzipped folder into the terminal window and press Enter.- Example (Windows):
cd C:\Users\YourName\Downloads\hk_health_dashboard - Example (Mac):
cd /Users/yourname/Downloads/hk_health_dashboard
- Example (Windows):
- Windows:
python -m venv venv venv\Scripts\activate
- Mac:
python3 -m venv venv source venv/bin/activate
- Windows:
pip install -r requirements.txt
- Mac:
pip3 install -r requirements.txt
- Attention: Make sure you see
(venv)in your terminal prompt before running the commands below. This means your virtual environment is activated and the correct Python and packages will be used. - Windows:
streamlit run main.py
- Mac:
python3 -m streamlit run main.py
- Your browser should open automatically. If not, go to [http://localhost:8501] ** First time loading the dashboard maybe taking up to 2-4 minutes as the application will be fetching the real time data
- Use the sidebar for navigation and instructions.
- Explore hospital wait times, maps, and route planning features.
- Go back to the terminal window and press
Ctrl + Cto stop.
If you have any issues, see the Troubleshooting section below or contact the project author.
- Real-time A&E wait times for all Hong Kong public hospitals
- Interactive map with hospital locations and color-coded wait times
- Route planning from your location to any hospital
- Search and view hospital details (address, telephone)
- Sidebar navigation with instructions and About Me section
- General disclaimer at the bottom of the dashboard
- How to Use: Sidebar expander with instructions for dashboard features
- Hospital Information: Sidebar expander with search bar and full hospital info
- About Me: Sidebar expander with student name, ID, and assignment info
- Use the search bar to find hospitals by name, address, or location (e.g., 'chai wan', 'queen mary', 'pok fu lam').
- View full hospital details including address and telephone number.
- When you select a hospital from the map or chart, its details are highlighted and shown at the top of this section.
- Browse all hospitals in the expandable list below the search bar.
- View the horizontal bar chart showing all hospitals
- Use filters to sort by wait time or region
- Click on any hospital bar to select it
- The map shows all hospitals with color-coded wait times
- Selected hospitals are highlighted with a purple border
- Choose from multiple map styles for better visualization
- Select a hospital by clicking its bar
- Enter your current location in the route input field
- View route details including duration, distance, and traffic
- Explore alternative routes and transport options
- Traffic legend appears to the right of the map
- A general disclaimer with student name and assignment info is shown at the bottom of the dashboard
- A&E Wait Times: Hong Kong Hospital Authority Open Data API
- Traffic Data: Mapbox Directions API (real-time)
- Maps: Mapbox
- Static Hospital Info: https://www.ha.org.hk/visitor/ha_visitor_index.asp?Content_ID=200246&lang=ENG
-
Import Errors
- Ensure virtual environment is activated
- Run
pip install -r requirements.txt
-
Mapbox Token Issues
- The token is already included in the zip file. If you see a token error, contact the project author.
-
API Connection Issues
- App includes fallback data if HK Hospital Authority API is unavailable
- Check internet connection
-
Port Already in Use
- Change port:
streamlit run main.py --server.port 8502
- Change port: