# Project export: SeedLink

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: TreeHacks 2025
- Tagline: SeedLink – Reviving Plants, One Seed at a Time. AI-powered insights and community incentives help individuals plant endangered species in the right locations, ensuring lasting biodiversity.
- Devpost: https://devpost.com/software/seedlink-8jrdxe
- GitHub: https://github.com/vicksey/SeedLink.git
- Video: https://www.youtube.com/embed/243YemsdNiQ?enablejsapi=1&hl=en_US&rel=0&start=&version=3&wmode=transparent
- Team: 3 GitHub contributor(s) — some-kim (26 commits), Mona Afshar (12 commits), vicksey (1 commits)

## Devpost submission (written by the team)

### Inspiration

Many species of plants are going extinct and traditional seed banking isn’t enough to save them. While we initially took inspiration from the Svalbard Global Seed Vault in Norway, which preserves millions of seeds, we learned that simply storing seeds isn’t enough to prevent the extinction of certain plant species. Current environmental challenges, including climate change, habitat destruction, and biodiversity loss threaten entire ecosystems. The removal of just a few key plant species can trigger the collapse of entire ecosystems affecting wildlife, food sources, and human livelihoods. We wanted to create a proactive solution that spreads awareness while empowering individuals to actively plant and nurture endangered species, rather than relying solely on storage systems. By combining AI-driven recommendations with community engagement and incentives, SeedLink makes conservation accessible, impactful, and rewarding for everyone.

### What it does

SeedLink is an AI-powered platform that guides users in planting endangered species based on their location and environmental conditions. Users can: Receive personalized seed recommendations for their area. Track plant growth over time with AI-powered monitoring. Earn rewards (financial and emotional) for verifying plant survival. Engage with the community through a social thread to share progress and encouragement.

### How we built it

Frontend: React + Vercel for a smooth interactive web app experience and UI/UX design Backend: Node.js with Firebase and Google OAuth for authentication. AI Integration: PerplexityPro generates agricultural reports based on user input. Mistral AI analyzes seed inventory and planting conditions to optimize recommendations. Database: Seed inventory is stored and displayed as a spreadsheet format for easy management. Map Component: Visualizes planted seeds and tracks their growth over time.

### Challenges we ran into

Data accuracy: Ensuring AI-generated planting recommendations were both reliable and sustainable. Incentive model: Designing a reward system that balances financial viability with user engagement. Real-time updates: Implementing a seamless way to track plant growth progress dynamically.

### Accomplishments we're proud of

Successfully built an AI-powered recommendation engine for sustainable planting. Designed an interactive map to visualize conservation impact. Created a community-driven approach that makes biodiversity conservation engaging and rewarding. Integrated secure authentication with Google OAuth to protect user data.

### What we learned

The importance of community incentives in driving conservation efforts. How to integrate AI-driven insights into real-world applications. The challenges of balancing environmental sustainability with user engagement and rewards.

### What's next

Expanding plant species recommendations to include more diverse climates. Enhancing AI monitoring to detect plant health issues early. Partnering with conservation organizations and global governments to scale our reach. Developing a mobile app for easier on-the-go tracking and engagement. Perplexity Integration: We leveraged PerplexityPro to generate detailed agricultural reports, helping users make informed planting decisions based on climate conditions, soil types, and seasonal trends. While we primarily used PerplexityPro, we did not utilize Perplexity's Sonar, Sonar Pro, or Sonar Reasoning APIs, though they could enhance future iterations. Spreadsheet Management & Data Structuring: Our seed inventory is structured in an Excel-like format, ensuring efficient data visualization and easy updates.Demonstrating best practices in structured data management. Mistral AI API Utilization: Mistral AI plays a critical role in analyzing agricultural reports and seed inventory to determine optimal planting recommendations. This integration enhances decision-making accuracy User Experience (UX) Enhancements: We refined login authentication using Google OAuth, making it seamless and secure. Our UI/UX decisions prioritize simplicity, accessibility, and engagement. Venture Viability & Business Potential: SeedLink’s model extends beyond a hackathon project—it presents a scalable business opportunity in environmental conservation, AI-driven sustainability, and corporate CSR partnerships. Our work is, supported by our focus on sustainable incentives, partnerships, and long-term engagement strategies. Broader Context for Sustainability Track: We considered regulatory, financial, and social constraints to enhance venture viability. By addressing ecosystem balance, preventing invasive species, and ensuring equitable access

## README (from the GitHub repository)

# React + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh





