Skip to content

Database Deployment

The application utilizes two PostgreSQL databases, which are deployed and configured using custom Python scripts: deploy_db.py (for the main application data) and deploy_stock_index_db.py (for the stock ticker index).

These deployment scripts perform several key functions:

  1. Check Existence: They verify if the target database already exists before attempting creation.
  2. Create Database: If the database doesn’t exist, the script creates it.
  3. Create Tables: They connect to the database and create all necessary tables based on the SQLAlchemy models defined in the application.
  4. Enable Extensions: Essential PostgreSQL extensions, such as pg_trgm for trigram indexing (used in stock recommendations), are enabled to enhance database performance and functionality.

This scripted approach ensures a consistent and repeatable database setup process.