How gardemanuelsen/randompics works
Random picture generator is a small React app whose principal workflow is: a user presses the button, App requests a random squarish image from Unsplash through the API helper, stores the returned small-image URL, and passes it to the result component for display. The sampled source confirms the React mount, request configuration, state update, and conditional rendering. No persistent storage or additional product subsystems are present.
Components 6
Application UI
- App Controller
src/App.js - Image Result
src/ImageResult.js
Image Retrieval
- Image API Helper
src/api.js - Unsplash API
React Runtime
- React Mount
src/index.js
Other components
- User
Connections 7
- User → App Controller: clicks button
- React Mount → App Controller: renders
- App Controller → Image API Helper: requests image
- Image API Helper → Unsplash API: fetches photo
- Unsplash API → Image API Helper: returns photo
- Image API Helper → App Controller: returns URL
- App Controller → Image Result: passes image