From 35c93a8c10ed5b0147c0b35863770467c6084c49 Mon Sep 17 00:00:00 2001 From: ScriptSorcerer20 Date: Wed, 25 Feb 2026 11:51:14 +0100 Subject: [PATCH] Setup project with file structure and flask setup --- README.md | 45 ++++++++++++++++++++++++++ app/__init__.py | 18 +++++++++++ app/routes/main_routes.py | 7 ++++ app/templates/index.html | 66 ++++++++++++++++++++++++++++++++++++++ requirements.txt | Bin 0 -> 268 bytes run.py | 6 ++++ 6 files changed, 142 insertions(+) create mode 100644 app/__init__.py create mode 100644 app/routes/main_routes.py create mode 100644 app/templates/index.html create mode 100644 requirements.txt create mode 100644 run.py diff --git a/README.md b/README.md index fcc0790..9ff9134 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,47 @@ # acht-damen-tuerme-problem IDPA Arbeit im23a Kristian Anastasia und Jérôme + +``` +project-root/ +│ +├── app/ +│ ├── __init__.py # Flask App Factory +│ ├── config.py # Konfiguration (DB, Secrets, etc.) +│ │ +│ ├── models/ # Datenbankmodelle +│ │ ├── __init__.py +│ │ ├── user.py +│ │ ├── tenant.py +│ │ ├── membership.py +│ │ └── solver_job.py +│ │ +│ ├── routes/ # API/Endpoints +│ │ ├── __init__.py +│ │ ├── auth_routes.py +│ │ ├── tenant_routes.py +│ │ ├── solver_routes.py +│ │ └── job_routes.py +│ │ +│ ├── services/ # Businesslogik (Solver etc.) +│ │ ├── __init__.py +│ │ ├── solver_service.py +│ │ └── auth_service.py +│ │ +│ ├── templates/ # HTML (Jinja Templates) +│ │ ├── base.html +│ │ ├── login.html +│ │ ├── dashboard.html +│ │ └── solver.html +│ │ +│ ├── static/ # CSS, JS, Bilder +│ ├── css/ +│ ├── js/ +│ └── img/ +│ +├── tests/ # optionale Tests +│ +├── run.py # Startpunkt der Anwendung +├── requirements.txt +├── .env # DB-Zugangsdaten, Secrets +└── README.md +``` \ No newline at end of file diff --git a/app/__init__.py b/app/__init__.py new file mode 100644 index 0000000..6c3fb29 --- /dev/null +++ b/app/__init__.py @@ -0,0 +1,18 @@ +from flask import Flask + +def create_app(): + app = Flask(__name__) + + # Basic config + app.config["SECRET_KEY"] = "dev-secret-key" + + # # ---- Register Blueprints (Routes) ---- + # from .routes.auth_routes import auth_bp + # from .routes.solver_routes import solver_bp + from .routes.main_routes import main_bp + + # app.register_blueprint(auth_bp) + # app.register_blueprint(solver_bp) + app.register_blueprint(main_bp) + + return app diff --git a/app/routes/main_routes.py b/app/routes/main_routes.py new file mode 100644 index 0000000..c67ef5d --- /dev/null +++ b/app/routes/main_routes.py @@ -0,0 +1,7 @@ +from flask import Blueprint, render_template + +main_bp = Blueprint("main", __name__) + +@main_bp.route("/") +def home(): + return render_template("index.html") diff --git a/app/templates/index.html b/app/templates/index.html new file mode 100644 index 0000000..cab8a34 --- /dev/null +++ b/app/templates/index.html @@ -0,0 +1,66 @@ + + + + + + + {% block title %}Solver App{% endblock %} + + + + + {% block head_extra %}{% endblock %} + + + + + + + + +
+ {% with messages = get_flashed_messages(with_categories=true) %} + {% if messages %} +
+ {% for category, message in messages %} +
+ {{ message }} +
+ {% endfor %} +
+ {% endif %} + {% endwith %} + + + {% block content %}{% endblock %} +
+ + + + + + + {% block scripts %}{% endblock %} + + + \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..4732092335231313cda7ddbc2577427ab528ea59 GIT binary patch literal 268 zcmXw!yAFa-5Jaao@mCC>FA3^%}O*rX^T%tvBQhZ*}wb zpvc5h3KC4|hMiw{$5}WXb5h5ic~3)Brvu+tvMj?~c1>zKdPAcR??~V1u)j??f5CGm A&;S4c literal 0 HcmV?d00001 diff --git a/run.py b/run.py new file mode 100644 index 0000000..5b0a89d --- /dev/null +++ b/run.py @@ -0,0 +1,6 @@ +from app import create_app + +app = create_app() + +if __name__ == "__main__": + app.run(debug=True) \ No newline at end of file