Skip to content

Feature Request: Dynamic "Discover" Page with External Plant Database API Integration #65

@tulikaa25

Description

@tulikaa25

Feature Description: This feature proposes enhancing the existing static "Discover" page to provide dynamic and richer information about various plant species by integrating with an external plant database API. Currently, the "Discover" page (index.html ) displays a few hardcoded plant examples. This enhancement would allow the app to fetch and display a wider range of plant information, including detailed care guides, images, and facts, making the "Discover" section a more valuable resource for users.

Benefits: Integrating an external plant database API for the "Discover" page would significantly improve the application by:

  1. Providing Richer Content: Offer users access to a vast and diverse collection of plant species and their details, far beyond what can be manually maintained.
  2. Dynamic and Up-to-Date Information: Ensure that plant information is current and accurate, as it would be sourced directly from a specialized database.
  3. Enhancing User Learning: Empower users to learn about new plants, their characteristics, and specific care requirements, fostering better plant parenting.
  4. Increasing Engagement: A dynamic and informative "Discover" section would encourage users to spend more time in the app, exploring new content.
  5. Scalability: The content of the "Discover" page can grow without requiring code changes, simply by leveraging the API.

Proposed Implementation (High-Level):

  1. API Selection: Identify a suitable public plant database API (e.g., Trefle.io, Plant.id, or similar). Considerations include API key requirements, rate limits, data richness, and ease of integration.

  2. JavaScript Integration:

    • Create a new JavaScript module (e.g., scripts/plant-discovery.js) to handle API calls.
    • Implement functions to fetch plant data based on search queries or categories.
    • Handle API responses, including error handling and loading states.
  3. UI Rendering:

    • Modify the BotanicalApp class (or a new PlantDiscovery class) to render the fetched plant data dynamically into the discover page's discovery-grid.
    • Each plant entry would display key information (name, image, brief description) and potentially link to a detailed view (either within the app or to the API's source).
    • Consider adding search and filter capabilities to the "Discover" page itself to allow users to find specific plants.
  4. Placeholder/Loading States: Implement loading indicators and graceful fallback mechanisms (e.g., "No results found" messages) for when API calls are in progress or fail.

Proposed Flow (Dynamic Discover Page):

-> User types "fern" into search bar
-> [API Call to Plant Database]
-> [Loading Indicator]
-> [Discovery Grid Populated Dynamically]
[Card: Boston Fern]
- Image: boston_fern.jpg
- Description: Classic fern, loves humidity.
[View Details Button]
[Card: Maidenhair Fern]
- Image: maidenhair_fern.jpg
- Description: Delicate, requires consistent moisture.
[View Details Button]
... (many more results)

-> Click "View Details" on "Boston Fern"
-> [New Modal/Page for Detailed Plant Info]
- Large Image
- Scientific Name
- Full Care Guide (Watering, Light, Humidity, Soil)
- Fun Facts
- Toxicity (if applicable)
[Close Button]

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions