Skip to content
Lesson Fourteen

A reference
architecture

Four parts, each one a role. This stack covers most of what a small team will build.

Scroll, click, or use the arrow keys to move through.Scroll, or use the arrows and dots to move through.

Decide once, build many times

Once the stack is settled, every project after it starts faster.

Every new project can be an argument about frameworks, databases and hosting. The argument lands in the same place each time.

A default stack ends the argument. The parts are known to work together, the failure modes are familiar, and anyone who has used it before can read the next project. A common stack is also the best documented. Documentation is what an AI writing the code draws on.

A settled stack is also what a technical requirements document points at. Writing one for a new project becomes a page rather than a chapter.

The frontend and backend

A development framework is both halves of the application in one codebase.

The pages people see and the code that runs on the server live in the same project. A page can call a function that runs on the server without a separate service in between.

For a small team this removes a whole category of work. There is one repository, one deploy, and one set of dependencies rather than two of each.

Names you may know: Next.js · Nuxt · SvelteKit · Django · Rails
The database

A hosted database is a resource that nobody on the team operates.

The engine underneath is a standard one, so the queries are ordinary queries and the data can be moved somewhere else later.

What arrives
An address, a set of credentials, and a bill.
What does not

A machine. Patches, backups and failover belong to the provider.

Names you may know: Neon · Supabase · RDS · Cloud SQL
The hosting

A hosted server is the platform that runs the application and answers the requests.

There is no machine to provision and nothing to install. The project is connected once. From then on the platform builds the code and runs it.

Capacity moves with traffic. A quiet week and a busy one need no action from anyone.

Names you may know: Vercel · Netlify · Render · Fly
The spine

A push to the main branch becomes a deployment.

Version control holds every version of the project. A shared copy sits with a hosting service, which is what the whole team works against. The platform watches that copy.

Commit, push, and the platform builds the project and puts it live. Nobody copies files onto a server. There is no separate release step to forget.

What is in the main branch is what customers are using, so access to the repository is access to production.

Environments

The same code runs three times, against different data.

Local
The copy on your own machine, pointed at a database you can break.
Preview
Built for every branch before it is merged. A real URL, running the proposed change, against data that is not the live data.
Production
The main branch, running against the real database.
Secrets

The credentials do not live in the code.

The database address, the API keys and the signing secrets are set in the hosting platform and read by the application at runtime. Each environment holds its own.

Nothing sensitive is committed. Anything that does get committed is in the history permanently. Rotating it is the only real fix.

In the repo: the code · In the platform: the credentials
Put it together

One change, from a
laptop to live

A real example: a typo on the pricing page

What happens between the edit and the customer seeing it.

1
The text is changed on a branch, on a laptop, running against the local database.
2
The change is committed and pushed to the shared repository.
3
The platform builds that branch and produces a preview URL. Somebody opens it and reads the page.
4
The branch is merged into main.
5
The platform builds main and puts it live. The old version stays in the history.
6
The credentials never moved. Each environment read its own.

Four parts, one change, and nobody touched a server.

Putting it together
The lesson in one line

Both halves in one project, a database you never operate, and version control as the spine.

The stack is an opinion. Its value is that the opinion is already formed. Environments keep the real data away from the work in progress. The credentials stay out of the repository.