The following steps are based on Ubuntu Linux 24.04 LTS. Please adjust the commands accordingly for other environments.
-
Clone the repository:
git clone https://github.com/helios-base/ST-Pitch.git cd ST-Pitch -
Set up the PostgreSQL database and PostGIS extension.
sudo apt-get install postgresql postgresql-contrib postgis sudo systemctl enable --now postgresql -
Create a new database. Start the PostgreSQL shell (psql) as the postgres user:
sudo -u postgres psql
In the PostgreSQL shell, run:
CREATE USER your_user WITH PASSWORD 'your_password'; -- Replace with your desired username and password CREATE DATABASE your_db OWNER your_user; -- Replace with your desired database name and owner \c your_db -- Connect to the newly created database CREATE EXTENSION postgis; \q -- Exit the PostgreSQL shell
-
Create a virtual environment and install the required Python packages.
python3 -m venv venv source venv/bin/activate pip install -r requirements.txt -
Set up the database configuration using the
.envfile. The project uses a.envfile for database and application configuration. To set up your environment:- Create a symbolic link from
dot.envto.env:
ln -s dot.env .env
- Edit
.envand replace the placeholders with your actual values:
# Database Configuration DB_NAME=your_db DB_USER=your_user DB_PASSWORD=your_password DB_HOST=localhost DB_PORT=5432 # Flask Configuration SECRET_KEY=your_secret_key
The
.envfile is automatically loaded when the application starts and is excluded from version control for security reasons. - Create a symbolic link from
-
Run the Flask application.
./run.sh
-
Access the web application by navigating to
http://localhost:5000in your web browser.
- Ensure that you have the necessary permissions and configurations for the PostgreSQL database and PostGIS extension to run the application successfully.
- The database name, user, and password shown above are placeholders. Replace them with your actual database credentials.
- If you are deploying the application on a public server, consider using a WSGI server such as uWSGI or Gunicorn. A reverse proxy such as Nginx can also improve security and performance.