from flask import Flask
import os
from .extensions import db, migrate

def create_app():
    app = Flask(__name__)
    app.config.from_object('salary_analytics.config')

    # Initialize extensions
    db.init_app(app)
    migrate.init_app(app, db)

    # Register blueprints or CLI commands here if needed
    from . import commands
    app.cli.add_command(commands.upload_xls_cli)

    return app 