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