Colegio Aragón Website
Website for Colegio Aragón with its own admin panel: the school's staff publish content, build the timetable, manage room bookings by QR code, run the TV display screens and review traffic, all without touching code. Flask, MySQL and Celery, live at colegioaragon.cl.
Colegio Aragón: school website and custom management panel
A school website is often a static page nobody updates. For Colegio Aragón I built something different: a fast, responsive public site, backed by a private admin panel where the school's staff publish content, build the school timetable, manage room bookings by QR code, answer messages and review traffic, all without touching code.
It is live at colegioaragon.cl. This is the technical overview of what's behind it.

| Overview | |
|---|---|
| Role | Lead full-stack developer (around 83% of the 160 commits), with contributions from another developer on the team |
| Timeline | May – September 2026 |
| Type | School website + admin panel + internal tools (timetable, bookings, screens) |
| Status | In production |
| Code | Private, so this case study uses screenshots and short snippets |
Stack
| Layer | Technologies |
|---|---|
| Backend | Python, Flask 3, SQLAlchemy 2, Flask-Login, Flask-Mail, Flask-Migrate, MySQL |
| Background jobs | Celery 5 + Redis (emails and scheduled reminders) |
| Frontend | Jinja templates with per-section CSS on the public site; Bootstrap 5.3 + AdminLTE 4 in the panel; Chart.js for charts |
| Integrations | Cloudflare Turnstile, Meta Pixel + Conversions API, geoip2fast (offline geolocation), qrcode |
| Files | Custom storage layer with a local or S3 driver |
| Deployment | Gunicorn and a Celery worker as systemd services, behind a reverse proxy |
Architecture
Visitors, parents and teachers (browser or QR code)
|
v
+-------------------------------+ queue (Redis) +------------------------+
| Flask 3 + Gunicorn | -------------------> | Celery worker |
| public site + /admin | | emails and reminders |
+-------------------------------+ +------------------------+
| | |
v v v
MySQL Local or S3 storage SMTP
Integrations: Cloudflare Turnstile | Meta Pixel + Conversions API | geoip2fast (offline)
It is a Flask monolith with a create_app() factory, blueprints per section (public site, authentication, and an admin panel with sub-blueprints such as the timetable one), and a service layer for shared logic. Anything that can wait (sending an email, a booking reminder) goes to Celery, so no page ever waits on the mail server.
Features
| Area | What it does | Technical detail |
|---|---|---|
| Public site | About 30 pages: about us, educational project, levels, facilities, regulations, admissions, calendar, timetables, supplies, uniforms, reading plan | Content editable from the panel; SEO metadata; the admissions year is computed from the semester settings |
| Newsletters | News for parents with thumbnails and search | Admin and "publisher" roles; publishers can only edit their own content |
| School timetable | School day, breaks, periods, classes, teachers, subjects, fixed lessons and special workshops | Periods computed automatically; weekly view shared with the public site; printable version |
| Resource booking | Rooms and equipment (computer lab, library, Chromebooks) bookable per period | Public link + QR per resource, no accounts; one set of clash rules for admin and public flows |
| Screens and kiosks | Full-screen image carousel on a school TV | Two-word access code, one device at a time, heartbeat |
| Contact | Contact form answered from the panel | Turnstile, attempt limits with automatic blocking, replies by email |
| Analytics | In-house visit tracking by day, source and country | Custom middleware, offline geolocation, server-side Meta events |
| Administration | Users, backups, dark mode | Random password sent by email, password reset, backups to local disk or S3 |

Deep dives
1. QR-code bookings, no accounts
Every bookable resource has a public link with a token and a QR code rendered server-side as SVG, plus a printable version to stick on the room door. A teacher scans the code, sees the week's availability and books a free period without logging in. If the link leaks, it can be regenerated from the panel and the old one stops working.

The key point is that the public flow and the admin flow apply the same rules. A single function decides whether a period is free and, if it isn't, explains why:
def bloque_estado(fecha, recurso_id, bloque, excluir_reserva_id=None):
# 1. Is there an active fixed lesson that day covering this period?
# 2. Is there a special workshop overlapping in time?
# 3. Is there already another booking for this resource in this period?
# Returns (available, reason): the reason names the lesson, class and teacher in the way.
When a fixed lesson that clashes with existing one-off bookings is activated, the system removes those bookings and reports how many, instead of leaving the timetable in an impossible state.

