Flask backend with Vue 3 frontend for shop floor machine management. Includes database schema export for MySQL shopdb_flask database. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
26 lines
637 B
Python
26 lines
637 B
Python
"""Flask extensions initialization."""
|
|
|
|
from flask_sqlalchemy import SQLAlchemy
|
|
from flask_migrate import Migrate
|
|
from flask_jwt_extended import JWTManager
|
|
from flask_cors import CORS
|
|
from flask_marshmallow import Marshmallow
|
|
|
|
# Initialize extensions without app
|
|
db = SQLAlchemy()
|
|
migrate = Migrate()
|
|
jwt = JWTManager()
|
|
cors = CORS()
|
|
ma = Marshmallow()
|
|
|
|
|
|
def init_extensions(app):
|
|
"""Initialize all Flask extensions with app."""
|
|
db.init_app(app)
|
|
migrate.init_app(app, db)
|
|
jwt.init_app(app)
|
|
cors.init_app(app, resources={
|
|
r"/api/*": {"origins": app.config.get('CORS_ORIGINS', '*')}
|
|
})
|
|
ma.init_app(app)
|