Services
Backend and API development
GresBox designs and builds the server side of web products: Node.js APIs, PostgreSQL schemas modelled in Prisma, and the migrations, validation and access control that keep the data correct as the application grows.
The problem
Data problems compound. An interface bug annoys a user for an afternoon; a schema that allows two rows to disagree quietly produces wrong numbers for a year, and by the time anyone notices there is no clean version to go back to.
The usual causes are dull and preventable. Validation that runs only in the browser, so anything hitting the endpoint directly writes whatever it likes. Nullable columns that should never have been nullable. Migrations applied by hand on a Friday. An endpoint that returns the entire row, including the fields nobody meant to expose.
How we approach it
The schema comes first. We model the data in Prisma, let the constraints live in the database where they cannot be bypassed, and generate the client from that single definition. Every change ships as a migration in version control and runs as part of the deploy, so the database is never ahead of or behind the code that talks to it.
Every request is validated on the server against an explicit schema before it reaches business logic, and responses select their fields rather than spreading the record. That is what stops an internal column becoming a public one by accident.
Endpoints are typed and versioned. When an API has to change shape, existing clients keep working against the version they were built for instead of breaking on a deploy they knew nothing about.
What you get
A modelled schema
PostgreSQL designed around your actual entities, with constraints and indexes chosen for the queries you really run.
Migrations in version control
Every schema change reviewed like code and applied automatically on deploy. No manual steps, no drift between environments.
Validated, typed endpoints
Server-side schema validation on every request, explicit field selection on every response, types shared with the client.
Authentication and authorisation
Sessions, hashed credentials and role checks enforced on the server for every protected route, not only in the interface.
Queries that stay fast
Indexes on the columns you filter and sort by, no N+1 patterns, and connection pooling sized for how you deploy.
Data handled responsibly
Personal data identified up front, with retention, deletion and log hygiene designed in rather than retrofitted.
How we know this holds
Four decisions about how the data layer is built, each one with the mechanism that enforces it.
Two people, one record, the same instant
At a busy desk this is not theoretical: two staff pressing submit on the same refund is a Tuesday. The guard is a serializable transaction behind a partial unique index, so the second cannot succeed — and the person who loses the race is told where that account actually stands now, which is the thing they were trying to find out, rather than an error page.
Serializable + partial unique index
The invoice desk and the booking engine
Money is an integer, formatted in exactly one place
We took over a catalogue that displayed every amount a hundred times over, for months. The storage was correct; the formatting existed in two files, which is precisely why the bug survived being reported — fixing the page somebody complained about left the other one lying.
Integer paise, one formatter
A class of bug, removed
A side effect never fails the transaction that pays you
Save the record and hold the inventory first; the confirmation email is a courtesy. When the two share a transaction, the courtesy can cancel the business on the day your email provider has an incident — a day you do not control and will not be told about. A failed send is logged against the record with a retry button.
Works with no email provider at all
The hotel booking engine
Constraints live in the database, so the code cannot drift
Anything that must be true of your data is enforced where the data is, not in the one code path somebody remembered. A flag and the rate it implies cannot disagree, a deposit cannot be counted twice, and a soft-deleted record stops counting everywhere rather than in the queries we happened to think of.
Checked at the database, not in a handler
Across the ten projects
Where we have done this
Three projects where the data model was the hard part, not the interface.
Hospitality · independent hotel
Hotel booking engine and front desk
A public booking engine backed by real room inventory, plus the dashboard the front desk runs the day from — built while several of the facts it depends on were still unanswered.
16data models0bookings lost to an email outage2containers, zero-downtime releasesManufacturing · printing and gifting
Catalogue and enquiry CRM, inherited
A product catalogue and enquiry CRM taken over mid-build, audited against the running code, and rebuilt — starting with the 3,800 lines of application code that had never been committed.
9risks found and documented3,800lines of code untracked on arrival24data models after the rebuildFinancial services · co-operative bank
Co-operative bank website and service desk
Fourteen deposit and loan product pages whose interest tables must be publicly accurate, with a statutory complaints channel deliberately modelled apart from ordinary support.
14financial product pages20data models3separate contact obligations
How the work runs
Five steps, the same on every project. You can see the full version on our process page.
- 01
Discovery
We start with a call to understand what you are building, who it is for, and what has to be true for it to work. You leave with a written scope, not a sales pitch.
- 02
Design
We turn the scope into screens before anyone writes application code. You review real layouts, on real breakpoints, with your own content in them.
- 03
Build
We build in short cycles against the agreed sequence, and you get a working URL from the first week. Nothing is demoed from a screenshot.
- 04
Launch
We ship to production with the deployment automated, the database migrated and rollback tested. Launch day is a repeat of something we have already done.
- 05
Support
After launch we keep the application patched, monitored and measured. You decide how involved we stay.
Questions about backend and API work
How do you handle database design and schema changes?
The schema is defined in Prisma and every change ships as a version-controlled migration that runs as part of the deploy. That means the database and the application code move together, and a change can be reviewed and reversed like any other code.
Can you build an API for a mobile app or a third party?
Yes. We build typed HTTP APIs with validated request and response schemas, versioned so an existing client does not break when the API grows.
How do you handle security and data privacy?
Input is validated on the server for every request, secrets stay out of the repository and out of image layers, traffic is TLS only, and access to personal data is authenticated. Where an application stores personal data we design retention and deletion in from the start rather than retrofitting it.
Can you work on an application we have already built?
Yes. We start with a short audit of the codebase, the schema and the deployment path, then give you a written assessment of what is worth keeping, what needs rework, and in what order.
How do you keep an application fast as it grows?
By measuring rather than guessing. We index the columns queries actually filter and sort on, select only the fields a view needs, cache what can be cached and revalidate it on change, and re-run performance budgets in CI so a regression is caught before it ships.
Will we be able to edit content ourselves?
Yes, where the project calls for it. We build an admin area over your own data rather than bolting on a hosted CMS, so content editing does not become a second system to keep in sync.
Other things we do
Most projects need more than one of these. They are listed separately because they are scoped separately, not because they happen separately.
Web application development
React, Next.js and TypeScript applications built to render on the server, hold up under real traffic, and stay maintainable after we leave.
DevOps and deployment
Containerised builds, automated deploys behind Traefik, migrations that run themselves, and a rollback path that has actually been tested.
Performance and SEO
Core Web Vitals measured against real field data, content that renders on the server, and structured data generated from the page it describes.
Have a schema that needs a second opinion?
Send us what you have, whether that is a running API or a diagram on a whiteboard. We will tell you what we would keep and what we would change.