35 lines
No EOL
1 KiB
Python
35 lines
No EOL
1 KiB
Python
from flask import Flask
|
|
from flask_sqlalchemy import SQLAlchemy
|
|
from flask_login import LoginManager
|
|
from flask_migrate import Migrate
|
|
from config import Config
|
|
|
|
db = SQLAlchemy()
|
|
login_manager = LoginManager()
|
|
migrate = Migrate()
|
|
|
|
def create_app():
|
|
app = Flask(__name__)
|
|
app.config.from_object(Config)
|
|
|
|
db.init_app(app)
|
|
login_manager.init_app(app)
|
|
migrate.init_app(app, db)
|
|
|
|
# Register blueprints for modular routes
|
|
from .routes.admin import admin_bp
|
|
from .routes.auth import auth_bp
|
|
from .routes.customer import customer_bp
|
|
from .routes.repair import repair_bp
|
|
from .routes.inventory import inventory_bp
|
|
from .routes.technician import technician_bp
|
|
from .routes.audit import audit_bp
|
|
app.register_blueprint(admin_bp)
|
|
app.register_blueprint(auth_bp)
|
|
app.register_blueprint(customer_bp)
|
|
app.register_blueprint(repair_bp)
|
|
app.register_blueprint(inventory_bp)
|
|
app.register_blueprint(technician_bp)
|
|
app.register_blueprint(audit_bp)
|
|
|
|
return app |