L'oliveraie d'amizmiz
A booking platform for a Moroccan guesthouse: public site, admin panel and payments, built and operated end to end on a single server.
- Role
- Full-stack, solo
- Client
- Client work
- Year
- 2024 — present
- Stack
-
- Front end
- Next.js, Tailwind CSS
- Backend
- NestJS, better-auth, BullMQ
- Data
- PostgreSQL, Prisma, PgBouncer, Redis
- Infrastructure
- Hetzner, Docker, Dokploy, Traefik, Cloudflare, OpenTofu, Ansible
- Services
- PayPal, Resend, Cloudinary
- Operations
- GitHub Actions, Sentry, UptimeRobot
- Testing
- Playwright, Vitest, Jest
- Links
-
Public routes sit behind a launch gate until reservations open, so this lands on the holding page. The admin app and API are running behind it.
The problem
A single-property guesthouse with no way to book online: no availability calendar, and no way to take payment up front.
4 constraints shaped everything after that. There’s one property, so revenue has a low ceiling and the hosting bill has to stay near zero. Guests read French and English. The owner runs the place day to day from the admin panel, which makes it as much the product as the public site. And I was the only engineer on it, so the design, the code, the infrastructure and keeping it running were all mine.
What I built
For guests
Guests can look around before they commit: the rooms with their photos and reviews, the activities, the restaurant’s menu, the pool, and the events the place hosts.
Booking starts with dates. The site shows what’s free on a month calendar, and a stay can take several rooms, extras for each one, and activities on the days the guest picks, checked against the places each one has left. Promo codes work at checkout, the cancellation terms are shown before anyone pays, and the guest chooses between a deposit and paying in full, by PayPal or by card.
No account is needed: a guest who books without one gets a private link by email, and can get a fresh one with their reference and email address.
| What a guest can do | No account | With an account |
|---|---|---|
| See the booking | Yes | Yes |
| Download the invoice | Yes | Yes |
| Cancel, with the refund shown first | Yes | Yes |
| Cancel one room of several | Yes | |
| Pay what’s still owed online | Yes | |
| Export or delete their data | Yes |
The emails take care of themselves: a confirmation with the invoice attached, reminders before arrival, a nudge if a balance is still owed, and a request for a review the day after checkout. The site and the emails are in French and English, in whichever language the guest booked in.
For the owner
The admin panel opens on the front desk: who’s arriving, who’s staying and who’s leaving today, with check-in and check-out a click away, and room assignment and housekeeping on the same screens.
Bookings that come in by phone are entered with a live itemised price. Any change to an existing one, whether that’s dates, room type, guests, extras or a negotiated price, shows the new total and what’s left to collect or refund before it’s saved. Where a guest is in their stay and where the money stands are tracked as 2 separate things and never mixed, so a booking can be checked in with a deposit paid and a balance still owed.
Rates change by season and by weekend, promo codes carry caps and usage limits, and refund rules scale with how much notice a guest gives. The terms and prices in force when a booking is made are frozen onto it, so changing the policy next season can’t change what a guest already agreed to.
Availability syncs both ways with sites like Airbnb and Booking.com, so a room sold on one of them stops being sellable here. Anything to do with money that needs a human, like a dispute, a refused payment or a gap between the books and what PayPal reports, lands on one list and is closed with a note.
Decisions that mattered
The last room can only be sold once. 2 guests clicking Book on the last room at the same moment must not both succeed. So a booking claims the room type, like a double room or a camping spot, before it does anything else, and the second guest waits their turn. Underneath that, once a stay has a room, the database itself refuses a second stay in that room that overlaps it. The database check still holds if the booking code is changed later. Activities can’t be oversold either: taking a seat only succeeds if there’s one left.
From managed platforms to one server. It started on Vercel, Railway and Neon, hosting services that run the servers for you. That was the quickest way to get it running. For a single property the bill didn’t make sense, so it moved to one Hetzner server under Dokploy, a tool that deploys and runs the apps on it. Cloudflare sits in front, and the server only takes web traffic that comes through it. All in, file storage and every third-party free tier included, it costs about €10 a month. The trade is that the backups, the updates and the disk are now mine.
New code doesn’t restart the database. Dokploy redeploys everything in a stack, the group of services it runs together, so if the database shared one with the app, a release could restart it too. The database and Redis, which holds the email queue and the rate limits, live in their own stack instead. That stack only redeploys when the data layer itself changes, and they’re given time to shut down cleanly when it does. Shipping code restarts the app and nothing else.
The server is described in files. OpenTofu describes the server, its firewall and the web addresses that point at it, with its record of what exists kept encrypted in file storage rather than on my laptop. Ansible sets up everything on top: Docker, Dokploy, automatic security updates, and fail2ban, which blocks addresses that keep failing to log in. The firewall rules and the hardening live in files rather than in my memory of what I clicked.
Operating it
Changes that land on the main branch are tested, built and deployed automatically.
| Risk | What handles it |
|---|---|
| A broken release | Tests before deploy, live checks after |
| Lost data | Backups several times a day, restore rehearsed |
| A tampered package | Most new versions wait a week |
| A leaked password or key | A scan on pull requests |
| The site not answering | UptimeRobot, around the clock |
| A filling disk | A phone alert well before it’s full |
| App errors | Sentry |
The backups go to Cloudflare R2, and the rehearsal restored a copy of live data. I picked R2 because downloading from it is free, so a restore drill costs nothing to run.
Deployment and day-to-day operations each have a written step-by-step guide, and the owner has a front-desk manual of his own.
Outcome
It’s deployed and running. The admin panel and the API are live, and the public site opens when reservations do.
From picking dates to a paid booking, a guest never has to send a message. The owner runs the front desk, the prices and the money from one admin panel.