nimashadloo.dev

This site: a Django content API and a Next.js front end on one small host, with every architecture decision written down.

Role
Design, build, and operations
Years
Since 2026
Status
Maintained
Stack
Django 6, DRF, Next.js 16, SQLite, nginx
One host · systemd · release linksBrowsernginx:443Next.js:3000Django:8010SQLiteWALStudioRevalidatep95 ≈ 8 ms
Fig. 01 Request path. One host serves the site, and a save in Studio revalidates the page.Swipe the drawing

The brief

A personal site that a hiring manager can read in fifteen seconds and a developer can read for an hour, run by one person on one small server, with every decision written down where the next maintainer will find it.

One host, two applications

Django serves an internal API and the admin, which is called Studio. Next.js renders every public page on the server, prerenders it, and caches it until Django says otherwise. nginx terminates TLS and serves the static files. Both applications run under systemd as an unprivileged user, and SQLite holds the data in WAL mode.

SurfaceChoiceWhy
DataSQLite in WAL mode, with a daily backup and a restore drillOne writer, and every read is cached
RenderingNext.js Cache Components with tag revalidationA save in Studio reaches the page within a minute
AdminThe Django admin on Unfold, behind a sign-in lockoutOne operator, and no second application to secure
SecurityA strict content security policy owned by the applicationThe headers ship with the code they protect

A save becomes a page

Each save in Studio dispatches the cache tags it touched once its transaction commits, so a write that rolled back never asks the frontend to read it. The frontend drops the pages under those tags and renders them again on the next request.

backend/core/revalidation.pyExcerpt
def dispatch(tags: Iterable[str]) -> None:
    """Sends these tags to the frontend once the current write commits.

    A rollback discards the callback, so a write that never landed never asks
    the frontend to read it back.
    """
    wanted = allowed(tags)
    for batch in batched(wanted, TAGS_FOR_EACH_REQUEST, strict=False):
        transaction.on_commit(partial(revalidate.enqueue, list(batch)))

Releases that can go back

A release builds on the host into a directory of its own, applies only migrations that the release before it can still serve against, and switches with one rename of a symbolic link. It then requests every public route through nginx; a failed check puts the previous release back without a hand on the keyboard. At one concurrent request, the API answers its content endpoints in about 8 ms at the 95th percentile.

Every release can roll back without touching the database.

Written down

Forty-three architecture decision records, a ground-truth file of measured facts, a runbook, and a site specification decide the system. A unit test reads the specification, so the interface copy cannot drift from it.

The drawing set

The interface is a set of drawing sheets that stack as the page scrolls. Each project carries a drawing of its own system, written as code and animated only while it is in view, and a project without one shows a title plate until it has one. Under reduced motion, the set arrives finished.