Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ http://it2810-03.idi.ntnu.no/project2/
| Part | Technology |
| -------- | --------------------------------------------------------------------------------- |
| Frontend | React, TypeScript, Vite, Apollo Client, React Router, i18next |
| Backend | Node.js, TypeScript, Apollo Server (GraphQL) |
| Backend | Node.js, TypeScript, Express, Apollo Server (GraphQL) |
| Database | MongoDB, running on the course VM |
| Testing | Vitest, React Testing Library, jsdom, mongodb-memory-server, Playwright, axe-core |
| Tooling | ESLint, Prettier, GitHub Actions |
Expand Down Expand Up @@ -93,15 +93,15 @@ From the repo root:
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.
This starts both the backend (http://localhost:3001) and the frontend. Open http://localhost:5173/project2/ in your browser. The frontend forwards `/graphql` and `/images` (the plant images) to the backend, so both must be running.

## 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. Apache is already installed on the course VM and serves the built frontend as static files without extra setup. The app is one backend process and one database, so running them directly on the VM, with pm2 keeping the backend alive, keeps the setup simple without the extra layer Docker would add:

```text
Browser ──> Apache (port 80, /project2) serves the built frontend
──> Backend (port 3001, /graphql) run by pm2, Node.js
──> Backend (port 3001, /graphql, /images) run by pm2, Node.js
└──> MongoDB (127.0.0.1:27017) only reachable from the VM
```

Expand Down Expand Up @@ -148,5 +148,5 @@ See [quality.md](docs/quality.md) for work practices, accessibility, sustainable

## Known issues

- The plant images are stored as base64 in the database and sent inside the GraphQL responses. This makes the responses larger, and the browser can't cache the images or load them lazily. See [Limitations of the architecture](docs/architecture.md#limitations-of-the-architecture) for why we chose it and how it could be improved in further development.
- The plant images are stored as base64 in the database, which takes about 33 % more space than image files. See [Limitations of the architecture](docs/architecture.md#limitations-of-the-architecture) for why we chose it and how it could be improved.
- The plant descriptions and names on the plant cards are not translated to Norwegian, since they come from the English Perenual API. The watering, sunlight and care values are translated.
Loading
Loading