From ba6568085e86b6097f1a8c2adc790a3394b3faa6 Mon Sep 17 00:00:00 2001 From: consultoria-as Date: Tue, 31 Mar 2026 01:21:52 +0000 Subject: [PATCH] feat(pos): scaffold project structure and Flask app --- pos/app.py | 14 ++++++++++++++ pos/blueprints/__init__.py | 0 pos/config.py | 21 +++++++++++++++++++++ pos/requirements.txt | 5 +++++ pos/services/__init__.py | 0 5 files changed, 40 insertions(+) create mode 100644 pos/app.py create mode 100644 pos/blueprints/__init__.py create mode 100644 pos/config.py create mode 100644 pos/requirements.txt create mode 100644 pos/services/__init__.py diff --git a/pos/app.py b/pos/app.py new file mode 100644 index 0000000..1728a7a --- /dev/null +++ b/pos/app.py @@ -0,0 +1,14 @@ +from flask import Flask + +def create_app(): + app = Flask(__name__) + + @app.route('/pos/health') + def health(): + return {'status': 'ok'} + + return app + +if __name__ == '__main__': + app = create_app() + app.run(host='0.0.0.0', port=5001, debug=True) diff --git a/pos/blueprints/__init__.py b/pos/blueprints/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pos/config.py b/pos/config.py new file mode 100644 index 0000000..35b12bf --- /dev/null +++ b/pos/config.py @@ -0,0 +1,21 @@ +import os + +MASTER_DB_URL = os.environ.get( + "MASTER_DB_URL", + "postgresql://nexus:nexus_autoparts_2026@localhost/nexus_autoparts" +) + +TENANT_DB_URL_TEMPLATE = os.environ.get( + "TENANT_DB_URL_TEMPLATE", + "postgresql://nexus:nexus_autoparts_2026@localhost/{db_name}" +) + +JWT_SECRET = os.environ.get("POS_JWT_SECRET", "nexus-pos-secret-change-in-prod-2026") +JWT_ACCESS_EXPIRES = 28800 # 8 hours (full shift) +JWT_REFRESH_EXPIRES = 2592000 # 30 days + +PIN_MAX_ATTEMPTS_PER_MINUTE = 5 +PIN_LOCKOUT_THRESHOLD = 10 +PIN_LOCKOUT_MINUTES = 15 + +TENANT_TEMPLATE_DB = "tenant_template" diff --git a/pos/requirements.txt b/pos/requirements.txt new file mode 100644 index 0000000..b820df8 --- /dev/null +++ b/pos/requirements.txt @@ -0,0 +1,5 @@ +Flask>=2.3 +psycopg2-binary>=2.9 +PyJWT>=2.8 +bcrypt>=4.0 +lxml>=4.9 diff --git a/pos/services/__init__.py b/pos/services/__init__.py new file mode 100644 index 0000000..e69de29