# SeedLink - Reviving Plants, One Seed at a Time

## Overview
SeedLink is a platform designed to combat plant extinction by encouraging individuals to plant species that are at risk. Traditional seed banking is insufficient—plants need to be actively planted and nurtured to ensure their survival. SeedLink leverages AI and community engagement to guide users in planting the right seeds in the right locations while providing emotional and financial incentives to ensure long-term commitment.

## Features

### User Experienc
- **Location-Based Planting Recommendations**: Users receive AI-driven recommendations for the best plants to grow based on their location and environmental conditions.
- **Incentives for Participation**:
  - **Emotional**: Sponsor or gift a tree to loved ones.
  - **Financial**: Users earn points or monetary rewards by verifying plant survival.
- **Impact Tracking**:
  - Local and global impact data visualization.
  - AI-powered growth monitoring over time.

### Implementation
- **Web App Dashboard**: User-friendly interface for tracking progress and accessing recommendations.
- **Authentication**: Google OAuth login for secure access.
- **Seed Inventory Management**:
  - Individual organizations maintain their own inventory.
  - Data displayed in an Excel-like format.
- **User Input Data**:
  - Users provide planting date (month/year) and location.
  - Data used for future planting predictions.
- **AI-Powered Insights**:
  - **PerplexityPro**: Generates agricultural reports based on user-provided data.
  - **Mistral AI**: Analyzes seed inventory and agricultural reports to determine optimal planting strategies.
- **Interactive Map**:
  - Displays planted seeds and their progress over time.
- **Community Thread**:
  - Users can like, comment, and track plant growth progress.

## Backend Pipeline
1. **User Input Processing**
   - Users enter planting date and location.
2. **PerplexityPro Integration**
   - Generates agricultural reports tailored to the user’s location and timeframe.
3. **Mistral AI Analysis**
   - Uses the agricultural report and seed inventory data to determine the best plants for the region.
4. **Map & Growth Visualization**
   - AI tracks plant progress and displays changes over time.
5. **Community Engagement**
   - Users interact, share progress, and encourage each other.

## Impact
SeedLink fosters a community-driven approach to reviving endangered plants by combining AI-driven insights with social incentives. By empowering individuals and organizations to plant strategically, SeedLink ensures a meaningful and lasting impact on biodiversity conservation.


## Detected evidence (automated analysis)

Indexed codebase: 31 recognized source files, 63 KB.
- CSS (language) — detected in the code
- Express (technology) — detected in the code
- HTML (language) — detected in the code
- JavaScript (language) — detected in the code
- React (technology) — detected in the code
- Tailwind CSS (technology) — detected in the code
- TypeScript (language) — detected in the code
- Mistral AI (technology) — claimed on Devpost, not found in the code

## Codebase structure (from repository index)

### Files (35 of 35)

```
.gitignore
backend/mistralAI.js
backend/perplexity.js
backend/seedInventory.json
backend/server.js
eslint.config.js
index.html
my-project/.react-router/types/app/+types/root.ts
my-project/.react-router/types/app/routes/+types/home.ts
package.json
README.md
src/App.css
src/App.jsx
src/Banner.jsx
src/Community.css
src/Community.jsx
src/context/userContext.jsx
src/Dashboard.css
src/Dashboard.jsx
src/Home.css
src/Home.jsx
src/index.css
src/login.css
src/login.jsx
src/main.jsx
src/Map.jsx
src/navcomp/navbar.css
src/navcomp/navbar.jsx
src/Slideshow.css
src/Slideshow.jsx
src/Upload.css
src/Upload.jsx
test-mistral.js
test-perplexity.mjs
vite.config.js
```

### Dependencies

- package.json: @eslint/js@^9.19.0, @react-google-maps/api@^2.20.6, @react-oauth/google@^0.12.1, @rollup/rollup-win32-x64-msvc@4.6.1, @types/react@^19.0.8, @types/react-dom@^19.0.3, @vitejs/plugin-react@^4.3.4, autoprefixer@^10.4.20, axios@^1.7.9, bootstrap@^5.3.3, cors@^2.8.5, dotenv@^16.4.7, eslint@^9.19.0, eslint-plugin-react@^7.37.4, eslint-plugin-react-hooks@^5.0.0, eslint-plugin-react-refresh@^0.4.18, express@^4.21.2, globals@^15.14.0, jquery@^3.7.1, popper.js@^1.16.1, postcss@^8.5.2, react@^19.0.0, react-bootstrap@^2.10.9, react-dom@^19.0.0, react-icons@^5.4.0, react-router-dom@^7.1.5, reactstrap@^9.2.3, tailwindcss@^4.0.6, vite@^6.1.0, vite-plugin-node-polyfills@^0.23.0

