A page loading on your laptop does not prove that a deployed application works. Local development hides assumptions: a backend might be running on another port, a database password might be present only on your machine, or every route may be returning the same HTML file. This guide walks through one small release: a project gallery with an API and a PostgreSQL database.
Draw the request path first
The browser requests HTML and assets from the frontend host. It then requests /api/projects. A server handles the request, reads public project records from PostgreSQL, and returns JSON. The database password belongs to that server. A variable shipped in browser JavaScript is public even when its name contains “secret”.
Define a configuration contract
- Use a server-only
DATABASE_URLstored in your hosting provider's environment settings. - List variable names and their purposes in an example environment file, with placeholder values.
- Keep real environment files and database exports outside version control.
- Fail startup or return an unavailable error when production configuration is missing. Silently switching to a local database creates confusing, split data.
Test an API response, not just a status code
const response = await fetch('/api/projects');
const type = response.headers.get('content-type') || '';
if (!response.ok || !type.includes('application/json')) {
throw new Error('Project API did not return JSON');
}
const data = await response.json();A static hosting fallback can return status 200 with an HTML page for an unknown API path. Inspect the response body and content type before blaming JSON parsing. API rewrites must be evaluated before the frontend's catch-all route.
Run a release smoke test
- Open the homepage in a private browser window.
- Visit a nested route directly and reload it. This catches missing route configuration.
- Load one public API and one image; confirm their MIME types.
- With an account you control, test signup, verification, login, and logout.
- Submit a harmless record only in a designated test environment, then confirm it reaches that environment's database.
- Check server logs without copying tokens or connection strings into public tickets.
Keep a rollback path
Record the previous deployment and commit before release. Prefer additive database changes: deploy a new nullable column before code requires it. A code rollback cannot reverse an already destructive migration. Back up affected data and review migration behavior separately from frontend changes.
Deliverable
Your project README should contain a public demo URL, setup instructions, required variable names, known limitations, and one repeatable smoke test. Never include live credentials. Open the Project Gallery to compare how a clear demo and a focused description help a reviewer understand a project.
Reference: MDN: HTTP overview.
DEV HARBOUR