- Action: User navigates to the web application's URL.
- System Response: The React frontend loads and displays the homepage with a text input form.
- Action: User types a description into the text input field.
- System Response: The input field captures the user's text.
- Action: User clicks the "Generate Image" button.
- System Response:
- A loading spinner or message appears.
- The frontend sends a POST request to the backend with the text input.
- System Action:
- The backend validates the input and forwards the request to the AI service.
- The AI service processes the text and generates an image.
- System Response:
- The backend receives the generated image from the AI service.
- The backend stores the text input and image URL in MongoDB.
- The backend sends the image URL back to the frontend.
- System Response:
- The frontend receives the image URL.
- The loading spinner or message disappears.
- The generated image is displayed to the user.
- If an error occurs, an error message is shown.
- Action: User navigates to a "Gallery" or "History" page.
- System Response:
- The frontend sends a GET request to the backend to fetch past images.
- The backend queries MongoDB for past image requests.
- The frontend displays a gallery of previously generated images.