Web AppProjects

Hospital site with a hiring system

A bilingual full-stack website for a specialty hospital under construction. It tells the pre-opening story calmly and with dignity, with a built-in hiring system that takes applications, stores them safely in the CMS and sends HR a Thai application PDF automatically. Built with Next.js 16, Sanity and a fully serverless setup

14 min read

A bilingual full-stack website for a specialty hospital still under construction. It tells the pre-opening story calmly and with dignity, and includes a built-in applicant tracking system (ATS) that takes applications, stores them in the CMS, then generates a PDF of each Thai application and emails it to HR automatically

Next.js 16 (App Router)React 19next-intlSanity CMSTailwind v4MotionPuppeteer + pdf-libResend
Empathize · Define

The problem

A website for a hospital that "isn't open yet": it has to build trust without overpromising, and it has to start hiring staff before opening day

Hospital homepage on desktop: building video with the headline Hope with dignity and a button to talk to the care teamHospital homepage on mobile
The live homepage (desktop + mobile): it introduces a specialty hospital that is on its way, without pretending to be fully open · brand name and logo blurred

A specialty cancer hospital is still under construction. The website must not act as if the hospital is already fully open, yet it has to say "this will be a place that understands you" in a way that feels warm and credible. At the same time it has to start recruiting doctors, nurses and staff before opening. All of this had to ship fast on a limited pre-opening budget, while keeping sensitive applicant data safe

— The starting brief, before work on the hospital website began

The hospital isn't open yet, which is hard to communicate

Acting as if it were open would cost credibility, but showing only "under construction" feels cold. The site had to be honest that it is still being built while letting people feel that real help is coming

Hiring had to start before opening, with no system in place

The hospital needed doctors, nurses and pharmacists before opening. Without a system, applications end up scattered across email and chat, with no central store and no standard format for HR to read

Applicant data is sensitive (PII)

Applications contain ID numbers, phone numbers, professional license numbers and emergency contacts. Storing them in the wrong place or leaking them through a public API is a risk both under PDPA and for trust

Two audiences and a distinct brand

The site serves both Thai visitors and an international audience (doctors and partners), under strict brand rules: a loopless Thai typeface to match the logo, and no red crosses or battle language about cancer

Fast to deploy, on a limited pre-opening budget

There was no budget for a separate backend, and no CMS or email keys at the start, yet the site had to go live in time to start publicity and open applications. It also couldn't be tied to so many vendors that it became hard to change


Ideate

The solution

An honest pre-opening site with a built-in ATS, fully serverless, so the CMS and email can be connected later without breaking the site

The You don't need all the answers to begin section on a dark brown background, with three cards
The "You don't need all the answers to begin" section: reassuring copy that doesn't push anyone to decide

A pre-opening site that tells the truth warmly

A light, water and shade mood, "breathing" motion (slow fades and reveals) and low-pressure CTAs ("Talk to our care team" / "Get advice"). It builds trust without pretending the hospital is already open

Careers and ATS inside the same site

Job listings, a multi-section application form and automatic storage in the CMS. HR reviews everything in one place in Studio instead of collecting it from email and chat

Applications stored as "drafts" so PII can't leak

Documents are saved as drafts (drafts.<uuid>), which the public API can't read but HR can see in Studio. The write token is server-only, and only the necessary fields are stored

Thai application PDFs for HR, generated automatically

When someone applies, the system renders the application cover page (with correct Thai text) in headless Chrome, merges it with the résumé into a single PDF and attaches it to an email to HR, ready to read

Fully serverless, with a fallback at every step

Next.js + Sanity + Resend (called with fetch, no extra dependency). Without a CMS connection it uses seed data; without email set up it returns a stubbed success. The site worked from the first deploy


Prototype

How it works: 4 steps (the path of an application)

From the moment an applicant hits submit until the PDF reaches HR

