Initial commit
This commit is contained in:
29
app/__init__.py
Normal file
29
app/__init__.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from flask import Flask
|
||||
from app.config import Config
|
||||
from app.db import init_db, close_db
|
||||
|
||||
|
||||
def create_app():
|
||||
app = Flask(__name__)
|
||||
app.config.from_object(Config)
|
||||
|
||||
# Database lifecycle
|
||||
init_db(app)
|
||||
app.teardown_appcontext(close_db)
|
||||
|
||||
# Register blueprints
|
||||
from app.routes.auth import bp as auth_bp
|
||||
from app.routes.dashboard import bp as dashboard_bp
|
||||
from app.routes.checkin import bp as checkin_bp
|
||||
from app.routes.profile import bp as profile_bp
|
||||
from app.routes.leaderboard import bp as leaderboard_bp
|
||||
from app.routes.api import bp as api_bp
|
||||
|
||||
app.register_blueprint(auth_bp)
|
||||
app.register_blueprint(dashboard_bp)
|
||||
app.register_blueprint(checkin_bp)
|
||||
app.register_blueprint(profile_bp)
|
||||
app.register_blueprint(leaderboard_bp)
|
||||
app.register_blueprint(api_bp)
|
||||
|
||||
return app
|
||||
Reference in New Issue
Block a user