scaffold: modern rewrite skeleton (backend + frontend PWA) + roadmap
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
Backend README
|
||||
|
||||
This is a minimal scaffold for the LifeRPG backend. It currently ships a tiny stdlib-based HTTP JSON endpoint for local development.
|
||||
|
||||
Next steps:
|
||||
- Replace with FastAPI + Uvicorn for production.
|
||||
- Add ORM (SQLAlchemy/Alembic) and migrations.
|
||||
- Add OAuth2 and integration adapters.
|
||||
|
||||
Run (dev):
|
||||
|
||||
python server.py
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# Example dependencies for later
|
||||
fastapi
|
||||
uvicorn[standard]
|
||||
sqlalchemy
|
||||
alembic
|
||||
psycopg2-binary
|
||||
pydantic
|
||||
redis
|
||||
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Minimal JSON HTTP server for the LifeRPG modern scaffold.
|
||||
This intentionally uses only the Python stdlib so it's runnable without installing dependencies.
|
||||
"""
|
||||
from http.server import BaseHTTPRequestHandler, HTTPServer
|
||||
import json
|
||||
|
||||
class Handler(BaseHTTPRequestHandler):
|
||||
def _send_json(self, data, status=200):
|
||||
payload = json.dumps(data).encode("utf-8")
|
||||
self.send_response(status)
|
||||
self.send_header("Content-Type", "application/json")
|
||||
self.send_header("Content-Length", str(len(payload)))
|
||||
self.end_headers()
|
||||
self.wfile.write(payload)
|
||||
|
||||
def do_GET(self):
|
||||
if self.path == "/health":
|
||||
self._send_json({"status": "ok"})
|
||||
return
|
||||
if self.path == "/api/v1/hello":
|
||||
self._send_json({"message": "Hello from LifeRPG modern backend"})
|
||||
return
|
||||
self._send_json({"error": "not_found"}, status=404)
|
||||
|
||||
if __name__ == "__main__":
|
||||
server = HTTPServer(("0.0.0.0", 8000), Handler)
|
||||
print("LifeRPG backend listening on http://0.0.0.0:8000")
|
||||
try:
|
||||
server.serve_forever()
|
||||
except KeyboardInterrupt:
|
||||
server.shutdown()
|
||||
|
||||
Reference in New Issue
Block a user