A Streamlit application for managing gym memberships and generating financial reports.
Before you begin, ensure you have the following installed:
- Python (version 3.8 or higher)
Follow these steps to set up your local development environment.
First, create and activate a virtual environment to isolate project dependencies.
-
On macOS / Linux:
python3 -m venv .venv source .venv/bin/activate -
On Windows:
python -m venv .venv .\.venv\Scripts\activate
With your virtual environment active, install the required Python packages using the requirements.txt file.
pip install -r requirements.txtA shell script run_app.sh is provided to automate the entire setup and launch process. This script will:
- Create a virtual environment (if it doesn't exist).
- Activate the virtual environment.
- Install all required dependencies.
- Run the data migration (initial setup).
- Launch the Streamlit application.
To use the script, navigate to the project's root directory in your terminal and run:
./run_app.shThis is the recommended way to run the application.
Note: If you are using the run_app.sh script, it handles this step automatically. These instructions are for manual setup.
Before running the application for the first time, you must migrate the historical data from the provided CSV files into the application's database.
Required Files: Ensure the following files are present in the root directory of the project:
Kranos MMA Members.xlsx - GC.csvKranos MMA Members.xlsx - PT.csv
Run the Migration Script:
Execute the following command from the project's root directory. This will create and populate the kranos_reporter.db SQLite database file.
python -m reporter.migrate_historical_dataYou only need to run this command once during the initial setup.
Note: If you are using the run_app.sh script, it handles this step automatically. These instructions are for manual setup.
Once the setup and data migration are complete, you can run the application.
Launch the Streamlit App: Execute the following command from the project's root directory. This will start the web server and open the application in your default browser.
python -m streamlit run reporter/main.pyTo ensure the application's logic is working correctly after making code changes, run the automated test suite.
Execute Pytest: With your virtual environment active, run the following command from the project's root directory:
pytest