Application form on desktop, with an 8-section menu on the left and the email field outlined in red when the format is wrongApplication form on mobile, with a bottom sheet for picking the Buddhist-era year, month and day
Step 1 in the real product: the 8-section form (errors appear after leaving a field) and the bottom-sheet date wheel on mobile · filled with sample data
1

Applicant fills in the form

Multi-section form, bottom sheets on mobile, built-in date wheel and photo cropping

2

Validate and save a draft

Checked on the server, then saved as a draft in the CMS that the public can't read

3

Build the PDF in the background

Headless Chrome renders the cover page and merges the résumé (without making the applicant wait)

4

Notify HR with the PDF

Sends an email with the PDF attached and a link to open it in Studio


Prototype

Tech Stack & Architecture

Fully serverless: no separate backend, no self-managed database, and services can be connected later without breaking the site

The Careers page in Thai at /th/careersThe same page in English at /en/careers
next-intl: /th ↔ /en share one page structure; only the text dictionary changes
Visitors & applicants (2 languages · /th · /en)
Patients/families Doctors/partners Applicants HR team
↕
Next.js 16 App Router — RSC + Route Handlers
Server Components /api/apply /api/contact after() background
↕
Services — i18n · CMS · PDF · Mail
next-intl Sanity Studio Puppeteer + pdf-lib Resend (fetch)
↕
Serverless (Vercel) + Sanity dataset + draft docs
@sparticuz/chromium seed fallback server-only token
Why this stack?

Next.js 16 + RSC — renders bilingual content on the server quickly with good SEO, and route handlers act as the API in the same app, so no separate backend · Sanity CMS — lets HR edit job posts and read applications in a Thai-language Studio without a developer touching code · next-intl — keeps the "text" (dictionary) separate from the "page structure" (code), so adding or editing a language doesn't affect layout · Puppeteer + pdf-lib — renders the Thai cover page in a real browser, then merges the résumé, producing a PDF with correct Thai text · Resend via fetch — sends email without adding a dependency · every service has a fallback, so the site could deploy before all the keys existed


Prototype

What I built: 8 core features

From the brand-facing pages to the back-office hiring system

Contact page with a contact form on a white card, a lobby photo and a floating chat button
The live Contact page: a contact form (saved as a draft, with an email alert) and a "Talk to our care team" chat button · hospital email blurred

Bilingual i18n (TH / EN)

next-intl + App Router, URL prefix /th · /en, Thai as the default. Text lives in dictionaries, separate from layout

Pre-opening Homepage

Video hero with slow reveals, and story sections (who/why/healing/services/process/FAQ) in a calm, dignified tone

Careers Listing

Job listings with demand badges (urgent/high), pulled from the CMS when connected and from seed data otherwise

Multi-section Application Form

A multi-section form with 30+ fields: bottom sheets on mobile, a date wheel for birth dates, in-browser photo cropping and nationality search

Sanity CMS (Thai Studio)

8 content models (jobs, categories, departments, locations, applications, contact messages, etc.), document-level i18n, custom inputs and an export-PDF button

Auto PDF Generation

Renders the application cover page in headless Chrome (correct Thai), merges the résumé (PDF or image) into one file with pdf-lib, and stamps the footer and page numbers

Email Notify

Alerts HR to every application and contact message via Resend (REST called with fetch), with the PDF attached and a branded header

Contact Form + Chat Widget

A contact form (saved as a draft, with an email alert) and a floating "Talk to our care team" button linked to the hospital's chat channel


Prototype

What it looks like: Careers

The job listings applicants see: position cards with demand badges; applying opens the multi-section form

Open positions page with a search box, filters on the left and position cards with urgent/high-demand badges
The live open-positions page: search plus filters by job family and department; cards show the demand level

Prototype · UI Craft

UI design & design system

From a product designer's side: turning "a cancer hospital before it opens" into a design system that is calm and dignified, and that actually handles a 30+ field bilingual application form

