56KGen · Viewport

That window is a bit too cramped

Give the browser a little more breathing room so the interface can render properly.

Width ≥ 320 pxHeight ≥ 250 px

Everything will snap back into place once the window is wide enough.

← All articlesSoftware & operations

A maintainable API needs more than working endpoints

Consistent naming, understandable errors and clear data contracts help an API evolve with the product as requirements change.

1 min read
56K / INSIGHTS

Start with the data contract

Before writing an endpoint, identify who consumes the data and what they need to accomplish. A list needing only titles, statuses and thumbnails should generally not return every record's full body. Smaller responses reduce work for both server and interface.

Define data types, length limits, optional fields and pagination. Validate them on the server even when the interface performs its own checks. Browser input is not a trusted source.

Errors are part of the interface

A useful error tells the caller what to fix. Distinguish invalid data, missing permission and data that has changed. Keep internal paths, queries and sensitive information out of public responses.

When several people can edit a record, use record versions to detect conflicting updates. Instead of silently overwriting work, ask the user to reload the latest content.

Design for the next change

Keep names and response structures consistent. Record important edge cases in tests: deleted records, lost permissions, repeated requests and oversized data. A maintainable API behaves predictably even when a request does not go as expected.

Keep reading

All articles ↗