#!/usr/bin/env python3 """ BalanceBoard Application Runner Starts the Flask web app with PostgreSQL/SQLAlchemy integration. """ import os import sys from app import app def main(): """Initialize and run the application""" print("=" * 60) print("BalanceBoard - Content Feed Application") print("=" * 60) print() print("Database: PostgreSQL with SQLAlchemy") print("Authentication: bcrypt + Flask-Login") print() # Check if we can import the database components try: from database import init_db from models import User print("✓ Database modules imported successfully") except ImportError as e: print(f"✗ Error importing database modules: {e}") print("Please ensure all dependencies are installed:") print("pip install -r requirements.txt") sys.exit(1) # Database is already initialized in app.py print("✓ Database initialized successfully") # Print access info host = os.getenv('FLASK_HOST', '0.0.0.0') port = int(os.getenv('FLASK_PORT', '5021')) print() print("=" * 60) print("Server starting...") print(f" URL: http://localhost:{port}") print(f" Login: http://localhost:{port}/login") print(f" Sign Up: http://localhost:{port}/signup") print(f" Admin: http://localhost:{port}/admin") print("=" * 60) print() print("Press Ctrl+C to stop") print() # Run Flask app debug_mode = os.getenv('FLASK_DEBUG', 'True').lower() == 'true' app.run(host=host, port=port, debug=debug_mode) if __name__ == '__main__': main()