Loading homepage
Build a simple user profile card. Fetch the supplied demo API once when the component mounts, save its JSON response in state, and render the name, email, and city.
Demo API: GET /api/demo/user on this app. It returns fictional public data: { "id": 1, "name": "Maya Patel", "email": "maya@example.com", "city": "Pune" }. No login or API key is needed.
In the sandbox, import APP_ORIGIN from /__frontcrate_api__.js and fetch APP_ORIGIN + "/api/demo/user". The starter comment includes this URL.
Input: Component mounts Output: Loading user...
Input: API returns a user Output: Maya Patel / maya@example.com / Pune
Input: API request fails Output: Could not load user.
Mount → fetch the demo API → store the response → render the profile. The test runner uses controlled API responses.