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 0000000..4732092 Binary files /dev/null and b/requirements.txt differ 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