-
Notifications
You must be signed in to change notification settings - Fork 0
Setup
This guide provides detailed instructions for setting up the ShowTrackr application on your local machine.
-
Python: You need Python installed. Version 3.13 or newer is recommended.
-
Check Installation: Open your terminal or command prompt and type
python --versionorpython3 --version. - Download: If you don't have Python or need a newer version, download it from the official website: python.org/downloads/
- Installation Note: During installation (especially on Windows), ensure you check the box that says "Add Python X.Y to PATH".
-
Check Installation: Open your terminal or command prompt and type
-
pip: Python package manager. It comes bundled with Python installations. You can check if it's installed by running
pip --versionorpip3 --versionin your terminal. If it's not installed, you can install it by following the instructions on the pip installation page. -
venv: Python virtual environment module. The setup script will attempt to install it if missing. You may need to install it manually if you encounter issues.
-
Git (Optional): Required only if you want to clone the repository directly. You can download the code as a ZIP file otherwise. Git Download
Choose one of the following methods:
You can download the latest release of the ShowTrackr code from the GitHub repository. This is the recommended method for most users.
- Go to the GitHub repository releases: ShowTrackr-Web
- Make sure the release have the latest version.
- Click on "ShowTrackr-Web-vX.X.X.zip" (where X.X.X is the version number).
- Save the ZIP file to your computer.
- Extract the ZIP file to a location of your choice.
- Open your terminal or command prompt and navigate into the extracted folder (e.g.,
cd path/to/ShowTrackr-Web-vX.X.X).
Method A: Downloading ZIP
- Go to the GitHub repository: github.com/Exonymos/ShowTrackr-Web
- Click the green "<> Code" button.
- Select "Download ZIP".
- Extract the downloaded ZIP file to a location of your choice.
- Open your terminal or command prompt and navigate into the extracted folder (e.g.,
cd path/to/ShowTrackr-Web-main).
Method B: Using Git (needs Git installed)
-
Download and install Git from git-scm.com if you haven't already.
-
Open your terminal or command prompt.
-
Navigate to the directory where you want to clone the repository (e.g.,
cd path/to/your/directory). -
Run the following command to clone the repository:
git clone https://github.com/Exonymos/ShowTrackr-Web.git
-
Navigate into the cloned directory:
cd ShowTrackr-Web
These steps assume you are in the project's root directory (ShowTrackr-Web) in your terminal.
Recommended: Using Setup Scripts (Easiest)
The project includes convenience scripts to automate the setup process (creating the virtual environment and installing requirements):
-
Linux/macOS:
chmod +x setup.sh # Make executable (only need to do once) ./setup.sh -
Windows:
setup.bat
After running the setup script, you still need to perform Step 3 (Configure .env) manually. Remember to activate the virtual environment (source .venv/bin/activate or .\.venv\Scripts\activate) before running the application.
Manual Setup (If you prefer to do it yourself)
1. Create and Activate Virtual Environment (Highly Recommended)
A virtual environment keeps the project's dependencies separate from your global Python installation.
-
Create:
python -m venv .venv
(If
pythondoesn't work, trypython3) -
Activate:
-
Windows (Command Prompt):
.\.venv\Scripts\activate.bat -
Windows (PowerShell):
.\.venv\Scripts\Activate.ps1(If you get an execution policy error, run PowerShell as Administrator and execute:Set-ExecutionPolicy RemoteSigned -Scope CurrentUser. Then try activating again.) -
Linux:
source .venv/bin/activate
You should see
(.venv)at the beginning of your terminal prompt after activation. -
Windows (Command Prompt):
2. Install Dependencies
Ensure your virtual environment is active. Then run:
pip install -r requirements.txtThis command reads the requirements.txt file and installs all the necessary Python libraries (Flask, SQLAlchemy, HTMX, etc.) into your virtual environment.
3. Configure Environment Variables (.env file)
The application needs a secret key for security. This is stored in a .env file within the data/ directory.
-
Navigate to
data/: If thedatadirectory doesn't exist, create it. -
Create
.env: Create a file named exactly.env(note the leading dot) inside thedata/directory. -
Add Content: Copy and paste the following into the
.envfile:# Flask Secret Key (Required) # IMPORTANT: Replace with a strong, unique secret key! SECRET_KEY='YOUR_SUPER_SECRET_KEY_HERE' # Flask App Configuration FLASK_APP=src/watchlist # Flask Debug Mode # IMPORTANT: Set FLASK_DEBUG=False for production/deployment! FLASK_DEBUG=True # Database URL # Path relative to the src/watchlist directory where Flask runs DATABASE_URL=sqlite:///../data/database.db # Feedback URL GOOGLE_APPS_SCRIPT_FEEDBACK_URL='https://script.google.com/macros/s/AKfycbwgakVifq4XkMRUMYvcRuR3083z6tn4cmjx7kwQCn5zNBwGJxEObKf5zGTI5an0A2rwvQ/exec' GOOGLE_SHEET_PUBLIC_URL='https://docs.google.com/spreadsheets/d/1OW1PQTpdOcJK3bWLHsjkNuHZBkXp_RpLMel4IlDMrLg'
-
Generate Secret Key: Replace
'YOUR_SUPER_SECRET_KEY_HERE'with a strong, random key. You can generate one using Python in your terminal:python -c "import secrets; print(secrets.token_hex(24))"Copy the output and paste it between the single quotes for
SECRET_KEY=. It should look something like this:SECRET_KEY='a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6'
-
Security: The
.gitignorefile is configured to prevent thedata/directory (including.envand your database) from being accidentally committed to Git. Never share your.envfile or commit it to version control.
4. Initialize the Database (First Time Only)
If this is your first time setting up the project, you need to initialize the database and create the tables:
Make sure you have activated your virtual environment and set the environment variables.
-
Check if
.venvis active: You should see(.venv)at the beginning of your terminal prompt. If not, activate it using the command from Step 1. -
Set environment variables:
-
Windows (Command Prompt):
set FLASK_APP=src/watchlist -
Windows (PowerShell):
$env:FLASK_APP="src/watchlist" -
Linux:
export FLASK_APP="src/watchlist"
-
Windows (Command Prompt):
-
If the
migrations/folder does not exist, run:flask db init
-
Create the initial migration:
flask db migrate -m "Initial migration" -
Apply the migration to create the tables:
flask db upgrade
You only need to run these commands once for a new setup, or after changing the database models.
Setup is complete! You can now proceed to Running the Application.