diff --git a/README.md b/README.md index 6b09525d..a62a00f7 100644 --- a/README.md +++ b/README.md @@ -8,16 +8,15 @@ http://it2810-03.idi.ntnu.no/project2/ ## Core features -- **Plant Match:** Shows plants one at a time. Click ✿ to like a plant or ✖ to skip it. -- **Preferences:** Choose what kind of plants you want, for example indoor, outdoor, flowering, pet friendly or succulent. Your preferences are remembered between visits. -- **My Matches:** A list of all the plants you have matched with or have added as matches. Can also delet plants from my matches. -- **Explore Plants:** Search athe plant collection and filter by watering needs, sunlight, location (indoor/outdoor) and edibility. Sort the plants by; alphabetical order, watering and care. Can also add plants to my matches from here. -- **Plant details:** Each plant card shows an image, the scientific name, a description and care information (watering, sunlight and care level). -- **Profile:** Your preferences, description, name and plant avtar is saved. +- **Plant Match:** Shows random plants one at a time. Click ✿ to like a plant or ✖ to skip it. +- **Preferences:** Choose what you want from a plant: how much water it needs (minimum, average, frequent), how much sun it needs (full sun, part shade, filtered shade) and how much care it needs (easy, medium, hard). The preferences are saved in the database. Plant cards highlight the traits that match your preferences, but the preferences do not change which plants are shown. +- **My Matches:** A list of all the plants you have liked in Plant Match or added from Explore Plants. You can also remove plants from the list. +- **Explore Plants:** Search the plant collection by name and filter by watering, sunlight and care level. Sort the plants alphabetically (A–Z or Z–A), by watering or by care level. Search, filtering and sorting run in the backend on the whole collection, and the results are split into pages. You can also add plants to My Matches from here. +- **Plant details:** Each plant card shows an image, the scientific name, a description and care information (watering, sunlight and care level). Flip the card to read more about the plant. +- **Profile:** Your name, description, avatar and preferences are saved in the database, and your matched plants are shown here. +- **Plant Owner Test:** A short quiz that tells you what kind of plant owner you are. Each result has its own picture, which you can only get through the test, and you can save it as your profile picture. - **Language:** The app is available in English and Norwegian. -- **Theme:** has a light and a dark theme. -- **Plant Owner Test:** TODO exlusive picture -- **Plant Card** read about the plant and its prefernaces. Add the plant to my matches and remove it from my matches +- **Theme:** The app has a light and a dark theme. ## Tech stack @@ -80,7 +79,27 @@ npm run dev This starts both the backend (http://localhost:3001) and the frontend. Open http://localhost:5173/project2/ in your browser. The frontend forwards `/graphql` requests to the backend, so both must be running. -See [backend/README.md](backend/README.md) for more details about the backend setup (in Norwegian). +## Deployment on the VM + +The deployed app runs on the VM `it2810-03.idi.ntnu.no`. Apache serves the frontend, and the backend and MongoDB run directly on the VM, not in Docker: + +```text +Browser ──> Apache (port 80, /project2) serves the built frontend + ──> Backend (port 3001, /graphql) run by pm2, Node.js + └──> MongoDB (127.0.0.1:27017) only reachable from the VM +``` + +### Backend + +The backend runs with pm2, which keeps it running in the background and restarts it if it crashes or the VM reboots. The backend reads `MONGODB_URI=mongodb://localhost:27017`, `DB_NAME=iloveplants` and `PORT=3001` from `backend/.env` on the VM (see `.env.example`). If the backend stops, see [How to start the backend if it stops](../T03-Project-2/docs/architecture.md) . + + +### Frontend +The frontend runs on the VM by using Apache serves. It was copied to the folder Apache serves for `/project2`. The build reads `VITE_GRAPHQL_URL` from [frontend/.env.production](frontend/.env.production), so the deployed app sends its requests to the backend on port 3001 on the VM. + +### Database + +MongoDB is installed directly on the VM and only listens on `127.0.0.1`, so it cannot be reached from outside the VM. The plant data was loaded once with `npm run seed` in the backend (see [architecture.md](docs/architecture.md#data-source-the-perenual-api)). ## Testing @@ -90,7 +109,6 @@ The application is tested on three levels: - **Backend:** The database connection and the GraphQL server are tested with **Vitest** against a real MongoDB that runs in memory (**mongodb-memory-server**). The tests never use the database on the VM, so they do not need the VPN or the SSH tunnel. MongoDB is downloaded once the first time the backend tests run. - **End-to-end:** Longer user journeys and the GraphQL API are tested with **Playwright**, against the real backend and a built frontend with a separate in-memory test database. The tests run on both desktop and mobile, and check all pages against WCAG 2.1 AA with **axe**. - See [tests.md](docs/tests.md) for what the test files cover, the e2e setup, the scenarios and what the tests found. ### Run the tests @@ -121,7 +139,7 @@ The coverage table is printed in the terminal. A detailed report is saved in `fr | Part | Statements | Branches | Functions | Lines | | -------- | ---------- | -------- | --------- | ------- | -| Frontend | 96.7 % | 94.73 % | 92.92 % | 98.33 % | +| Frontend | 96.7 % | 94.82 % | 92.92 % | 98.33 % | | Backend | 100 % | 100 % | 100 % | 100 % | - Frontend test coverage: @@ -132,17 +150,12 @@ The coverage table is printed in the terminal. A detailed report is saved in `fr Test coverage for the backend - -### Continuous integration - -GitHub Actions ([.github/workflows/ci.yml](.github/workflows/ci.yml)) runs on every pull request and on every push to `main`. It checks the formatting with Prettier, runs lint and tests for both the backend and the frontend, and runs the Playwright e2e and API tests. If an e2e test fails, the HTML report with traces can be downloaded from the workflow run. - ## Quality and design -See [quality.md](docs/quality.md) for Lighthouse results, testing, accessibility, design choices, sustainable web development -and work practices. +See [quality.md](docs/quality.md) for Lighthouse results, testing, accessibility, design choices, sustainable web development and work practices. ## Known issues + If you type and switch pages within half a second after updating your profile, the last few letters are not saved, because the debounce didn't have time to send. Information on plant card does not translate to Norwegian. diff --git a/backend/.DS_Store b/backend/.DS_Store index 834e46ec..ba02b014 100644 Binary files a/backend/.DS_Store and b/backend/.DS_Store differ diff --git a/backend/README.md b/backend/README.md deleted file mode 100644 index 474fd160..00000000 --- a/backend/README.md +++ /dev/null @@ -1,79 +0,0 @@ -# Backend - -GraphQL-backend (Apollo Server) for I <3 Plants. Dataene ligger i MongoDB på VM-en `it2810-03.idi.ntnu.no`. - -Under utvikling kjører backenden på din egen maskin og kobler seg til MongoDB på VM-en gjennom en SSH-tunnel: - -``` -Din maskin VM (it2810-03) -backend (localhost:3001) ──tunnel──> MongoDB (port 27017) -``` - -MongoDB lytter bare på `127.0.0.1` på VM-en, så den kan ikke nås direkte utenfra. All tilgang går via SSH. - -## Kom i gang - -### 1. Koble til NTNU-nettet - -VM-en kan bare nås fra NTNU-nettet. Er du hjemme, må du koble til NTNU VPN først. - -### 2. Installer avhengigheter - -Inne i prosjekt i terminal kjør: - -```bash -cd backend -npm install -``` - -### 3. Lag `.env` - -```bash -cp .env.example .env -``` - -Du trenger ikke endre noe i den. `.env` står i `.gitignore` og skal aldri committes. - -### 4. Start SSH-tunnelen - -Åpne et **eget terminalvindu** på PCen din, bytt ut `` og kjør: - -```bash -ssh -N -L 27017:localhost:27017 @it2810-03.idi.ntnu.no -``` - -Når du har skrevet inn passordet, ser det ut som kommandoen henger. Det er riktig, og betyr at tunnelen er oppe. La vinduet stå åpent mens du jobber/ kjører prosjektet. Stopp tunnelen med `Ctrl+C` når du er ferdig med å kjøre prosjektet. - -Sjekk at tunnelen virker (i et annet vindu): - -```bash -nc -z localhost 27017 && echo "Tunnel OK" -``` - -### 5. Start backenden - -```bash -npm run dev -``` - -Du skal se: - -``` -Connected to MongoDB -Server Running at:http://localhost:3001/ -``` - -Da er DB koblingen satt opp riktig - -## Laste inn data på nytt - -`seedDataFetch.js` henter plantedata og bilder fra Perenual og lagrer det i MongoDB. Bildene fra Perenual er signerte lenker som går ut etter 24 timer, så scriptet laster ned bildet med en gang, base64-encoder det og lagrer det som data-URI i feltet `imageData` på hver plante. GraphQL returnerer dette som `imageURL`, og det kan brukes direkte i ``. - -Kjør med SSH-tunnelen oppe og `PERENUAL_API_KEY` satt i `.env`: - -```bash -npm run seed:reset # sletter plante databasen og laster alt inn på nytt -npm run seed # fyller bare inn det som mangler -``` - -Plantelisten hentes alltid fersk (ett API-kall per side, se `LIST_PAGES`). Svar fra `species/details` caches i `data/raw/` (ikke i git), så de bare hentes fra API-et første gang. Gratisnivået gir ca. 100 kall per dag. Stopper scriptet fordi kvoten er brukt opp, kjører du `npm run seed` igjen neste dag, så fortsetter det der det slapp. diff --git a/backend/seedDataFetch.js b/backend/seedDataFetch.js index 5839b879..4d0fd565 100644 --- a/backend/seedDataFetch.js +++ b/backend/seedDataFetch.js @@ -1,17 +1,17 @@ -// Henter plantedata og bilder fra Perenual API og lagrer det i MongoDB. -// Kjør fra backend/ med SSH-tunnelen oppe: npm run seed -// Slett hele databasen og last inn alt på nytt: npm run seed:reset +// Fetches plant data and images from the Perenual API and stores them in MongoDB. +// Run from backend/ with the SSH tunnel open: npm run seed +// Delete the whole database and load everything again: npm run seed:reset // -// Fase 1: species-list -> rens -> upsert i "plants" (én rad per plante, nøkkel: perenualId) -// + last ned bildet, base64-encode det og lagre det som data-URI i imageData -// Fase 2: species/details/{id} for plantene fra fase 1 -> rens -> oppdater samme dokument +// Phase 1: species-list -> clean -> upsert into "plants" (one row per plant, key: perenualId) +// + download the image, base64-encode it and store it as a data URI in imageData +// Phase 2: species/details/{id} for the plants from phase 1 -> clean -> update the same document // -// Bilde-URL-ene fra Perenual er signerte lenker som går ut etter 24 timer. Derfor hentes -// plantelisten alltid fersk fra API-et (3 kall), og bildet lastes ned med en gang. +// The image URLs from Perenual are signed links that expire after 24 hours. That is why the +// plant list is always fetched fresh from the API (3 calls), and the image is downloaded right away. // -// Rå svar fra species/details lagres i data/raw/. Finnes filen fra før, brukes den i stedet -// for et nytt API-kall. Scriptet kan derfor kjøres flere ganger (f.eks. over flere dager pga. -// kvoten) og fortsetter der det slapp. +// Raw responses from species/details are stored in data/raw/. If the file already exists, it is +// used instead of a new API call. The script can therefore be run several times (e.g. over several +// days because of the quota) and continues where it left off. import { mkdir, readFile, writeFile } from "node:fs/promises"; import { setTimeout as sleep } from "node:timers/promises"; import { client, db } from "./src/db.ts"; @@ -20,28 +20,28 @@ const API_KEY = process.env.PERENUAL_API_KEY; const BASE_URL = "https://perenual.com/api/v2"; const RAW_DIR = new URL("./data/raw/", import.meta.url); -// Gratisnivået gir ca. 100 kall per dag, og detaljer bare for ID 1–3000 -const REQUEST_BUDGET = 85; // maks antall ekte API-kall per kjøring (margin under 100) -const LIST_PAGES = 4; // antall sider fra species-list (30 planter per side) +// The free tier allows about 100 calls per day, and details only for IDs 1–3000 +const REQUEST_BUDGET = 85; // max number of real API calls per run (margin below 100) +const LIST_PAGES = 4; // number of pages from species-list (30 plants per page) const MAX_FREE_DETAILS_ID = 3000; -const DELAY_MS = 1000; // pause mellom kall så vi ikke spammer API-et +const DELAY_MS = 1000; // pause between calls so we don't spam the API const RESET = process.argv.includes("--reset"); -// Hvilken bildestørrelse vi lagrer, i prioritert rekkefølge. Mindre bilder gir mindre -// GraphQL-svar, siden bildet sendes med i getPlants. +// Which image size we store, in order of priority. Smaller images give smaller +// GraphQL responses, since the image is included in getPlants. const IMAGE_SIZES = ["small_url", "medium_url", "regular_url"]; const ALLOWED_MIME_TYPES = ["image/jpeg", "image/png", "image/webp"]; const plants = db.collection("plants"); let requestsUsed = 0; -// Kastes når kjøringen skal stoppe pent (kvote brukt opp), ikke krasje +// Thrown when the run should stop gracefully (quota used up) instead of crashing class StopFetching extends Error {} -// ---------- Henting ---------- +// ---------- Fetching ---------- -// Leser fra data/raw/ hvis den finnes, ellers hentes og lagres svaret fra API-et. -// Uten cacheFile hentes svaret alltid fra API-et og lagres ikke. +// Reads from data/raw/ if it exists, otherwise the response is fetched from the API and stored. +// Without cacheFile the response is always fetched from the API and not stored. async function getJson(cacheFile, path, params = {}) { const file = cacheFile && new URL(cacheFile, RAW_DIR); if (file) { @@ -52,10 +52,10 @@ async function getJson(cacheFile, path, params = {}) { } } - if (!API_KEY) throw new Error("PERENUAL_API_KEY mangler i .env"); + if (!API_KEY) throw new Error("PERENUAL_API_KEY is missing in .env"); if (requestsUsed >= REQUEST_BUDGET) { throw new StopFetching( - `Budsjettet på ${REQUEST_BUDGET} API-kall er brukt opp for denne kjøringen.`, + `The budget of ${REQUEST_BUDGET} API calls is used up for this run.`, ); } @@ -64,14 +64,14 @@ async function getJson(cacheFile, path, params = {}) { requestsUsed++; const res = await fetch(url); - // NB: logg aldri url, den inneholder API-nøkkelen + // NB: never log url, it contains the API key if (res.status === 429) { throw new StopFetching( - "Perenual sin rate limit er nådd (429). Prøv igjen i morgen.", + "Perenual's rate limit has been reached (429). Try again tomorrow.", ); } if (!res.ok) { - const err = new Error(`Perenual svarte ${res.status} på ${path}`); + const err = new Error(`Perenual responded ${res.status} for ${path}`); err.status = res.status; throw err; } @@ -85,15 +85,15 @@ async function getJson(cacheFile, path, params = {}) { return data; } -// ---------- Rensing ---------- +// ---------- Cleaning ---------- -// På gratisnivået byttes noen verdier ut med "Upgrade Plans To Premium/Supreme ..." -// eller et plassholderbilde (upgrade_access.jpg) +// On the free tier some values are replaced with "Upgrade Plans To Premium/Supreme ..." +// or a placeholder image (upgrade_access.jpg) const isPaywalled = (value) => typeof value === "string" && (value.includes("Upgrade Plans") || value.includes("upgrade_access")); -// Tomme strenger, undefined og betalingsmur-tekst blir null; tomme lister blir null +// Empty strings, undefined and paywall text become null; empty lists become null function clean(value) { if (value === undefined || value === "" || isPaywalled(value)) return null; if (Array.isArray(value)) { @@ -103,7 +103,7 @@ function clean(value) { return value; } -// Perenual bruker både true/false og 1/0 +// Perenual uses both true/false and 1/0 function cleanBool(value) { const cleaned = clean(value); return cleaned === null ? null : Boolean(cleaned); @@ -142,26 +142,26 @@ function cleanDetails(raw) { }; } -// ---------- Bilder ---------- +// ---------- Images ---------- -// Laster ned bildet og gjør det om til en data-URI, eller null hvis det ikke finnes et brukbart bilde +// Downloads the image and converts it to a data URI, or null if there is no usable image async function downloadAsDataUri(image) { const url = IMAGE_SIZES.map((size) => clean(image?.[size])).find(Boolean); if (!url) return null; const res = await fetch(url); - if (!res.ok) throw new Error(`Bildet svarte ${res.status}`); + if (!res.ok) throw new Error(`Image responded ${res.status}`); const mimeType = res.headers.get("content-type")?.split(";")[0] ?? ""; if (!ALLOWED_MIME_TYPES.includes(mimeType)) { - throw new Error(`Uventet bildetype: ${mimeType || "ukjent"}`); + throw new Error(`Unexpected image type: ${mimeType || "unknown"}`); } const base64 = Buffer.from(await res.arrayBuffer()).toString("base64"); return `data:${mimeType};base64,${base64}`; } -// Lagrer bilder for plantene på denne siden som ikke har et lagret bilde fra før +// Stores images for the plants on this page that don't already have a stored image async function storeImages(items) { const haveImage = await plants .find({ @@ -179,28 +179,28 @@ async function storeImages(items) { await plants.updateOne({ perenualId: item.id }, { $set: { imageData } }); console.log( imageData - ? `Bilde lagret for plante ${item.id} (${Math.round(imageData.length / 1024)} kB)` - : `Ingen bilde for plante ${item.id}`, + ? `Image stored for plant ${item.id} (${Math.round(imageData.length / 1024)} kB)` + : `No image for plant ${item.id}`, ); } catch (err) { - // Lar feltet stå tomt, så planten prøves på nytt neste kjøring - console.error(`Feil ved lagring av bilde for plante ${item.id}:`, err); + // Leaves the field empty, so the plant is retried on the next run + console.error(`Error storing image for plant ${item.id}:`, err); } } } -// ---------- Fase 1: plantelisten ---------- +// ---------- Phase 1: the plant list ---------- async function fetchPlantList() { for (let page = 1; page <= LIST_PAGES; page++) { - // Ingen cache: bilde-URL-ene i svaret går ut etter 24 timer + // No cache: the image URLs in the response expire after 24 hours const data = await getJson(null, "/species-list", { page }); const items = data.data ?? []; const docs = items.map(cleanListItem); if (docs.length === 0) break; - // Upsert: oppdaterer planter som finnes, legger til nye, aldri duplikater. - // $set rører bare listefeltene, så detaljer fra fase 2 blir ikke overskrevet. + // Upsert: updates existing plants, adds new ones, never duplicates. + // $set only touches the list fields, so details from phase 2 are not overwritten. await plants.bulkWrite( docs.map((doc) => ({ updateOne: { @@ -210,14 +210,14 @@ async function fetchPlantList() { }, })), ); - console.log(`Liste side ${page}: ${docs.length} planter lagret`); + console.log(`List page ${page}: ${docs.length} plants stored`); await storeImages(items); if (page >= data.last_page) break; } } -// ---------- Fase 2: detaljer for hver plante ---------- +// ---------- Phase 2: details for each plant ---------- async function fetchPlantDetails() { const missing = await plants @@ -229,7 +229,7 @@ async function fetchPlantDetails() { .project({ perenualId: 1 }) .sort({ perenualId: 1 }) .toArray(); - console.log(`${missing.length} planter mangler detaljer`); + console.log(`${missing.length} plants are missing details`); for (const { perenualId } of missing) { try { @@ -241,35 +241,37 @@ async function fetchPlantDetails() { { perenualId }, { $set: { ...cleanDetails(raw), detailsFetchedAt: new Date() } }, ); - console.log(`Detaljer lagret for plante ${perenualId}`); + console.log(`Details stored for plant ${perenualId}`); } catch (err) { - // Merk planter uten detaljer, så vi ikke bruker kall på dem igjen neste kjøring + // Mark plants without details, so we don't spend calls on them again on the next run if (err.status !== 404) throw err; await plants.updateOne( { perenualId }, { $set: { detailsUnavailable: true } }, ); - console.log(`Ingen detaljer for plante ${perenualId}`); + console.log(`No details for plant ${perenualId}`); } } } try { - // Sjekk nøkkelen før noe slettes, ellers står vi igjen med en tom database - if (!API_KEY) throw new Error("PERENUAL_API_KEY mangler i .env"); + // Check the key before anything is deleted, otherwise we are left with an empty database + if (!API_KEY) throw new Error("PERENUAL_API_KEY is missing in .env"); if (RESET) { - console.log(`Sletter hele databasen "${db.databaseName}"...`); + console.log(`Deleting the whole database "${db.databaseName}"...`); await plants.drop(); } await plants.createIndex({ perenualId: 1 }, { unique: true }); await fetchPlantList(); await fetchPlantDetails(); - console.log("Ferdig! All data er hentet."); + console.log("Done! All data has been fetched."); } catch (err) { if (!(err instanceof StopFetching)) throw err; console.log(err.message); - console.log("Kjør scriptet igjen senere, så fortsetter det der det slapp."); + console.log( + "Run the script again later and it will continue where it left off.", + ); } finally { - console.log(`${requestsUsed} API-kall brukt denne kjøringen`); + console.log(`${requestsUsed} API calls used this run`); await client.close(); } diff --git a/backend/src/server.ts b/backend/src/server.ts index 7a6a90a5..99a33ee7 100644 --- a/backend/src/server.ts +++ b/backend/src/server.ts @@ -334,9 +334,6 @@ const resolvers = { $options: "i", }; } - if (args.sunlight) { - filter.sunlight = new RegExp(`^${normalize(args.sunlight)}$`, "i"); - } if (args.watering) { filter.watering = new RegExp(`^${normalize(args.watering)}$`, "i"); } diff --git a/backend/tests/server.test.ts b/backend/tests/server.test.ts index fc4d025e..8c2b18bf 100644 --- a/backend/tests/server.test.ts +++ b/backend/tests/server.test.ts @@ -317,7 +317,6 @@ describe("plants", () => { expect((await explore({ careLevel: "high" })).names).toEqual(["Cactus"]); }); - it("filters on sunlight, matching any value in the list", async () => { expect((await explore({ sunlight: "full_sun" })).names).toEqual([ "Aloe", @@ -327,9 +326,8 @@ describe("plants", () => { "Basil", "Daisy", ]); - expect((await explore({ sunlight: "part_sun" })).names).toEqual([ - "Daisy", - ]); + expect((await explore({ sunlight: "part_sun" })).names).toEqual(["Daisy"]); + }); it("returns one page at a time with the total count", async () => { expect(await explore({ limit: 2, offset: 2 })).toEqual({ diff --git a/docs/ai-usage.md b/docs/ai-usage.md index c62f9f1d..a33d74c4 100644 --- a/docs/ai-usage.md +++ b/docs/ai-usage.md @@ -1,14 +1,36 @@ # AI usage -AI was used as an assistant throughout the development of the web application. It was mainly used for: +AI was used as an assistant throughout the development of the web application. The tools we used were Claude, ChatGPT and GitHub Copilot. -- **Setup and configuration** — setting up the project in VS Code, Vitest, and project structure with backend and database -- **Explaining technical concepts** — how the database, backend and frontend are related, and how to implement debounce -- **Writing and reviewing tests** — drafting test files with mocked dependencies, and explaining the reasoning behind test structure and snapshot testing. AI also came up with suggestions regarding what should be tested to get a better test coverage -- **Writing code** - Wrote code suggestions which was reviewed by the team -- **Writing documentation** — drafting and refining documentation and comments in the code -- **Picture generation** - made the avtar pictures for the profile page +## What AI was used for -All AI-generated suggestions were reviewed, tested, and adapted by the team before being committed. Design and architectural decisions were made by the team. +- **Setup and configuration:** setting up the project in VS Code, Vitest, and the project structure with backend and database. +- **Explaining technical concepts:** how the database, backend and frontend are related, and how to implement debounce. +- **Writing code:** suggestions for code, which were reviewed by the team before they were used. +- **Writing and reviewing tests:** drafting test files with mocked dependencies, and explaining the reasoning behind the test structure and snapshot testing. AI also suggested what should be tested to get better test coverage. +- **Writing documentation:** drafting and refining documentation and comments in the code. +- **Generating pictures:** the avatar pictures on the profile page were made with AI. -The AI modeles used where: Claud, ChatGPT and co-pilot. \ No newline at end of file +## Examples + +### The seed script + +AI helped us write [backend/seedDataFetch.js](../backend/seedDataFetch.js), which fetches the plant data from the Perenual API and stores it in MongoDB. This included: + +- downloading each image and storing it as a base64 data URI, because the image URLs from Perenual expire after 24 hours +- caching the raw responses locally, so the same plant is never requested twice +- stopping before the daily quota of about 100 requests is used up, so the script can be run again the next day and continue where it left off + +We decided which fields to keep and how they are mapped to the GraphQL schema, and we checked the data in the database after each run. + +### Avatar pictures + +The avatar pictures that the user can choose between on the profile page were generated with AI. We chose the plants and the style, and picked the pictures that fit the design of the app. + +### Tests and end-to-end tests + +AI drafted many of the Vitest tests and the Playwright e2e and API tests, and suggested atypical cases to test, such as special characters in the search, too long names and invalid ids. The team reviewed the tests, adjusted them, and ran them to check that they pass and fail for the right reasons. The accessibility tests found a real problem with the language button (see [tests.md](tests.md)), which we then fixed. + +## How we kept control + +All AI-generated suggestions were reviewed, tested and adapted by the team before they were committed. Every change went through a pull request that had to be approved by another group member (see [quality.md](quality.md#work-practices)), so no AI-generated code was merged without a review. Design and architectural decisions were made by the team. diff --git a/docs/ARCHITECTURE.md b/docs/architecture.md similarity index 66% rename from docs/ARCHITECTURE.md rename to docs/architecture.md index 791586bc..efbe3d50 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/architecture.md @@ -23,7 +23,7 @@ Perenual API → seedDataFetch.js ─┐ (localStorage: userId, sessionStorage: explore filters) ``` -The plant data is fetched from the Perenual API once and stored in our own database. The data was loaded using the seedDataFetch.js file. The frontend never talks to the database directly. All data goes through the GraphQL API in the backend: +The plant data is fetched from the Perenual API once and stored in our own database. The data was loaded using the seedDataFetch.js file. About 120 plants where loaded. The number is an estimate as we have not verified each plants response to the fetch operation. The frontend never talks to the database directly. All data goes through the GraphQL API in the backend: 1. The frontend sends a GraphQL request to the backend (for example `explorePlants` with search, filters and pagination, or `addUserMatch` when the user likes a plant). 2. Apollo Server runs the matching resolver, which reads from or writes to the `plants` or `users` collection in MongoDB. @@ -69,21 +69,21 @@ The backend exposes a single GraphQL endpoint. With GraphQL, the frontend asks f **Queries** -| Query | Description | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `getPlants(limit = 50, offset = 0): [Plant]` | Returns `limit` random plants (MongoDB `$sample`). Used by the match page. `offset` is accepted but has no effect, since the plants are random. | +| Query | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `getPlants(limit = 50, offset = 0): [Plant]` | Returns `limit` random plants (MongoDB `$sample`). Used by the match page. `offset` is accepted but has no effect, since the plants are random. | | `explorePlants(search, sunlight, watering, careLevel, sort, limit = 12, offset = 0): PlantPage!` | Search on name (case-insensitive), filter on sunlight, watering and care level, sort and paginate. Returns the plants on the page and `totalCount` for the whole result. Sort can be `name_desc`, `watering_asc` or `careLevel_asc`; the default is name A–Z. | -| `getUser(userId): User` | Returns the user, or `null` if the id is unknown or malformed. | +| `getUser(userId): User` | Returns the user, or `null` if the id is unknown or malformed. | **Mutations** -| Mutation | Description | -| -------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `createUser: User!` | Creates an empty user with default values. | +| Mutation | Description | +| -------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `createUser: User!` | Creates an empty user with default values. | | `updateUserProfile(userId, name, description, profilePicture)` | Updates only the fields that are sent. Text is trimmed and length-checked; empty text is stored as `null`. | -| `updateUserPreferences(userId, preferences)` | Replaces the preference list. Unknown preferences are rejected and duplicates removed. | -| `addUserMatch(userId, plantId)` | Adds a plant to the user's matches (`$addToSet`, so never twice). Unknown plants are rejected. | -| `removeUserMatch(userId, plantId)` | Removes a plant from the user's matches (`$pull`). | +| `updateUserPreferences(userId, preferences)` | Replaces the preference list. Unknown preferences are rejected and duplicates removed. | +| `addUserMatch(userId, plantId)` | Adds a plant to the user's matches (`$addToSet`, so never twice). Unknown plants are rejected. | +| `removeUserMatch(userId, plantId)` | Removes a plant from the user's matches (`$pull`). | **Types** @@ -103,34 +103,34 @@ The database `iloveplants` has two collections: `plants` and `users`. Both the p One document per plant species. The documents were written by `seedDataFetch.js` with data fetched from the Perenual API. The running app only reads them. There is a unique index on `perenualId`. -| Field | Type | Source / description | Exposed in GraphQL as | -| --------------------------------------- | -------------------------- | ------------------------------------------------------------------------------------ | -------------------------- | -| `_id` | ObjectId | Set by MongoDB | `id` | -| `perenualId` | number | Plant id in Perenual, used as the key when the seed script updates a plant | – | -| `commonName` | string | Species list | `name` | -| `scientificName` | string[] | Species list | `scientificName` | -| `otherNames` | string[] | Species list | – | -| `family` | string | Species list | – | -| `genus` | string | Species list | – | -| `imageData` | string | The plant image downloaded and stored as a base64 data URI | `imageURL` | -| `imageLicense` | string | Licence name of the image | – | -| `createdAt` | Date | When the plant was first inserted | – | -| `description` | string | Species details | `description` | -| `type` | string | Species details (e.g. tree, herb) | – | -| `cycle` | string | Species details (e.g. perennial) | – | -| `watering` | string | Species details: `Minimum`, `Average` or `Frequent` | `watering` | -| `sunlight` | string[] | Species details (e.g. `full sun`, `part shade`) | `sunlight` | -| `careLevel` | string | Species details: `Low`, `Medium`/`Moderate` or `High` | `careLevel` | -| `growthRate` | string | Species details | – | -| `maintenance` | string | Species details | – | -| `origin` | string[] | Species details | – | -| `hardiness` | `{ min, max }` | Species details (hardiness zones) | – | -| `indoor` | boolean | Species details | – | -| `droughtTolerant` | boolean | Species details | – | -| `poisonousToHumans` | boolean | Species details | – | -| `poisonousToPets` | boolean | Species details | – | -| `detailsFetchedAt` | Date | Set when the details were fetched, so the seed script skips the plant next time | – | -| `detailsUnavailable` | boolean | Set when Perenual has no details for the plant, so the seed script does not retry it | – | +| Field | Type | Source / description | Exposed in GraphQL as | +| -------------------- | -------------- | ------------------------------------------------------------------------------------ | --------------------- | +| `_id` | ObjectId | Set by MongoDB | `id` | +| `perenualId` | number | Plant id in Perenual, used as the key when the seed script updates a plant | – | +| `commonName` | string | Species list | `name` | +| `scientificName` | string[] | Species list | `scientificName` | +| `otherNames` | string[] | Species list | – | +| `family` | string | Species list | – | +| `genus` | string | Species list | – | +| `imageData` | string | The plant image downloaded and stored as a base64 data URI | `imageURL` | +| `imageLicense` | string | Licence name of the image | – | +| `createdAt` | Date | When the plant was first inserted | – | +| `description` | string | Species details | `description` | +| `type` | string | Species details (e.g. tree, herb) | – | +| `cycle` | string | Species details (e.g. perennial) | – | +| `watering` | string | Species details: `Minimum`, `Average` or `Frequent` | `watering` | +| `sunlight` | string[] | Species details (e.g. `full sun`, `part shade`) | `sunlight` | +| `careLevel` | string | Species details: `Low`, `Medium`/`Moderate` or `High` | `careLevel` | +| `growthRate` | string | Species details | – | +| `maintenance` | string | Species details | – | +| `origin` | string[] | Species details | – | +| `hardiness` | `{ min, max }` | Species details (hardiness zones) | – | +| `indoor` | boolean | Species details | – | +| `droughtTolerant` | boolean | Species details | – | +| `poisonousToHumans` | boolean | Species details | – | +| `poisonousToPets` | boolean | Species details | – | +| `detailsFetchedAt` | Date | Set when the details were fetched, so the seed script skips the plant next time | – | +| `detailsUnavailable` | boolean | Set when Perenual has no details for the plant, so the seed script does not retry it | – | All fields except `_id`, `perenualId` and `createdAt` can be missing or `null`, because Perenual does not have every field for every plant, and details are only available for plants with a Perenual id up to 3000. The resolver also accepts an older `imageURL` field as a fallback if `imageData` is missing. Fields marked with – are stored for possible later use but are not part of the GraphQL schema yet. @@ -140,15 +140,15 @@ Note: the image URLs from the Perenual API expire after 24 hours. That is why ea One document per user. There is no login: a user is created the first time someone opens the app, and the browser keeps the user id (see [Where state is kept](#where-state-is-kept)). The id is generated by MongoDB. -| Field | Type | Description | Exposed in GraphQL as | -| ----------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | -| `_id` | ObjectId | Set by MongoDB, and the id the browser stores | `id` | -| `name` | string/null | Display name, at most 40 characters. `null` means not chosen, and the frontend shows a translated default | `name` | -| `description` | string/null | Short profile text, at most 100 characters | `description` | -| `profilePicture` | string | Id of the chosen picture. One of the avatars (`default`, `monstera`, `pothos`, `snake-plant`, `anthurium`, `succulent`, `fern`, `orchid`) or a plant owner test result (`cityMinimalist`, `averageCityGardener`, `cityGardenerDreaming`, `countryMinimalist`, `averageCountryGardener`, `gardenExpert`) | `profilePicture` | -| `preferences` | string[] | Chosen plant preferences: `minimumWater`, `averageWater`, `frequentWater`, `fullSun`, `partShade`, `filteredShade`, `easyCare`, `mediumCare`, `hardCare` | `preferences` | -| `matchedPlantIds` | ObjectId[] | `_id`s of the plants the user has matched with, in the order they were matched | `matchedPlants` (resolved to full `Plant` objects) | -| `createdAt` | Date | When the user was created | `createdAt` (ISO string) | +| Field | Type | Description | Exposed in GraphQL as | +| ----------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- | +| `_id` | ObjectId | Set by MongoDB, and the id the browser stores | `id` | +| `name` | string/null | Display name, at most 40 characters. `null` means not chosen, and the frontend shows a translated default | `name` | +| `description` | string/null | Short profile text, at most 100 characters | `description` | +| `profilePicture` | string | Id of the chosen picture. One of the avatars (`default`, `monstera`, `pothos`, `snake-plant`, `anthurium`, `succulent`, `fern`, `orchid`) or a plant owner test result (`cityMinimalist`, `averageCityGardener`, `cityGardenerDreaming`, `countryMinimalist`, `averageCountryGardener`, `gardenExpert`) | `profilePicture` | +| `preferences` | string[] | Chosen plant preferences: `minimumWater`, `averageWater`, `frequentWater`, `fullSun`, `partShade`, `filteredShade`, `easyCare`, `mediumCare`, `hardCare` | `preferences` | +| `matchedPlantIds` | ObjectId[] | `_id`s of the plants the user has matched with, in the order they were matched | `matchedPlants` (resolved to full `Plant` objects) | +| `createdAt` | Date | When the user was created | `createdAt` (ISO string) | A new user starts with `name: null`, `description: null`, `profilePicture: "default"`, and empty `preferences` and `matchedPlantIds`. The allowed picture and preference ids are listed in `server.ts` and must match the ids used in the frontend (`Profile.tsx` and `plantownertest.ts`). @@ -168,13 +168,13 @@ MongoDB runs on the course VM and only listens on `127.0.0.1`, so it cannot be r ## Where state is kept -| Where | What | Why | -| ------------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -| MongoDB `users` | Profile (name, description, picture), preferences and matched plants | Persistent user data that should survive closing the browser | -| `localStorage` | Only the key `userId` | Lets the browser find its user again on the next visit, without a login | -| `sessionStorage` | Explore page search, filters and sort (`ExplorePlants.*` keys, via `useSessionState`) | The view is restored when the user navigates away and back, but starts fresh in a new tab or session | -| Apollo in-memory cache | Query results (plants and the current user) | Avoids asking the backend again for data the app already has, and keeps all pages in sync | -| React state | Short-lived UI state, such as the current plant on the match page and unsaved profile text | Only matters while the component is shown | +| Where | What | Why | +| ---------------------- | ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------- | +| MongoDB `users` | Profile (name, description, picture), preferences and matched plants | Persistent user data that should survive closing the browser | +| `localStorage` | Only the key `userId` | Lets the browser find its user again on the next visit, without a login | +| `sessionStorage` | Explore page search, filters and sort (`ExplorePlants.*` keys, via `useSessionState`) | The view is restored when the user navigates away and back, but starts fresh in a new tab or session | +| Apollo in-memory cache | Query results (plants and the current user) | Avoids asking the backend again for data the app already has, and keeps all pages in sync | +| React state | Short-lived UI state, such as the current plant on the match page and unsaved profile text | Only matters while the component is shown | User data used to be stored in `localStorage`. `UserProvider` now removes the old keys (`plantPreferences`, `matchedPlants`, `profileName`, `description`, `profileAvatar`) on start-up, so old data does not lie around in the browser. @@ -211,7 +211,7 @@ We chose this approach for these reasons: ```text T03-Project-2/ -├── .github/ # CI workflow (lint, tests, build) and CODEOWNERS (required PR review) +├── .github/ # CI workflow (format, lint, tests, build, e2e) and CODEOWNERS (required PR review) ├── backend/ │ ├── src/ │ │ ├── db.ts # MongoDB connection (MongoDB driver, configured via .env) @@ -219,7 +219,8 @@ T03-Project-2/ │ ├── tests/ # Backend tests against an in-memory MongoDB (db, server) │ ├── seedDataFetch.js # Script that fetches plant data from the Perenual API and stores it in MongoDB │ └── .env.example # Template for required environment variables -├── docs/ # Project documentation (architecture, tests, ...) +├── docs/ # Project documentation (architecture, tests, quality, AI usage), media/ has the coverage images +├── e2e/ # Playwright e2e and API tests, test data (fixtures/) and the in-memory test database ├── frontend/ │ ├── src/ │ │ ├── assets/ # Static images @@ -234,5 +235,20 @@ T03-Project-2/ │ │ └── main.tsx # Application entry point (Apollo Client, UserProvider, router) │ ├── .env.production # GraphQL URL for the deployed app │ └── vite.config.ts # Vite and Vitest configuration, including proxy to the backend -└── README.md # Project overview and how to run the application +├── package.json # Scripts for running, testing and formatting the whole project from the root +├── playwright.config.ts # Playwright configuration: starts the test database, backend and frontend +└── README.md # Project overview, how to run, test and deploy the application ``` + +## How to start the backend if it stops + +On the VM, the backend runs in pm2 under the name `plants-backend`, as the user `alexajah`, from `/home/alexajah/T03-Project-2/backend`. pm2 restarts it if it crashes or the VM reboots. The backend reads `MONGODB_URI=mongodb://localhost:27017`, `DB_NAME=iloveplants` and `PORT=3001` from `backend/.env` on the VM (see `.env.example`). + +Log in with `ssh @it2810-03.idi.ntnu.no`. If you are not `alexajah` put `sudo -u alexajah` in front of the pm2 commands, since pm2 only shows the processes of the user who started them. + +```bash +pm2 list # is plants-backend online? +pm2 restart plants-backend # start it again if it is not +``` + +If the logs show that the backend cannot connect to MongoDB, the database has stopped, and must be started before the backend is restarted. diff --git a/docs/quality.md b/docs/quality.md index 7eb1ceda..09916052 100644 --- a/docs/quality.md +++ b/docs/quality.md @@ -10,11 +10,9 @@ This document describes how we have worked to ensure the quality of the applicat - Sustainable web development: [Sustainable web development](#sustainable-web-development) - Design choices: [Design choices](#design-choices) - ### Continuous integration -GitHub Actions ([.github/workflows/ci.yml](.github/workflows/ci.yml)) runs on every pull request and on every push to `main`. It checks the formatting with Prettier, and runs lint, tests for both the backend and the frontend. - +GitHub Actions ([.github/workflows/ci.yml](.github/workflows/ci.yml)) runs on every pull request and on every push to `main`. It checks the formatting with Prettier, and runs lint, tests for both the backend and the frontend. ## Work practices @@ -29,7 +27,7 @@ GitHub Actions ([.github/workflows/ci.yml](.github/workflows/ci.yml)) runs on ev - As part of our code review process, team members checked out pull requests locally and tested the new functionality before approving changes. This helped us verify that changes worked as expected in practice, rather than relying solely on code review. -## Testing +## Method behind testing Automated tests help ensure that the application works as intended and that new changes do not break existing functionality. The application is tested on three levels: component tests check each part of the frontend in isolation, backend tests check every GraphQL query and mutation against a real database, and end-to-end tests check that the whole application works together the way a user experiences it, on both desktop and mobile. diff --git a/docs/tests.md b/docs/tests.md index 182b780f..a967dc07 100644 --- a/docs/tests.md +++ b/docs/tests.md @@ -107,7 +107,6 @@ The coverage only counts the Vitest tests. Code that is only run by the end-to-e The tests are in `frontend/src/tests`. Snapshot tests are used for the explore page, the language switcher and the profile page. - - `Sidebar.test.tsx` - Tests the sidebar, including the title, navigation links to all pages, and that the language switcher and theme toggle are displayed. Also verifies that the sidebar closes when a link or the close button is clicked, that the open state is reflected in the `data-open` attribute, and that the navigation landmark is accessible and only the current page is marked as active. - `App.test.tsx` @@ -139,6 +138,7 @@ The tests are in `frontend/src/tests`. Snapshot tests are used for the explore p - `Profile.test.tsx` - Tests the profile page, including the name and image, that the preferences tab is shown by default, and that the user can switch to the saved plants tab and see the saved plants. Also includes a snapshot test. + - `LanguageSwitcher.test.tsx` - Tests the language switcher button in both Norwegian and English, and verifies that it shows the correct label and accessible name, and that clicking it switches to the other language. diff --git a/frontend/src/components/PlantPreferenceChips/PlantPreferenceChips.css b/frontend/src/components/PlantPreferenceChips/PlantPreferenceChips.css index f432bbcf..a99a7de8 100644 --- a/frontend/src/components/PlantPreferenceChips/PlantPreferenceChips.css +++ b/frontend/src/components/PlantPreferenceChips/PlantPreferenceChips.css @@ -25,7 +25,7 @@ .plant-preference-chip.is-match { background: var(--dark-pink); - color: #ffffff; + color: var(--text-light); font-weight: 700; transform: scale(1.05); } diff --git a/frontend/src/components/plantCard/PlantCard.css b/frontend/src/components/plantCard/PlantCard.css index 30d0e00b..0a177f6b 100644 --- a/frontend/src/components/plantCard/PlantCard.css +++ b/frontend/src/components/plantCard/PlantCard.css @@ -137,31 +137,6 @@ background: url("/plant-placeholder.png") center / cover no-repeat; } -.plant-card-placeholder-text { - position: absolute; - - top: 50%; - left: 50%; - - transform: translate(-50%, -50%); - - z-index: 1; - - padding: 0.65rem 1rem; - - min-width: 65%; - max-width: 85%; - - background: var(--light-green); - color: var(--dark-green); - - border-radius: 12px; - - font-size: 0.9rem; - font-weight: 700; - text-align: center; -} - .plant-card-info-button { flex: none; align-self: center; diff --git a/frontend/src/i18n/locales/en/translation.json b/frontend/src/i18n/locales/en/translation.json index 28a0377f..6d468c2e 100644 --- a/frontend/src/i18n/locales/en/translation.json +++ b/frontend/src/i18n/locales/en/translation.json @@ -3,8 +3,7 @@ "button": "Search" }, "filters": { - "sunlight": "Sunlight", - "soilType": "Soil type" + "sunlight": "Sunlight" }, "sidebar": { "switchToLightMode": "Switch to light mode", @@ -64,6 +63,7 @@ "part_sun": "Part sun", "part_shade": "Part shade", "careLevel": "Care level", + "low": "Low", "medium": "Medium", "high": "High", "pagination": "Page navigation", @@ -107,8 +107,7 @@ "watering": "Watering", "sunlight": "Sunlight", "careLevel": "Care level", - "unknown": "Unknown", - "noImage": "No image available" + "unknown": "Unknown" }, "plantQuiz": { "title": "What kind of plant owner are you?", diff --git a/frontend/src/i18n/locales/no/translation.json b/frontend/src/i18n/locales/no/translation.json index ea5d77c1..ab65d1a8 100644 --- a/frontend/src/i18n/locales/no/translation.json +++ b/frontend/src/i18n/locales/no/translation.json @@ -3,8 +3,7 @@ "button": "Søk" }, "filters": { - "sunlight": "Sollys", - "soilType": "Jordtype" + "sunlight": "Sollys" }, "sidebar": { "switchToLightMode": "Bytt til lys modus", @@ -64,6 +63,7 @@ "part_sun": "Delvis sol", "part_shade": "Delvis skygge", "careLevel": "Stell", + "low": "Lav", "medium": "Middels", "high": "Høy", "pagination": "Sidenavigasjon", @@ -107,8 +107,7 @@ "watering": "Vanning", "sunlight": "Sollys", "careLevel": "Stell", - "unknown": "Ukjent", - "noImage": "Bilde ikke tilgjengelig" + "unknown": "Ukjent" }, "plantQuiz": { "title": "Hvilken type planteeier er du?", diff --git a/frontend/src/index.css b/frontend/src/index.css index 84cb8f9e..377b3003 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -29,7 +29,7 @@ body { --border-soft: #c5d9c7; --border-pink: #ffe5ed; --accent-green: #6b8f71; - --accent-green-hover: #7a9e7e; + --accent-green-hover: #6f9373; --sidebar-background: #f7efe4; } @@ -43,7 +43,7 @@ body { --dark-pink: #c2476b; --light-pink: #4a2a35; --pink-text: #ffffff; - --bg: #191816; + --bg: #292724; --border: #2e2c29; --border-soft: #46423d; --border-pink: #5a3340; diff --git a/frontend/src/pages/explorePlants/ExplorePlants.css b/frontend/src/pages/explorePlants/ExplorePlants.css index 862c8061..36b86fe7 100644 --- a/frontend/src/pages/explorePlants/ExplorePlants.css +++ b/frontend/src/pages/explorePlants/ExplorePlants.css @@ -39,7 +39,7 @@ left: 1rem; font-size: 1.25rem; transform: translateY(-50%); - color: var(--dark-pink); + color: var(--pink-text); pointer-events: none; } @@ -115,7 +115,7 @@ .reset-button:focus-within { outline: none; - border: var(--dark-pink); + border-color: var(--dark-pink); box-shadow: 0 0 0 2px var(--dark-pink); } diff --git a/frontend/src/pages/explorePlants/ExplorePlants.tsx b/frontend/src/pages/explorePlants/ExplorePlants.tsx index 7a3c9c77..9690cd79 100644 --- a/frontend/src/pages/explorePlants/ExplorePlants.tsx +++ b/frontend/src/pages/explorePlants/ExplorePlants.tsx @@ -143,6 +143,7 @@ export default function ExplorePlants() { }} > + diff --git a/frontend/src/pages/myMatches/MyMatchesPage.css b/frontend/src/pages/myMatches/MyMatchesPage.css index d61f9300..4763642f 100644 --- a/frontend/src/pages/myMatches/MyMatchesPage.css +++ b/frontend/src/pages/myMatches/MyMatchesPage.css @@ -75,7 +75,7 @@ border: none; border-radius: 50%; background: var(--dark-pink); - color: #ffff; + color: var(--text-light); font-size: 18px; cursor: pointer; } diff --git a/frontend/src/pages/profile/Profile.css b/frontend/src/pages/profile/Profile.css index bc7740e4..e5b5ebff 100644 --- a/frontend/src/pages/profile/Profile.css +++ b/frontend/src/pages/profile/Profile.css @@ -71,7 +71,7 @@ .profile-tabs button.active { background-color: var(--light-green); - color: var(--text); + color: var(--text-dark); } .edit-profile { @@ -131,7 +131,7 @@ border-radius: 14px; background: var(--light-background); cursor: pointer; - color: var(--text); + color: var(--text-dark); } .avatar-option img { diff --git a/frontend/src/tests/README.md b/frontend/src/tests/README.md deleted file mode 100644 index e69de29b..00000000 diff --git a/frontend/src/tests/__snapshots__/ExplorePage.test.tsx.snap b/frontend/src/tests/__snapshots__/ExplorePage.test.tsx.snap index 35f7af01..ce9be46a 100644 --- a/frontend/src/tests/__snapshots__/ExplorePage.test.tsx.snap +++ b/frontend/src/tests/__snapshots__/ExplorePage.test.tsx.snap @@ -115,6 +115,11 @@ exports[`ExplorePlants > snapshots > matches the snapshot of the page with no re > ExplorePlants.all + + +