Design Tokens Taken from the real logo · Hospital Brand Book v1.0
Healing Green
#259B94
Humility Gold
#AF9C84
Quiet Water
#7FA6A2
Deep Bark
#4A342D
Hospital Brown
#604036
Hope Beige
#F3ECE5
Warm Mist
#D9D1C8
Ink (text)
#35231F
Care that starts with you, not the disease Display · Marcellus / Anuphan · 300
Thai body text uses a looped typeface for sustained reading, keeping the tone warm and clear Body · Garuda / Acumin · 400 · 1.06rem
Careers · Join our team Eyebrow · 0.825rem · tracking 0.14em
card radius 20px field radius 12px container 90rem heading tracking 0.14em heading weight 300 shadow card
A 9-panel brand guidelines board: logo, radiance mark, digital, color, typography and usage examples
The identity system board in the project (public/brandbook), the source of the color and font tokens above · logo and domain blurred
Services section on the homepage with tabs for cancer treatment, symptom care and palliative care, and a photo of a doctor talking with a patient
The tokens in use on the services section: light-weight serif headings, a beige background and tabs for 3 services
Mobile-first: a 30+ field form that never overwhelms the screen (393 → 768 → 1440)

On mobile, a long form means people quit halfway, so it is split into a section stepper, with bottom sheets for choices, a date wheel for birth dates (Buddhist era) and in-browser photo cropping. Applicants see one section at a time instead of a wall of fields. At ≥768 it expands to popovers and two columns

Component states: show errors at the right moment, not while typing

