scaffold: project structure, config, Flask app factory, test fixtures

Made-with: Cursor
This commit is contained in:
cottongin
2026-04-06 14:53:49 -04:00
commit 88e359069d
9 changed files with 138 additions and 0 deletions

29
app.py Normal file
View File

@@ -0,0 +1,29 @@
import os
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
import config
db = SQLAlchemy()
def create_app():
app = Flask(__name__)
app.config.from_object(config)
app.config["SECRET_KEY"] = os.urandom(24)
os.makedirs(config.DATA_DIR, exist_ok=True)
os.makedirs(config.IMAGES_DIR, exist_ok=True)
os.makedirs(config.ISSUES_DIR, exist_ok=True)
db.init_app(app)
with app.app_context():
from src import models # noqa: F401
db.create_all()
return app
if __name__ == "__main__":
app = create_app()
app.run(host="0.0.0.0", port=5000, debug=True)