Back to workCase study

Doorplate

Long-term rentals in Spain, listed by the people who own them. Each listing leads with its rent, rooms and floor area, and renters write to the owner from the listing page.

What it does

Doorplate covers one kind of rental: flats and houses let long term by their owners, priced in euros and measured in m². Holiday lets, sales and agency listings are left out. It started as Homely, a listings app whose ads had only a title, a description and photos; I renamed it and added the rental facts, search, enquiries and saved flats.

What I built

  • Search by city, maximum rent, minimum bedrooms and floor area, sorted by newest, rent or size.
  • Listing pages with the rent, bedrooms, bathrooms and floor area above the description, a photo grid and a viewer for every photo.
  • An enquiry form (name, email, move-in date, message) that needs no account, and a page per listing where the owner reads the enquiries and replies by email.
  • Saved flats for signed-in users, and sharing through the phone's share sheet or a copied link on desktop.
  • Create, edit and delete flows for listings with several ordered photos.
  • Sign-up and login with bcrypt-hashed passwords and a JWT session cookie; logging in returns you to the page you were on.
  • A seed script with eight listings in four cities, Unsplash photos and a demo owner.

Decisions worth a look

  • Searches live in the URL. The filters are a GET form, and the listings page reads them from the search params on the server. A search can be bookmarked or shared, and it works before any JavaScript loads.
  • Ownership checked on the server. Editing or deleting a listing checks that it belongs to the signed-in user, the enquiries page sends anyone but the owner back to the listing, and owners can't send an enquiry to their own flat. Zod validates every form on the server, and a form that fails keeps what was typed.
  • Uploads outside public/. Next.js only serves files that were in public/ at build time, so photos uploaded to a production build came back as 404s. They now live in data/uploads next to the database, behind a route handler that checks the file name, and still go through next/image.
  • One server with a disk. SQLite and photos on local disk keep the app to one process with no outside services. The cost is hosting: it needs a VPS or a container with a volume, so serverless platforms are out.

Data model

Users, listings (rent in whole euros, city, neighbourhood, flat or house, bedrooms, bathrooms and m²), photos ordered by position, enquiries and saved flats. A saved flat is keyed on the user and the listing, so it can only be saved once. Deleting a listing removes its photos, enquiries and saves by cascade. City and rent are indexed, and schema changes ship as SQL migrations.

Stack

Next.js (App Router) · Server Components + Server Actions · SQLite (better-sqlite3) · Drizzle ORM · Auth.js · Zod · Tailwind · shadcn/ui