Skip to content

Davedka/Ticky

Repository files navigation

🏫 Ticky — Real-Time Classroom Availability System

Live

PHP Supabase

QR code-based classroom identification system built as a thesis project — deployed and running live at school, tracking 53 rooms and 69 teachers in real time.


📸 Screenshots

Home Page

Home

Live Room Dashboard — Corridor Display

Corridor Display

Teacher Finder

Teacher Finder

QR Code Generator

QR Generator


✨ Features

  • 🟢 Real-time room status — see which rooms are free or occupied right now
  • 👩‍🏫 Teacher finder — search any of the 69 teachers and see where they are
  • 📺 Corridor display mode — full-screen TV/tablet view for hallway screens
  • 🖨️ QR code generator — generate & print QR codes for every classroom
  • 📅 Weekly timetable — per-room and per-teacher schedule view
  • 🔐 Admin panel — password-protected dashboard for managing teachers and rooms
  • Auto-refresh — data updates every 30–60 seconds without page reload

🛠️ Stack

Layer Technology
Backend API PHP 8.x (Render.com)
Database Supabase (PostgreSQL)
Frontend Tailwind CSS + Vanilla JS
Importer Node.js (run locally)
Deploy Render.com

📡 API Endpoints

Endpoint Description
GET /api/ping Health check
GET /api/termek All rooms
GET /api/termek?allapot=1 Rooms with live availability status
GET /api/terem/{number} Current & next class for a room
GET /api/napirend/{number} Today's schedule for a room
GET /api/napirend/{number}?nap=heten Full weekly schedule for a room
GET /api/tanarok All teacher codes and names
GET /api/tanar/{code}/orarend Today's schedule for a teacher

📄 Example Response

GET /api/terem/204
{
  "terem": "204",
  "allapot": "foglalt",
  "aktualis": {
    "tanar": "ÁSZJ",
    "tanar_nev": "Ácsné Szűcs Judit",
    "osztaly": "9.b",
    "tantargy": "mny",
    "kezdes": "09:15",
    "vegzes": "10:00",
    "perc_maradt": 23
  },
  "kovetkezo": {
    "tanar": "ÁSZJ",
    "osztaly": "10.c",
    "kezdes": "10:15",
    "vegzes": "11:00"
  }
}

🗂️ File Structure

ticky-backend/
├── index.php              ← Router
├── config/
│   └── supabase.php       ← Supabase connection
├── utils/
│   └── helpers.php        ← Routing, CORS, JSON helpers
├── api/
│   ├── terem.php
│   ├── termek.php
│   ├── napirend.php
│   ├── tanarok.php
│   ├── tanar_orarend.php
│   ├── admin_tanar.php
│   └── admin_terem.php
└── pages/
    ├── terem.php          ← /terem/{number}
    ├── termek.php         ← /termek
    ├── napirend.php       ← /terem/{number}/nap
    ├── tanar.php          ← /tanar
    ├── kijelzo.php        ← /kijelzo
    ├── qr.php             ← /qr
    └── admin.php          ← hidden route from `ADMIN_PATH`

🚀 Deployment (Render.com)

  1. Push ticky-backend/ to GitHub
  2. Render → New Web Service → Connect repo
  3. Build command: echo "No build needed"
  4. Start command: php -S 0.0.0.0:$PORT index.php
  5. Set environment variables (see below)
  6. Deploy — takes ~1–2 minutes

📥 Timetable Importer (Node.js)

cd importer
npm install
node importer.js

Requires a .env file with SUPABASE_URL and SUPABASE_SERVICE_KEY. The importer wipes existing data and re-uploads. Run it whenever the timetable changes.


🗃️ Database Schema

Table Fields
termek terem_szam, emelet
tanarok rovid_nev, nev
orarendek terem_id, tanar_id, osztaly, tantargy, het_napja, kezdes, vegzes

het_napja: 1 = Monday … 5 = Friday


🔔 Bell Schedule

Period Start End
1st 07:30 08:10
2nd 08:20 09:05
3rd 09:15 10:00
4th 10:15 11:00
5th 11:10 11:55
6th 12:05 12:50
7th 12:50 13:35
8th 13:40 14:20

Built with ☕ by Davedka

About

Digital room identification system for schools – real-time timetable, QR codes & teacher finder

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors