Skip to content

Developer Setup

This guide covers everything needed to run the Player Wellness App locally for development and testing.


Prerequisites

Tool Version Notes
Python 3.11+
PostgreSQL 16+ Via Homebrew on macOS
Git Any recent
VS Code Any recent Recommended editor

1. Clone the repository

git clone https://github.com/your-username/player_wellness_registration.git
cd player_wellness_registration

2. Create a virtual environment

python -m venv .venv
source .venv/bin/activate        # macOS / Linux
.venv\Scripts\activate           # Windows

3. Install dependencies

pip install -r requirements.txt

For documentation development, install mkdocs separately:

pip install mkdocs mkdocs-material

4. Set up PostgreSQL

Install via Homebrew on macOS:

brew install postgresql@16
brew services start postgresql@16

Create the database:

psql postgres
CREATE DATABASE wellness;
\q

5. Configure secrets

Create the Streamlit secrets file:

mkdir -p .streamlit
touch .streamlit/secrets.toml

Add the following to .streamlit/secrets.toml:

[database]
postgres_url = "postgresql://localhost/wellness"

Warning

Never commit secrets.toml to version control. Verify it is listed in .gitignore before pushing.


6. Seed the players table

The app requires at least one player record before the selectbox will populate. On first run, the app creates all tables automatically. Then seed a test player using a database client or psql:

INSERT INTO players (player_id, player_first_name, player_last_name, team)
VALUES (99, 'Test', 'Player', 'U21');

7. Run the app

streamlit run main.py

The app will be available at http://localhost:8501.


8. Preview the documentation

mkdocs serve

The docs site will be available at http://localhost:8000 with live reload on save.


VS Code extensions

The following extensions are recommended:

  • Python (Microsoft) — linting, formatting, IntelliSense
  • SQLTools — database browser and query runner
  • SQLTools PostgreSQL Driver — connects SQLTools to PostgreSQL