Skip to content

Mocking vs. Real Backend

Claude builds a mock backend that intercepts API calls and returns realistic data. No backend server is needed during development.

All mock handlers live in the web/ directory alongside the app code.

When your real backend is available, set one environment variable in your web/.env.local file:

NEXT_PUBLIC_API_BASE_URL=https://your-api.example.com

The app immediately routes all API calls to your real backend instead of the mock.

No code changes needed. No scattered conditionals. One variable controls it.

If you haven’t set up your .env.local file yet, see Environment Configuration.

If you provided an OpenAPI spec in documentation/, Claude mocks every endpoint defined in the spec with realistic responses that match the declared response shape.

If you didn’t provide a spec, Claude infers a reasonable API shape from your requirements and mocks against that.

Sample data from documentation/ is used to populate mock responses where possible.