Initial commit: add main.py
This commit is contained in:
38
main.py
Normal file
38
main.py
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
from fastapi import FastAPI
|
||||||
|
from fastapi.responses import HTMLResponse
|
||||||
|
|
||||||
|
app = FastAPI(title="TapTrack", description="RFID Student Attendance & Parent Notification System")
|
||||||
|
|
||||||
|
@app.get("/", response_class=HTMLResponse)
|
||||||
|
def root():
|
||||||
|
return """
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>TapTrack</title>
|
||||||
|
<style>
|
||||||
|
body { font-family: sans-serif; background: #0f172a; color: #f1f5f9; display: flex; align-items: center; justify-content: center; height: 100vh; margin: 0; }
|
||||||
|
.card { background: #1e293b; border-radius: 16px; padding: 48px; text-align: center; box-shadow: 0 25px 50px rgba(0,0,0,0.5); }
|
||||||
|
h1 { font-size: 3rem; margin: 0; color: #38bdf8; }
|
||||||
|
p { color: #94a3b8; font-size: 1.2rem; }
|
||||||
|
.badge { background: #22c55e; color: #fff; padding: 4px 16px; border-radius: 99px; font-size: 0.85rem; display: inline-block; margin-top: 16px; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="card">
|
||||||
|
<h1>🎓 TapTrack</h1>
|
||||||
|
<p>RFID Student Attendance & Parent Notification System</p>
|
||||||
|
<div class="badge">✅ Running on Coolify</div>
|
||||||
|
<br/><br/>
|
||||||
|
<p style="font-size:0.9rem;">Built by Kibin · Powered by FastAPI</p>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
"""
|
||||||
|
|
||||||
|
@app.get("/health")
|
||||||
|
def health():
|
||||||
|
return {"status": "ok", "app": "TapTrack", "version": "0.1.0"}
|
||||||
|
|
||||||
|
@app.get("/api/v1/ping")
|
||||||
|
def ping():
|
||||||
|
return {"message": "pong", "service": "TapTrack API"}
|
||||||
Reference in New Issue
Block a user