No description
  • JavaScript 58.6%
  • CSS 21.5%
  • HTML 14.2%
  • Shell 5.7%
Find a file
Stewart Bennell a758f9db2b v2.5.0 — password-protect admin page
- Add login page (public/admin/login.html) with scrypt-hashed auth
- Session tokens in-memory Set; HttpOnly cookie; 30-day expiry
- requireAuth middleware on all write routes + GET /admin
- Display page and read-only APIs remain open (TV doesn't log in)
- Set/change/remove password from Display tab > Admin Password section
- Logout button in admin header when protection is active
- admin_password_hash never exposed via any API response
- Bump version to 2.5.0; update CHANGELOG, TASK.md, CLAUDE.md
2026-05-23 08:44:54 +10:00
public v2.5.0 — password-protect admin page 2026-05-23 08:44:54 +10:00
scripts v2.4.0 — install/update script + version bump 2026-05-23 08:18:33 +10:00
.gitignore Build digital calendar display app v1.3.0 2026-05-21 19:11:50 +10:00
CHANGELOG.md v2.5.0 — password-protect admin page 2026-05-23 08:44:54 +10:00
CLAUDE.md v2.5.0 — password-protect admin page 2026-05-23 08:44:54 +10:00
database.js v2.5.0 — password-protect admin page 2026-05-23 08:44:54 +10:00
LICENSE Initial commit 2026-05-21 17:24:57 +10:00
package-lock.json Build digital calendar display app v1.3.0 2026-05-21 19:11:50 +10:00
package.json v2.5.0 — password-protect admin page 2026-05-23 08:44:54 +10:00
README.md v2.4.0 — install/update script + version bump 2026-05-23 08:18:33 +10:00
server.js v2.5.0 — password-protect admin page 2026-05-23 08:44:54 +10:00
TASK.md v2.5.0 — password-protect admin page 2026-05-23 08:44:54 +10:00

Digital Calendar Display

A full-screen digital calendar designed to run on a wall-mounted TV or monitor. Built with Node.js + Express, vanilla JS, and SQLite — no build step required.

Features

  • Live clock with seconds display
  • Month mini-calendar with event indicators
  • Upcoming agenda — next 14 days of events
  • Real-time updates via WebSocket — the display refreshes instantly when you add an event
  • Web admin — add, edit, and delete events from any browser on your network
  • iCal / Google Calendar sync — paste a secret iCal URL; events auto-sync hourly
  • Colour-coded events with 8 colour presets

Quick Start

Prerequisites

Install & run

git clone https://github.com/your-username/Digital_Calendar.git
cd Digital_Calendar
npm install
npm start

Open your browser:

Page URL
Display http://localhost:3000/
Admin http://localhost:3000/admin

Development (auto-restart on file changes)

npm run dev

Change the port

PORT=8080 npm start

Google Calendar sync (no API key needed)

  1. Open Google Calendar → Settings → click your calendar name on the left
  2. Scroll to "Secret address in iCal format" → copy the URL
  3. Paste it into the iCal Sync field on the Admin page → click Sync now
  4. Events will auto-sync every hour

Server install / update (Debian / Ubuntu)

One command installs everything — Node.js, the app, and a systemd service — or updates an existing install to the latest version:

curl -fsSL https://git.bennellit.com.au/sb/Digital_Calendar/raw/branch/main/scripts/install.sh | sudo bash

Re-running the same command is always safe; it pulls the latest code and restarts the service.

After the script finishes it prints the display and admin URLs for your server's IP. The service is named digital-calendar and starts automatically on boot.

Useful commands after install:

systemctl status  digital-calendar
journalctl -u digital-calendar -f      # live logs
systemctl restart digital-calendar

Change the port: edit /etc/systemd/system/digital-calendar.service, uncomment the PORT= line, then run sudo systemctl daemon-reload && sudo systemctl restart digital-calendar.


Kiosk / TV setup (Raspberry Pi)

  1. Install Node.js on the Pi and run npm start
  2. Open Chromium in kiosk mode:
    chromium-browser --kiosk --noerrdialogs --disable-infobars http://localhost:3000
    
  3. Use a second device (phone/laptop) to visit /admin and manage events

Project structure

server.js        Backend (Express + WebSocket + iCal sync)
database.js      SQLite data layer
public/
  display/       Full-screen display page
  admin/         Admin UI
calendar.db      SQLite database (auto-created, gitignored)

License

MIT © 2026 sb