Next.js owns the product UI
React and TypeScript make it practical to build interactive screens, compose a design system, and keep frontend work focused.
SaaS Hammer reference architecture
A fast React product UI paired with Django's business core, without infrastructure you do not need on day one.
Follow one request below: from the browser, through the UI and a token-checked API contract, into the Django core and its data, with slow work branching off to workers.
Request lifecycle
Reference pattern
Browser
A visitor uses the product.
Next.js UI
React screens render and prepare the request.
API contract
The call crosses the DRF boundary with a short-lived token.
Django core
Domain rules, permissions, and data operations run.
PostgreSQL
Persistent application data.
Async work
Slow or retryable work is dispatched to Celery workers; Beat schedules the recurring jobs.
Boundaries
Each side owns its own concerns and meets the other at one contract.
React and TypeScript make it practical to build interactive screens, compose a design system, and keep frontend work focused.
Domain rules, data access, permissions, admin workflows, and API operations stay close to Django conventions.
Design decisions
Three reference patterns worth deciding on purpose, each with the trade-off it asks you to own.
· Decision · Token boundary
The UI presents a short-lived identity token. Django verifies it before every protected API operation.
Trade-off: You own token refresh, expiry, and revocation decisions instead of relying on a browser session.
Reference checklist
· Decision · API boundary
Django validates input, applies permissions, and coordinates the domain. Next.js calls a stable contract instead of reaching into backend internals.
Trade-off: A contract takes maintenance: the UI and the API now move together through published changes.
Reference checklist
· Decision · Asynchronous work
A request dispatches work, workers execute it, and Beat schedules the recurring jobs. Imports, emails, syncs, reports, and retryable jobs all live here.
Trade-off: Results arrive outside the response, so progress, failures, and retries need an explicit story.
Reference checklist
Topology
The lifecycle above follows one request. Topology is about which services exist, who owns them, and what fails independently.
Local development
Production topology
How you host it is a deployment choice. That each concern runs, scales, and fails on its own is not — request, task, and data failures stay isolated in both environments.
Comparison
Django + Next.js is the default SaaS Hammer builds toward. It is not a universal winner.
| Approach | Best when | Trade-off |
|---|---|---|
| Pure Django templates | The interface is server-rendered, interactions are modest, and one Python codebase keeps the team moving. | Rich product UI and independently evolving frontend workflows can become harder to organize. |
| Django + Next.jsSaaS Hammer's Choice | You need a React product UI while keeping Django for domain logic, data, permissions, and operations. | You own an API contract, two development environments, and an intentional auth strategy. |
| Pure Next.js backend | Your team is all-in on TypeScript and the backend scope is small enough for its chosen server runtime. | You give up Django conventions and may need to assemble admin, ORM, background work, and operations separately. |
Pre-flight
Four checks worth passing before committing screens, contracts, and infrastructure to the stack.
Choose an auth model first
Decide how the UI and the API trust each other before building screens around it.
Treat the API as a versioned contract
It is a product surface with consumers, not an internal shortcut.
Move slow work off the request path
Anything heavy or retryable belongs in a worker, not the web request.
Decide what runs together
Know which services share a machine locally and run independently in production.
Next steps
Explore the SaaS Hammer boilerplate, then use the docs to decide which reference patterns belong in your product.