Overview
Lara Library is a small online library of 28 public-domain classics, from the Shahnameh to Frankenstein. Students browse the shelves, reserve a book and follow their loans and due dates. The librarian approves reservations, lends books, sets fines and looks after the catalogue.
It is a demo library. There is no real library and there are no real students: the people, loans, reservations and messages in it are made up. The books are real classics; the cover pictures were made for the demo with an image AI.
You can try it from both sides. The sign-in pages have two one-click buttons, Try as a student and Try as the librarian. The best thing to try is the round trip: as the student, open a book and press Reserve this book; as the librarian, open Reservations and press Approve; back as the student, the book is now on loan for 14 days. Everything goes back to fresh sample data every night.



The librarian’s side
The admin panel has a dashboard with students, books and loans at a glance, plus pages for books, authors, subjects, lending and returns, students and contact messages. The demo librarian can open all of it but cannot save, except to approve or decline reservations. Real visitors who sign up stay private: the shared librarian sees “Visitor (hidden in demo)” instead of their name and email.


Tech Stack
- Laravel 12 and PHP 8.4, with Blade templates
- Tailwind CSS 4 — DaisyUI on the public pages, Preline in the dashboards
- Alpine.js for the small interactive parts
- PostgreSQL 18 (SQLite in the tests)
- Intervention Image — resizes uploaded pictures
- Brevo for email — sign-up confirmation and password reset
- PHPUnit — 212 automated tests, run on every push before anything ships
- Docker behind Caddy (the web server that handles HTTPS) on my own server, shipped by GitHub Actions
Features
- 28 books, 28 authors and 10 subjects, with search and subject pages
- Reservations: a student asks, the librarian approves or declines, and an approved book is lent for 14 days
- Student dashboard with active loans, returns, overdue books and due dates
- Admin: books, authors, subjects, lending and returns, fines, students, messages
- Sign-up with email confirmation and password reset
- A layout that works on a phone
Moving it to my own server
I built the first version in spring 2026 on Render, with the database on Supabase. Now it runs on my own server in Docker: the website in one box (about 45 MB of memory in use) and a worker for scheduled jobs in another. For this move, the security work, the redesign and the reservations, I worked with Claude Code (an AI coding assistant): I set the plan and checked every change.
- Builds happen on GitHub, not on the server. A push runs the tests, builds the app’s image (about four minutes) and sends it to the server over SSH, with a key that can only deliver images. The other sites on that server never slow down, and the last three versions are kept, so a bad release is one step to undo.
- It cannot hurt the shared email account. Emails are capped at 10 a day, counted in the database, so a restart does not reset the count. When the 10 are used, sign-up closes until the next day instead of skipping the confirmation.
Making it safe for strangers
Anyone can press “Try as the librarian”, so I treated every visitor as hostile and went looking for holes. Some of what I found and closed:
- A book could be lent to an admin, to a switched-off student, twice to the same student, or below zero copies when two clicks landed at once. Now every loan checks the student and the book, and locks the book’s row while lending, so two clicks at the same moment cannot both take the last copy.
- Switched-off accounts could still log in
- Admin pages could edit other admins
- Hidden books opened for anyone who had the address
- A 2 MB upload can still be 20,000 × 20,000 pixels and run the server out of memory when it is resized; uploads are now limited by type, file size and pixel size
On top of that: rate limits, a bot trap on the contact form, daily caps on new accounts and messages, and a length limit on every field.
Outcome
- A complete library anyone can try in a minute, as a student or as the librarian
- One demo shared by strangers that no visitor can wreck for the next one
- No hosting bills beyond the server I already run