arrow_back Back to Projects
Academic Done

Sabaay-Kroo

Educational Activity Management System for Thai Schools

Node.js Express.js MySQL JWT Google Calendar API Multer HTML5 CSS3 JavaScript

Sabaay-Kroo (สบายครู — meaning "Teacher's Ease" in Thai) is a full-stack web application built for schools to centralize and streamline educational administration. The system provides teachers, staff, and administrators with a unified platform to manage documents, schedules, calendars, and notifications — reducing administrative overhead and improving coordination across the school.

The platform supports multiple staff roles with appropriate access controls, ensuring documents and data are shared appropriately while keeping sensitive information protected. Built with Thai educational institutions in mind, it supports Thai language throughout — UTF-8 charset, Sarabun font, and Bangkok timezone.

lock

User Authentication

Secure login with JWT tokens and bcrypt password hashing. 1-day token expiry with Bearer header validation on all protected routes.

folder_open

Personal Document Library

Upload, tag, download, and manage personal teaching documents — PDF, Word, Excel, PowerPoint, images, and more (up to 50 MB).

corporate_fare

Organization Repository

School-wide shared document system with category-based organization for easy discovery and access by all staff.

calendar_month

Activity Calendar

Weekly calendar view with event management, status tracking, and Google Calendar sync via OAuth 2.0 with automatic token refresh.

notifications

Notification System

Multi-level notification center with priority levels (urgent, high, normal, low), type filtering, and 30-second auto-refresh on the client.

admin_panel_settings

Admin Dashboard

User management, role assignment, category/tag administration, and full audit logging with IP address and user agent tracking.

manage_accounts

Profile & Settings

Update display name, username, password, and profile avatar (up to 5 MB). Secure forgot-password flow that notifies admins.

storage

SQL Migration System

Ordered .sql files run via npm run migrate for reproducible, version-controlled DB setup.

Frontend
HTML5 CSS3 Vanilla JavaScript Bootstrap Icons Google Fonts (Sarabun)
Backend
Node.js Express.js v5 Multer nodemon dotenv
Database
MySQL utf8mb4 Timezone +07:00
Auth
JWT (jsonwebtoken) bcrypt
Integrations
Google Calendar API OAuth 2.0 googleapis

Authentication Flow

  1. 1 User submits credentials → bcrypt password validation on the server
  2. 2 Server issues a signed JWT with 1-day expiry
  3. 3 Client stores the token in localStorage
  4. 4 Every API request sends Authorization: Bearer <token> header
  5. 5 authenticateToken middleware validates all protected routes

System Stack

  1. Client (HTML / CSS / JS) sends requests to the Express REST API on Port 3000
  2. Express API reads and writes to the sabaay_kroo MySQL database
  3. Calendar routes authenticate with Google Calendar API via OAuth 2.0, with tokens stored per-user in the database
Table Purpose
usersAccounts with roles: admin, teacher, staff, caretaker
documentsPersonal documents stored as LONGBLOB with tag association
document_tagsCustomizable document categories per user
organization_documentsSchool-wide shared document repository
document_categoriesOrganization document categories
notificationsNotifications with type, priority, read/archive status
notification_typesNotification categories with icon and color metadata
notification_settingsPer-user notification preferences
password_reset_requestsSecure reset token tracking
admin_actions_logFull audit trail of admin actions (IP + user agent)
logsGeneral system activity logs