2. School timetable: from the school day to the grid
The timetable starts from the school day and its breaks, which can be set per weekday. From there, the panel proposes class periods automatically: it covers the whole day skipping the breaks and splits each free stretch into parts as even as possible, up to 45 minutes each, instead of fixed 45-minute periods with a small leftover at the end.

The weekly grid comes from a single service used by both the admin view and the public QR view. That service:
- Places fixed lessons, workshops and bookings on the clock, with breaks marked.
- Lays out overlapping events side by side in columns, like a calendar, sweeping through clusters of events that overlap.
- Merges back-to-back bookings for the same resource, teacher and class into a single visual block.

3. Emails and reminders with Celery
For email I wrote a base class modeled after Laravel's Mailables: each email type declares its subject and template, and .queue() renders the HTML right away and hands SMTP delivery to the Celery worker. There are 8 types: welcome, password reset and change, contact messages, replies and booking notices.
Bookings notify a configurable group of admins twice: when they are made (a single email even when several periods are booked at once) and right at the start time. That second notice is scheduled with eta:
send_reserva_hora_reminder.apply_async(
kwargs={'reserva_id': reserva.id, 'expected_start_iso': inicio.isoformat(), 'dashboard_url': url},
eta=inicio,
)
Instead of revoking the task when someone edits or deletes the booking, the task carries the start time it expects. When it runs, if the booking no longer exists or its time changed, it does nothing; the edit already scheduled its own reminder. No need to keep track of task IDs.
4. Screens for kiosks
A "room" here is a full-screen image carousel meant for a TV at the school. To connect the TV, the panel issues a code made of two simple Spanish words with no accents or ñ (for example gatito-manzana), easy to type with a remote control. Lookup tolerates uppercase, spaces and underscores.
- One device at a time: the first browser that opens the link "claims" it with a secret stored in a cookie, compared in constant time.
- Heartbeat: the screen periodically reports that it is still alive. Since the project has no scheduler for this, the status is recomputed lazily: after 45 seconds without a heartbeat, the session is marked as expired the next time it is read.

5. A contact form without spam
The contact form verifies a Cloudflare Turnstile token on the server and logs every submission. If the same email or IP goes over 3 attempts in 10 minutes, it is blocked automatically, and the panel has a blocked-senders list to review. Messages are answered from the panel and the reply arrives by email using a school-branded template.
6. In-house analytics and Meta
Visits are recorded by a custom middleware: one per IP every 24 hours, with UTM parameters and country. The country comes from geoip2fast, an offline database bundled with the library: no network calls and no licenses to manage, loaded once per process.
The panel charts visits per day (7, 30 or 90 days), traffic sources and countries with Chart.js. For ad campaigns, every page view is also sent server-side to Meta's Conversions API, with an event ID shared with the browser Pixel so Meta doesn't count it twice. The call runs in the background with a 3-second timeout, so the page never waits on Meta.

7. The admin panel
- AdminLTE 4 + Bootstrap 5.3, with light and dark modes remembered per browser and a filter to search the menu.
- Users: creating an account generates a random password that can be emailed; there is token-based password reset and a guard against deleting your own account.
- Backups: a data dump (INSERT statements only) generated from the panel or by script, saved to the configured storage (local or S3), and downloadable or deletable from there.
- Swappable storage: a common interface with local and S3 drivers, so moving from disk to a bucket is a config change.

By the numbers
| Metric | Value |
|---|---|
| Commits (May – September 2026) | 160, around 83% mine |
| SQLAlchemy models | 38 |
| Jinja templates | 115 |
| Python code | ~8,700 lines across 113 files |
| Public pages | ~30 |
| Email types | 8 |
What I take away
This project taught me to build for people who will never read a manual: a teacher with a phone in front of a door, someone at the school setting up a TV with a remote, a team that needs to publish a newsletter without asking for help. My favorite technical decisions came from there: a single source of truth for booking rules, reminders that look after themselves instead of revoking tasks, and lazy expiration instead of adding infrastructure that wasn't needed.
Admin panel screenshots come from my local environment: teacher and user names were replaced with fictional ones and IP addresses are masked.
Project screenshots