import os

from flask import Flask
from .routes import main
from .api import api
from .auth import init_auth
from dotenv import load_dotenv

load_dotenv()


def create_app():
    app = Flask(__name__)
    app.secret_key = os.getenv("SECRET_KEY")
    app.register_blueprint(main)
    app.register_blueprint(api, url_prefix='/api')

    init_auth(app)

    return app
