
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
from flask_restful import Api, Resource, url_for, reqparse, request
from marshmallow_sqlalchemy import SQLAlchemyAutoSchema

app = Flask(__name__)
app.config['SECRET_KEY'] = ''
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///site.db'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True

db = SQLAlchemy(app)
ma = Marshmallow(app)

# from StageHubAPI.main.routes import main
# app.register_blueprint(main)

from StageHubAPI.main.routes import main_bp
app.register_blueprint(main_bp)
from StageHubAPI.project.routes import project_bp
app.register_blueprint(project_bp)
from StageHubAPI.account.routes import account_bp
app.register_blueprint(account_bp)

def create_app():
    db.init_app(app)
    ma.init_app(app)
    return app