Every field has the full set of states: default / focus (gold ring #AF9C84) / invalid (red #b4452f). Using :not(:placeholder-shown):invalid, errors appear only after the user fills in a field and leaves it, not the moment they start typing. That makes it feel less like being scolded, and each error explains the fix in Thai

Accessibility & brand: reduce fear, don't add to it

A deliberate choice of no red crosses and no battle language. Healing Green is a quiet accent, not a warning color; contrast passes AA on the beige background; touch targets are ≥44px; :focus-visible uses a green outline; and the "breathing" motion respects prefers-reduced-motion

Bilingual typography: fonts chosen by role

Thai uses two typefaces with different jobs: Anuphan (loopless, matching the logo) for headings and display, and Garuda (looped) for body text that's easy to read at length. English pairs them with Marcellus (serif) · line-height 1.28 leaves room for Thai vowels and tone marks · text is kept separate from layout so the two languages stay in sync


Test & Iterate

Hacks and fixes

6 problems I had to solve myself: Thai text in PDFs, a browser on serverless, and PII safety

Thai PDF application cover page with a brown header bar, applicant name, a green position badge and 5 sections of details
The application PDF cover rendered from the real template in Chrome, with Thai vowels and tone marks intact · all data is sample data

Thai PDFs with correct characters

pdf-lib's standard fonts can't draw Thai (vowels and tone marks break), but HR needs Thai applications that are 100% correct

Fix: render the cover page in headless Chrome (puppeteer) with the real Anuphan font loaded to get a cover PDF, then merge it with the résumé using pdf-lib · the footer stamped on every page is captured as a screenshot image and embedded, so Thai glyphs don't break during stamping

You can't just launch a browser on serverless

Puppeteer needs a Chrome binary. The dev machine already has Chrome, but serverless doesn't, and full Chrome is over the size limit

Fix: check the env (VERCEL / AWS_REGION). On serverless, load @sparticuz/chromium (a binary trimmed small enough); on the dev machine, point to the installed Chrome. The same code runs in both environments

Applications contain PII and must not reach the public API

Published Sanity documents can be read through the public API. Stored the normal way, anyone could query applicants' ID and phone numbers

Fix: save as a draft (_id = drafts.<uuid>), which the public API can't see but HR can in Studio · the write token is server-only (no NEXT_PUBLIC_ prefix) · every field is validated on the server before saving

Generating the PDF and sending email is slow, so applicants wait

If the response waits for the PDF render and the email, applicants stare at a spinner for several seconds, which is a bad experience

Fix: use Next.js after() to tell the applicant "success" right away once the data is saved, then generate the PDF and email HR as a background task (with maxDuration = 60 for heavy jobs). The applicant doesn't wait

The site had to go live before all the keys existed

At the start there was no Sanity project, Resend key or write token, but the site had to be published in time for publicity

Fix: every service connection has a fallback. With no CMS, it uses seed data (sample job posts); with no email, it returns a stub and logs; the form still works end to end. Once the env vars are added, the system "switches to the real thing" automatically, with no code changes

Keeping icons and images separate from bilingual text

Homepage sections mix icons, images and text. Keeping all of it in the dictionary makes translations hard to edit and the layout easy to break

Fix: keep the text in the dictionary (translatable), but bind icons and image order in code as metadata, then map them together by index at render time. Translators edit only the text, and the page structure stays the same in both languages

Define

Deliberate design decisions

For a cancer hospital website, what you deliberately "don't do" matters as much as what you do

The Room to breathe section, with photos of wood-toned interiors, natural light and copy about healing spaces
"Room to breathe": images of space, light and shade instead of medical symbols, and no red crosses

This site has to reduce fear, not add to it. So it uses no red crosses, no battle language about cancer, doesn't act as if the hospital is fully open while it's still under construction, and never stores applicant data where the public can reach it. Every decision puts calm, dignity and data safety ahead of marketing tricks


Tell the truth, don't oversell

Say "under construction" warmly, without pretending to be open


No red crosses or battle language

Credibility comes from typography & layout, not urgent symbols


PII stored only as drafts

Not readable by the public API · token stays on the server


Breathing motion

Slow, soft reveals that respect reduced-motion, nothing flashy


Level Up · Reflect

Knowledge domains I got stronger in

5 areas where this project genuinely moved my level up

The How we care, every step of the way section: 5 step cards, from telling us your story to ongoing care
Healthcare UX in practice: the 5-step care journey explained in reassuring language, so patients can see what happens next
1. i18n architecture: a bilingual site that's actually maintainable:

Learned next-intl on the App Router: routing/URL prefixes, setRequestLocale in RSC, separating "text" (dictionary) from "page structure" (code) and mapping icons and images by index. Lesson: good i18n lets translators edit only the text, without touching layout and without the two languages drifting apart

2. Headless-browser PDF pipeline: from zero to generating documents myself:

Built the pipeline: puppeteer renders HTML→PDF (with correct Thai fonts) + pdf-lib merges multiple files + embeds images and stamps footers and page numbers + handles two environments (local Chrome vs @sparticuz/chromium on serverless). Lesson: producing send-ready documents isn't magic once you know each tool's strengths and chain them together

3. Structured content / headless CMS: designing a schema other people can run with:

8 content types in Sanity (jobs, categories, departments, locations, applications, messages, etc.), draft vs published separation, document-level i18n, custom Studio inputs and an export button. Lesson: good back-office work hands over "a system HR can run on its own", not screens that need a developer every time the copy changes

4. Data safety on serverless: security from the design stage:

Set the system up to keep PII safe: stored as drafts the public API can't read, server-only tokens kept away from the client, every input validated on the server, and after() for heavy background work without slowing the user. Lesson: with sensitive data, "where it's stored" and "who can read it" have to be designed in from the start, not patched on later

5. Healthcare UX / brand for vulnerable users: design that reduces fear:

Turned a mood & tone (light, water, shade, dignity) into real UI: copy that reassures rather than pressures, no urgent symbols, contrast that passes on beige and brown, and breathing motion that respects reduced-motion. Lesson: for patients and families, "calm and clarity" is a feature, not decoration

2
languages: Thai/English (full-site i18n)
8
content models in Sanity CMS
30+
application form fields → automatic PDF
0
PII readable through the public API

Tan · Natpakan Sirirat

Product Designer & AI Builder — designing user experiences and building AI tools that actually work.

0%