from flask import Flask
from flask_cors import CORS
from .routes.main import main_bp
from .routes.rag import rag_bp

def create_app():
    app = Flask(__name__)
    CORS(app)
    
    app.register_blueprint(main_bp)
    app.register_blueprint(rag_bp, url_prefix='/api/rag')
    
    return app
