feat(pos): scaffold project structure and Flask app
This commit is contained in:
14
pos/app.py
Normal file
14
pos/app.py
Normal file
@@ -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)
|
||||
0
pos/blueprints/__init__.py
Normal file
0
pos/blueprints/__init__.py
Normal file
21
pos/config.py
Normal file
21
pos/config.py
Normal file
@@ -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"
|
||||
5
pos/requirements.txt
Normal file
5
pos/requirements.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
Flask>=2.3
|
||||
psycopg2-binary>=2.9
|
||||
PyJWT>=2.8
|
||||
bcrypt>=4.0
|
||||
lxml>=4.9
|
||||
0
pos/services/__init__.py
Normal file
0
pos/services/__init__.py
Normal file
Reference in New Issue
Block a user