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
16 changes: 13 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ time with navigation, filtering, sorting, and favorites.
| `npm run format` | Prettier, write |
| `npm run format:check` | Prettier, CI check |

Run `npm run lint && npm test && npm run build` before opening a PR. All three must
pass with no errors or warnings.
Run `npm run format:check && npm run lint && npm test && npm run build` before
opening a PR. All must pass with no errors or warnings — CI enforces the same
gates.

## Architecture conventions

Expand All @@ -36,7 +37,8 @@ src/
api/ fetch functions for OpenLibrary (no React code here)
hooks/ custom hooks (useBooks, useFavorites, usePreferences)
components/ one component per file, plain function components
test/ Vitest setup (jsdom + jest-dom)
test/ Vitest setup: jsdom + jest-dom, msw server and OpenLibrary
handlers (src/test/handlers.ts), QueryClient test providers
```

- Components are props-driven; keep derived logic in hooks, not JSX.
Expand All @@ -48,6 +50,14 @@ src/
- Plain CSS files (one per component when needed), imported by the component.
No CSS frameworks, no inline style objects for static styling.

## Infrastructure

- CI runs on our self-hosted runner on the group VM (see `docs/ci-runner.md`);
there are no shared runners on git.ntnu.no.
- Pushes to `main` deploy the build automatically to the Apache server — the live
prototype at http://it2810-19.idi.ntnu.no/project1 always reflects `main`.
Never merge a red or warning-filled build.

## Code style

- Functional React components with explicit prop types; no `any`.
Expand Down
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,19 @@ and priority. The schedule and current status live in [ROADMAP.md](ROADMAP.md).
Issues where substantial code was AI-generated carry the `ai-assisted` label; AI
usage is documented in the README as required by the course.

## CI
## CI/CD

Every pull request runs a GitHub Actions workflow that checks formatting (Prettier),
linting (ESLint), tests (Vitest), and the production build. Everything must pass
with zero errors and warnings before merge.
CI runs on our self-hosted runner on the group VM (see `docs/ci-runner.md`; the
NTNU GitHub Enterprise installation has no shared runners). Every pull request
runs formatting (Prettier), linting (ESLint), tests (Vitest), and the production
build — everything must pass with zero errors and warnings before merge.
Pushes to `main` additionally deploy the build to the Apache server on the VM, so
the prototype at http://it2810-19.idi.ntnu.no/project1 always reflects `main`.

## Testing

- Snapshot tests of rendered components
- Component tests covering props, state, and user interaction
- Tests never touch the network: msw is installed and will intercept all
OpenLibrary requests once the mock handlers land with the data-layer tests
(#12, milestone M2) and the full suite in M4
- Tests never touch the network: msw intercepts every OpenLibrary request
(handlers in `src/test/handlers.ts`), and any unhandled request fails tests
loudly
26 changes: 15 additions & 11 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,24 @@ In progress → In review → Done); issues also carry `status:*` labels.

| Milestone | Due | Scope |
| -------------------------- | -------- | ------------------------------------------------------------------------- |
| M1 — Setup | Thu 3/9 | Template, tooling, CI, types + API client (#1#4) |
| M2 — Core app | Tue 8/9 | BookCard, useBooks, navigation, jump list |
| M3 — Persistence & choices | Fri 11/9 | Subject filter, sorting (sessionStorage), favorites (localStorage) |
| M1 — Setup | done | Template, tooling, CI, types + API client (#1#4) |
| M2 — Core app | Wed 10/9 | BookCard, useBooks, navigation, jump list |
| M3 — Persistence & choices | Fri 12/9 | Subject filter, sorting (sessionStorage), favorites (localStorage) |
| M4 — Quality | Tue 15/9 | Responsive CSS, accessibility, Vitest suite, manual browser/device checks |
| M5 — Delivery | Thu 17/9 | Apache deployment, README, delivery artifacts (#5) |

## Status (updated 5/9)

- PR #3**merged** (template, CI/CD pipeline, docs); issues #1/#2 closed
- This PR — closes #4 (types + API client, verified with 8 unit tests); unblocks M2
- #11#14 — M2 issues assigned and Ready: robertky #11 BookCard, erikhfj #12
useBooks + App wiring, evenkkl #13 NavigationControls, rachelks #14 BookJumpList
- #6 — VM prepped (Apache, rsync, sudoers, runner v2.337.0); registration waits
on repository admin from staff; guide: [docs/ci-runner.md](docs/ci-runner.md)
## Status (updated 8/9)

- M1 — **done**: PR #3 (template + CI/CD + docs) and PR #15 (#4 types + API client)
merged; #1, #2, #4, #6 closed
- Infrastructure — **live**: self-hosted runner on it2810-19 (systemd service,
survives reboots); CI/CD verified end-to-end — pushes to `main` pass quality
gates and deploy to Apache automatically
- M2 — in review: PR #17 (useBooks + App integration) and PR #18 (BookJumpList),
both CI-green; #13 NavigationControls in progress (evenkkl); #12 stays open
until navigation and jump list are wired into the app
- M3 — issues #19#22 created and Ready (assignments on the board); testing is an
acceptance criterion in each
- #5 — delivery artifacts (timeliste, VM, FeedbackFruits) — open

## Workflow
Expand Down