### Recent commits (newest first)

- uh idk
- auth redirect
- Merge branch 'main' of https://github.com/vicksey/SeedLink
- name fix
- New inventory
- nav
- Merge branch 'main' of https://github.com/vicksey/SeedLink
- updates
- spreadsheet
- updated home buttons
- Update README.md
- Merge branch 'main' of https://github.com/vicksey/SeedLink
- auth
- Merge branch 'main' of https://github.com/vicksey/SeedLink
- 2 paras
- fixed pictures
- Merge branch 'main' of https://github.com/vicksey/SeedLink
- might be google oauth
- Merge branch 'main' of https://github.com/vicksey/SeedLink
- search section result

## Key source files (fetched from GitHub, selected and truncated for size)

### package.json

```
{
  "name": "seedlink",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "lint": "eslint .",
    "preview": "vite preview"
  },
  "dependencies": {
    "@react-google-maps/api": "^2.20.6",
    "@react-oauth/google": "^0.12.1",
    "axios": "^1.7.9",
    "bootstrap": "^5.3.3",
    "cors": "^2.8.5",
    "dotenv": "^16.4.7",
    "express": "^4.21.2",
    "jquery": "^3.7.1",
    "popper.js": "^1.16.1",
    "react": "^19.0.0",
    "react-bootstrap": "^2.10.9",
    "react-dom": "^19.0.0",
    "react-icons": "^5.4.0",
    "react-router-dom": "^7.1.5",
    "reactstrap": "^9.2.3"
  },
  "optionalDependencies": {
    "@rollup/rollup-win32-x64-msvc": "4.6.1"
  },
  "devDependencies": {
    "@eslint/js": "^9.19.0",
    "@types/react": "^19.0.8",
    "@types/react-dom": "^19.0.3",
    "@vitejs/plugin-react": "^4.3.4",
    "autoprefixer": "^10.4.20",
    "eslint": "^9.19.0",
    "eslint-plugin-react": "^7.37.4",
    "eslint-plugin-react-hooks": "^5.0.0",
    "eslint-plugin-react-refresh": "^0.4.18",
    "globals": "^15.14.0",
    "postcss": "^8.5.2",
    "tailwindcss": "^4.0.6",
    "vite": "^6.1.0",
    "vite-plugin-node-polyfills": "^0.23.0"
  }
}

```

### src/App.jsx

```javascript
import Navbar from "./navcomp/navbar";
import { Routes, Route } from "react-router-dom";
import Home from "./Home";
import Dashboard from "./Dashboard";
import Upload from "./Upload";
import Community from "./Community";
import Login from "./login";


function App() {
  return (
    <>
      <Navbar /> {/* ✅ Navbar is always visible */}
      <Routes>
        <Route path="/" element={<Home />} />
        <Route path="/dashboard" element={<Dashboard />} />
        <Route path="/upload" element={<Upload />} />
        <Route path="/community" element={<Community />} />
        <Route path="/login" element={<Login />} />
      </Routes>
    </>
  );
}

export default App;

```

### src/main.jsx

```javascript
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App.jsx";
import "./index.css";
import { GoogleOAuthProvider } from "@react-oauth/google";
import { BrowserRouter as Router } from "react-router-dom";
import { UserProvider } from "./context/userContext.jsx"; // Import UserProvider

const GOOGLE_CLOUD_CLIENTID = import.meta.env.VITE_GOOGLE_CLOUD_CLIENTID;

if (!GOOGLE_CLOUD_CLIENTID) {
    console.error("❌ Missing GOOGLE_CLOUD_CLIENTID. Make sure it's set in the .env file.");
} else {
    console.log("✅ Google Client ID Loaded!");

    console.log("Google Client ID:", import.meta.env.VITE_GOOGLE_CLOUD_CLIENTID);
}

ReactDOM.createRoot(document.getElementById("root")).render(
    <GoogleOAuthProvider clientId={GOOGLE_CLOUD_CLIENTID}>
        <React.StrictMode>
            <Router>
                <UserProvider>
                    <App />
                </UserProvider>
            </Router>
        </React.StrictMode>
    </GoogleOAuthProvider>
);

```

### backend/server.js

