Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
kaseyliu committed Jan 30, 2025
2 parents df3428f + ccf5202 commit 55ad5d0
Show file tree
Hide file tree
Showing 12 changed files with 241 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# create local copy of this file and rename to .env.local
# make sure to add .env.local to .gitignore!!
MONGO_URI={mongo-uri-here}
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/new-issue.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: New Issue
about: Create a new issue
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Description**
Expand All @@ -14,6 +13,7 @@ A clear and concise description of what the problem is. Ex. I'm always frustrate
A clear and concise description of what you want to happen.

Steps:

- step 1
- step 2

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ jobs:
# - Settings -> Secrets and variables -> New repository secret
MONGO_URI: ${{ secrets.MONGO_URI }}
# Add additional environment variables here

- name: Run tests
run: npm test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

prettier.config.js
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ A data collection platform for tree information and location
- [Getting Started And Contributing](#getting-started-and-contributing)

## Overview

The Central Coast Heritage Tree Foundation focuses on the protection, preservation, and preventive healthcare for legacy and heritage oaks in the greater Templeton area. They help heritage oaks by utilizing preventive tree care, restoring soil, planting Templeton acorns, and educating the community through conversation and connection.

### Purpose
Expand Down Expand Up @@ -37,7 +38,6 @@ The Central Coast Heritage Tree Foundation team consists of 14 Cal Poly students
- [Brandon Eng](https://www.linkedin.com/) - Software Developer
- [Thomas Le](https://www.linkedin.com/) - Software Developer


## Getting Started And Contributing

Visit [getting-started.md](docs/getting-started.md) on info for how to set up this repo.
Expand Down
4 changes: 2 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {}
const nextConfig = {};

module.exports = nextConfig
module.exports = nextConfig;
25 changes: 25 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"framer-motion": "^11.18.0",
"leaflet": "^1.9.4",
"mongoose": "^8",
"next": "^15.1.6",
"react": "^18",
"react-dom": "^18"
},
"devDependencies": {
"@types/leaflet": "^1.9.16",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
Expand Down
44 changes: 43 additions & 1 deletion src/app/map/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
"use client";
import { useRef, useEffect } from "react";
import { Tree, treeData } from "./tree_data";
import styles from "@/styles/map.module.css";
import dynamic from "next/dynamic";
//import leaflet in client
const L = dynamic(() => import("leaflet") as any, {
ssr: false,
});
export default function Map() {
return <div>Will probably be made into a component later and not a page, but go to /map to develop!</div>;
const mapRef = useRef(null);
useEffect(() => {
require("leaflet/dist/leaflet.css");
const L = require("leaflet");
const DefaultIcon = L.icon({
iconUrl: "https://unpkg.com/[email protected]/dist/images/marker-icon.png",
shadowUrl: "https://unpkg.com/[email protected]/dist/images/marker-shadow.png",
});
L.Marker.prototype.options.icon = DefaultIcon;
//initilize the map
if (!mapRef.current) {
mapRef.current = L.map("map").setView([35.270378, -120.680656], 14.5);
L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png").addTo(mapRef.current);
//add marker to map
treeData.map((tree: Tree) => {
const marker = L.marker([tree.gpsCoords[0], tree.gpsCoords[1]]).addTo(mapRef.current);
marker.bindPopup(`
<strong>${tree.species}</strong><br/>
Collected by: ${tree.collectorName}<br/>
Date Collected: ${tree.dateCollected.toISOString().split("T")[0]}<br/>
Notes: ${tree.notes || "No additional notes"}
`);
});
}
}, []);

return (
<div>
<div className={styles.MapContainer}>
Map with 5 points
<div id="map" style={{ height: "50vh", width: "75%" }}></div>
</div>
</div>
);
}
60 changes: 60 additions & 0 deletions src/app/map/tree_data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
//temp class tree
export interface Tree {
collectorName: string;
gpsCoords: number[];
dateCollected: Date;
photo?: string;
dbh: number;
canopyBreadth: number;
species: string;
treeCond: string[];
notes?: string;
}
//Dummy data
export const treeData: Tree[] = [
{
collectorName: "John Doe",
gpsCoords: [35.267763, -120.675414],
dateCollected: new Date("2025-01-25"),
dbh: 15.2,
canopyBreadth: 8.5,
species: "Quercus agrifolia",
treeCond: ["Healthy", "Mature"],
},
{
collectorName: "Jane Smith",
gpsCoords: [35.273266, -120.680012],
dateCollected: new Date("2025-01-26"),
dbh: 10.4,
canopyBreadth: 6.3,
species: "Pinus ponderosa",
treeCond: ["Healthy", "Young"],
},
{
collectorName: "Michael Brown",
gpsCoords: [35.276883, -120.673991],
dateCollected: new Date("2025-01-27"),
dbh: 20.8,
canopyBreadth: 12.4,
species: "Sequoia sempervirens",
treeCond: ["Healthy", "Mature", "Thriving"],
},
{
collectorName: "Sarah Johnson",
gpsCoords: [35.276889, -120.686529],
dateCollected: new Date("2025-01-27"),
dbh: 5.9,
canopyBreadth: 3.2,
species: "Acer macrophyllum",
treeCond: ["Healthy", "Young"],
},
{
collectorName: "Emily Davis",
gpsCoords: [35.270783, -120.674544],
dateCollected: new Date("2025-01-28"),
dbh: 25.6,
canopyBreadth: 15.7,
species: "Platanus racemosa",
treeCond: ["Healthy", "Old Growth"],
},
];
92 changes: 91 additions & 1 deletion src/app/treeTable/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,93 @@
import { Table, Thead, Tbody, Tr, Th, Td, TableContainer, Box } from "@chakra-ui/react";

export default function TreeTable() {
return <div>Will probably be made into a component later, but for now develop on /treeTable</div>;
// dummy tree data
const treeData = [
{
collectorName: "Sydney Jones",
dateCollected: "2025-01-22",
contactInfo: "[email protected]",
gpsCoordinates: "34.0522, -118.2437",
photo: "tree1.jpg",
dbh: "15.3",
height: "25 ft",
canopyBreath: "20 ft",
species: "Valley Oak",
mistletoe: false,
epicormicGrowth: true,
deadWood: true,
oakPitScale: "no",
hangingItems: false,
additionalNotes: "Tree appears healthy overall.",
},
{
collectorName: "Ryan Smith",
dateCollected: "2025-01-20",
contactInfo: "[email protected]",
gpsCoordinates: "37.7749, -122.4194",
photo: "tree2.jpg",
dbh: "20.1",
height: "30 ft",
canopyBreath: "25 ft",
species: "Blue Oak",
mistletoe: true,
epicormicGrowth: false,
deadWood: false,
oakPitScale: true,
hangingItems: false,
additionalNotes: "Signs of stress due to drought.",
},
];

// tree table structure
return (
<div>
<Box p={5}>
<TableContainer>
<Table>
<Thead>
<Tr>
<Th>Collector Name</Th>
<Th>Date Collected</Th>
<Th>GPS Coordinates</Th>
<Th>Photo</Th>
<Th>DBH (inches)</Th>
<Th>Height</Th>
<Th>Tree Canopy Breadth</Th>
<Th>Species</Th>
<Th>Mistletoe</Th>
<Th>Epicormic Growth</Th>
<Th>Dead Wood</Th>
<Th>Oak Pit Scale</Th>
<Th>Hanging Items</Th>
<Th>Additional Notes</Th>
</Tr>
</Thead>
<Tbody>
{treeData.map((tree, index) => (
<Tr key={index}>
<Td>{tree.collectorName}</Td>
<Td>{tree.dateCollected}</Td>
<Td>{tree.gpsCoordinates}</Td>
<Td>
<img src={tree.photo} alt="Tree" width="50" height="50" />
</Td>
<Td>{tree.dbh}</Td>
<Td>{tree.height}</Td>
<Td>{tree.canopyBreath}</Td>
<Td>{tree.species}</Td>
<Td>{tree.mistletoe === true ? "Yes" : "No"}</Td>
<Td>{tree.epicormicGrowth === true ? "Yes" : "No"}</Td>
<Td>{tree.deadWood === true ? "Yes" : "No"}</Td>
<Td>{tree.oakPitScale === true ? "Yes" : "No"}</Td>
<Td>{tree.hangingItems === true ? "Yes" : "No"}</Td>
<Td>{tree.additionalNotes}</Td>
</Tr>
))}
</Tbody>
</Table>
</TableContainer>
</Box>
</div>
);
}
7 changes: 7 additions & 0 deletions src/styles/map.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.MapContainer {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
height: 100vh;
}

0 comments on commit 55ad5d0

Please sign in to comment.