```javascript
import express from "express";
import cors from "cors";
import dotenv from "dotenv";
import getAgriculturalReport from "./perplexity.js";
import { getSeedRecommendation } from "./mistralAI.js";
import seedInventory from "./seedInventory.json" assert { type: "json" };

dotenv.config();
const app = express();
const PORT = 4000;

app.use(cors()); // Allows the frontend to make requests to the backend
app.use(express.json());

// 🌍 Endpoint to get the agricultural report
app.post("/api/agriculture-report", async (req, res) => {
    const { city, range } = req.body;
    if (!city || !range) return res.status(400).json({ error: "Missing parameters" });

    try {
        const report = await getAgriculturalReport(city, range);
        res.json({ report });
    } catch (error) {
        res.status(500).json({ error: error.message });
    }
});

// 🌱 Endpoint to get seed recommendations
app.post("/api/seed-recommendation", async (req, res) => {
    const { city, range, month, year } = req.body;
    if (!city || !range || !month || !year) return res.status(400).json({ error: "Missing parameters" });

    try {
        const analysis = await getSeedRecommendation(city, range, seedInventory, month, year);
        res.json({ analysis });
    } catch (error) {
        res.status(500).json({ error: error.message });
    }
});

// Start the server
app.listen(PORT, () => {
    console.log(`🚀 Backend running on http://localhost:${PORT}`);
});

```

### vite.config.js

```javascript
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

// https://vite.dev/config/
export default defineConfig({
  plugins: [react()],
  server: {
    proxy: {
      "/api": "http://localhost:4000",
    },
  },
  headers: {
    "Cross-Origin-Opener-Policy": "same-origin-allow-popups",  // ✅ Allows pop-ups
    "Cross-Origin-Embedder-Policy": "credentialless",
  },
})

```

### index.html

```html
<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <!-- Link to your custom favicon -->
    <link rel="icon" type="image/png" href="/logo.png" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <!-- Updated title for your website -->
    <title>SeedLink 🌱</title>
  </head>
  <body>
    <div id="root"></div>
    <script type="module" src="/src/main.jsx"></script>
  </body>
</html>

```

### test-mistral.js

```javascript
import dotenv from 'dotenv';
import fs from 'fs';
import { getSeedRecommendation } from './backend/mistralAI.js';

dotenv.config();

const seedInventory = JSON.parse(fs.readFileSync('./backend/seedInventory.json', 'utf8'));

(async () => {
    const location = "San Antonio, Texas, USA";
    const range = 20;
    const month = "April";
    const year = 2025;

    console.log("🌱 Running Seed Recommendation Query...");
    
    const recommendation = await getSeedRecommendation(location, range, seedInventory, month, year);

    if (recommendation) {
        console.log("\n🌍 **Best Seed Recommendation:**\n", recommendation);
    } else {
        console.log("⚠️ Failed to generate a seed recommendation.");
    }
})();

```

### eslint.config.js

```javascript
import js from '@eslint/js'
import globals from 'globals'
import react from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'

export default [
  { ignores: ['dist'] },
  {
    files: ['**/*.{js,jsx}'],
    languageOptions: {
      ecmaVersion: 2020,
      globals: globals.browser,
      parserOptions: {
        ecmaVersion: 'latest',
        ecmaFeatures: { jsx: true },
        sourceType: 'module',
      },
    },
    settings: { react: { version: '18.3' } },
    plugins: {
      react,
      'react-hooks': reactHooks,
      'react-refresh': reactRefresh,
    },
    rules: {
      ...js.configs.recommended.rules,
      ...react.configs.recommended.rules,
      ...react.configs['jsx-runtime'].rules,
      ...reactHooks.configs.recommended.rules,
      'react/jsx-no-target-blank': 'off',
      'react-refresh/only-export-components': [
        'warn',
        { allowConstantExport: true },
      ],
    },
  },
]

```

### src/Slideshow.css

```css



.slideshow {
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    text-align: center;
}

.carousel img {
    border-radius: 10px;
    width: 100%;
    height: auto;
}

```

### src/login.css

```css
.login-container {
  text-align: center;
  margin-top: 50px;
}

.google-login-btn,
.logout-btn {
  background-color: #4285f4;
  color: white;
  border: none;
  padding: 10px 15px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 5px;
}

.google-login-btn:hover,
.logout-btn:hover {
  background-color: #357ae8;
}

.profile {
  margin-top: 20px;
}

.profile img {
  width: 100px;
  border-radius: 50%;
  margin-bottom: 10px;
}
```

[21 more indexed source files omitted to keep this export small. The full file list is in the Codebase structure section above.]