-
Notifications
You must be signed in to change notification settings - Fork 0
docs: update specifications.md #185
Merged
+210
−32
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1952ce9
docs: rewrite specification to reflect the current status of Readr
hestro f8f437f
docs: update choices and reasoning after specification changes
hestro 3b8d271
docs: clarify sentence in choices-and-reasoning
hestro e370978
docs: mark example user as done
hestro 711fc26
docs: add direct link to specifications.md from the root README
hestro b6e38ea
docs: add original plan section
hestro e3430e5
Merge branch 'docs/update-specification' of git.ntnu.no:IT2810-H26/T3…
hestro 77615ae
Merge branch 'main' into docs/update-specification
hestro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,38 +1,185 @@ | ||
| # Specification <!-- omit in toc --> | ||
|
|
||
| - [Overview](#overview) | ||
| - [Data](#data) | ||
| - [Design](#design) | ||
| - [User interaction](#user-interaction) | ||
| - [Behavior](#behavior) | ||
| - [Search](#search) | ||
| - [Filters](#filters) | ||
| - [Sorting](#sorting) | ||
| - [Pagination and URLs](#pagination-and-urls) | ||
| - [Accounts and favorites](#accounts-and-favorites) | ||
| - [Reviews](#reviews) | ||
| - [Home page](#home-page) | ||
| - [Design and interface](#design-and-interface) | ||
| - [Qualities](#qualities) | ||
| - [Accessibility](#accessibility) | ||
| - [Scalability and performance](#scalability-and-performance) | ||
| - [Sustainability](#sustainability) | ||
| - [Checklist against the project description](#checklist-against-the-project-description) | ||
| - [Functionality](#functionality) | ||
| - [Quality](#quality) | ||
| - [Technology](#technology) | ||
| - [Testing and quality control](#testing-and-quality-control) | ||
| - [Documentation and hosting](#documentation-and-hosting) | ||
|
|
||
| ## Data | ||
| ## Overview | ||
|
|
||
| This document describes what Readr does and how it meets the project requirements. For implementation details, reasoning behind technical decisions and more, see the other project documentation. | ||
|
|
||
| Readr is a book discovery application for searching, filtering and browsing a large catalogue of books. Visitors can explore books and read reviews without an account. Registered users can also save favorites, write and manage reviews, and view a personal profile. | ||
|
|
||
| - **Source:** Books from an open-source books dataset, possibly one from [Kaggle](https://kaggle.com). | ||
| We will import a selection of books into our own database, so that search, | ||
| filtering and sorting happens on our server. Cover images are still loaded | ||
| from the internet, because storing them would quickly fill the 10 GB of | ||
| storage on our VM. We only store each book's cover link or ID. | ||
| - **Fields per book:** title, authors, first publish year, subjects, language, | ||
| cover ID, average rating, description and possibly more if the dataset includes it. | ||
| Structure: | ||
|
|
||
| ## Design | ||
| - **Home page:** popular books, genres, catalogue statistics, and recommendations for signed-in users with favorites | ||
| - **Books page:** search, filters, sorting and paginated results | ||
| - **Book details:** book information and reviews | ||
| - **Login and signup** | ||
| - **Profile and settings** | ||
|
|
||
|  | ||
|  | ||
| ## Data | ||
|
|
||
| - The search page with the grid works well, so we only plan to polish it. | ||
| - The book details page will be redesigned. Reviews will be shown and written | ||
| there. | ||
| - We will add a separate page that lists the user's favorite books. | ||
| - **Source:** [Comprehensive Literary Greats Dataset](https://www.kaggle.com/datasets/thedevastator/comprehensive-literary-greats-dataset) | ||
| - **Storage:** Book data is imported into the project's PostgreSQL database. | ||
| - **Cover images:** Only each cover's URL is stored. Browsers load the images from Goodreads, so the project does not host them. | ||
| - **Book fields:** title, author, series, ISBN, description, language, format, edition, page count, publisher, publication date and year, genres, cover URL, rating and number of ratings. Some fields may be missing for individual books. | ||
| - **User data:** accounts, favorites and reviews. A review has a star rating and optional text. | ||
|
|
||
| ## User interaction | ||
|
|
||
| - **Search** on title and author. The search is case-insensitive and debounced, | ||
| so we don't send a request on every keystroke. | ||
| - **Filter** on author, subject, place, person, publisher, language. | ||
| - **Sort** by rating. | ||
| - **Pagination** through the results, a **details page** for each book, and | ||
| previous/next buttons to browse between books. | ||
| - **User-generated data**, stored in our database: | ||
| - **Favorites**, shown on their own page. | ||
| - **Reviews** with a star rating and an optional text. | ||
| - **Login:** if time allows, we will add Google login. | ||
| Anyone can: | ||
|
|
||
| - Search the catalogue by title or author. | ||
| - Filter results by genre, language, book format, page count and minimum number of ratings. | ||
| - Sort results by relevance (the default), rating, title, publication date or page count. | ||
| - Browse results as a paginated grid. | ||
| - Open a book's details page to see its information and reviews, and move on to other books. | ||
| - See highlights and statistics on the home page, and open a random book. | ||
| - Switch between light and dark themes. | ||
|
|
||
| Signed-in users can also: | ||
|
|
||
| - Register and sign in with email and password, GitHub or Discord. | ||
| - Add and remove books from their favorites. | ||
| - Write, update and delete their own reviews. | ||
| - See their favorites and reviews on their profile page. | ||
| - Receive recommendations based on the genres of their favorites. | ||
|
|
||
| ## Behavior | ||
|
|
||
| ### Search | ||
|
|
||
| - Matches titles and authors, and is case-insensitive. | ||
| - Input is debounced, so a request is not sent for every keystroke. | ||
| - If a search has a small typo, Readr suggests similar titles or authors ([details](./choices-and-reasoning.md#suggest-similar-titles)). If no similar books are found, it shows an empty-results message. | ||
|
|
||
| ### Filters | ||
|
|
||
| - Available filters: genre, language, book format, page count and minimum number of ratings. | ||
| - Selecting several genres returns books matching **any** of them ([details](./choices-and-reasoning.md#genre-selection)). | ||
| - The genre, language and format lists only show options that give books for the current search and the other filters, with the number of books for each option ([details](./choices-and-reasoning.md#only-relevant-filter-options)). | ||
|
|
||
| ### Sorting | ||
|
|
||
| - Available orders: relevance (the default), rating, title, publication date and page count. | ||
| - Relevance puts books with the most ratings first. For suggestions of similar titles/authors, the closest matches come first. | ||
| - Choosing "Rating: high to low" also adds the filter "10,000+ ratings", unless a minimum number of ratings is already selected ([details](./choices-and-reasoning.md#rating-sort-filter)). | ||
|
|
||
| ### Pagination and URLs | ||
|
|
||
| - Results are shown 12 books per page. | ||
| - Search text, filters, sorting and page number are stored in the URL, so a results view can be revisited, bookmarked or shared. | ||
|
|
||
| ### Accounts and favorites | ||
|
|
||
| - The catalogue, book details and reviews can be viewed without signing in. | ||
| - Sign-in options: email and password, GitHub, Discord. | ||
| - Favorites are stored in the database and shown on the profile. | ||
|
|
||
| ### Reviews | ||
|
|
||
| - A review has a star rating from 1 to 5 and optional text. | ||
| - Signed-in users can create, edit and delete their own reviews. | ||
| - Reviews appear on book details pages and on the profile of the user who wrote them. | ||
| - A book's displayed rating combines the dataset rating with user reviews. | ||
|
|
||
| ### Home page | ||
|
|
||
| - Shows top-rated books, genres and catalogue statistics. | ||
| - "Surprise me" opens a random book. | ||
| - Recommendations are shown only to signed-in users with favorites, and are based on the genres of those favorites. | ||
|
|
||
| ## Design and interface | ||
|
|
||
| Readr has a clean, uncluttered design with a neutral color palette, so the book covers and content stand out. The layout is clear and consistent across the application, and it adapts from phones to desktop displays. Light and dark themes are available. | ||
|
|
||
| The images below are from the beginning of the project and are kept for archival purposes only. They do not represent the finished application. | ||
|
|
||
| <details> | ||
| <summary>Early screenshot and sketches</summary> | ||
|
|
||
|  | ||
|
|
||
|  | ||
|
|
||
| </details> | ||
|
|
||
| ## Qualities | ||
|
|
||
| ### Accessibility | ||
|
|
||
| Readr must be usable by everyone, including people who rely on a keyboard or assistive technology. How this is done and tested is described in [Accessibility](./accessibility.md). | ||
|
|
||
| ### Scalability and performance | ||
|
|
||
| - The backend and database handle search, filtering, sorting and counts. The client requests one page at a time. | ||
| - Search is debounced, and Apollo Client caching avoids some repeated requests. | ||
| - Database indexes support the main search, filter and sort operations. | ||
|
|
||
| ### Sustainability | ||
|
|
||
| Readr should follow sustainable web development principles, mainly by limiting the amount of data that is stored, transferred and processed. The choices made are described in [Sustainability](./sustainability.md). | ||
|
|
||
| ## Checklist against the project description | ||
|
|
||
| ### Functionality | ||
|
|
||
| - [x] **Case-insensitive search without unnecessary requests:** title/author search, case-insensitive and debounced. | ||
| - [x] **List suited to large result sets:** server-side pagination, 12 books per page. | ||
| - [x] **More details about each object:** book details pages with information and reviews. | ||
| - [x] **Filter and sort the whole result set:** done by the backend. | ||
| - [x] **Persistent, presented user-generated data:** favorites and reviews are stored in the database and shown in the app. | ||
| - [x] **Search possible without login:** the catalogue and book details are public. | ||
| - [ ] **Usable without manually creating an account:** the login page has a button that signs in as a test user. | ||
hestro marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ### Quality | ||
|
|
||
| - [x] **Universal design and accessibility:** see [Accessibility](./accessibility.md). | ||
| - [x] **Sustainable web development:** see [Sustainability](./sustainability.md). | ||
| - [x] **Design suited to the data:** book grid, details pages, profile and home page. | ||
| - [x] **Scalability:** server-side search, filtering, sorting and pagination, supported by database indexes. | ||
|
|
||
| ### Technology | ||
|
|
||
| - [x] **React and TypeScript with Vite:** used by the frontend. | ||
| - [x] **State management:** URL parameters for search state, Apollo Client for server-state caching. | ||
| - [x] **Custom GraphQL backend (Node/TypeScript):** Express and Apollo Server. | ||
| - [x] **Database on the VM without Docker:** PostgreSQL, see the [backend README](../backend/README.md). | ||
| - [x] **Third-party libraries:** documented in [Infrastructure](./infrastructure.md). | ||
|
|
||
| ### Testing and quality control | ||
|
|
||
| - [x] **Linting and formatting:** ESLint and Prettier scripts in the frontend and backend. | ||
| - [x] **Component tests:** Vitest and React Testing Library in the frontend. | ||
| - [x] **API tests:** Vitest tests of the GraphQL schema and resolvers against a test database. | ||
| - [x] **End-to-end tests:** Playwright tests in the frontend, run with `pnpm e2e`. | ||
|
|
||
| ### Documentation and hosting | ||
|
|
||
| - [x] **Main choices and solutions documented:** README and `docs/`. | ||
| - [x] **Installation and running documented:** frontend and backend READMEs. | ||
| - [x] **Hosted on the project VM:** `http://it2810-37.idi.ntnu.no/project2/`. | ||
| - [x] **Backend on port 3001:** see [Infrastructure](./infrastructure.md). | ||
| - [x] **Backend and database setup documented:** [backend README](../backend/README.md) and [Deployment](./deployment.md). | ||
| - [x] **AI use and team practices documented:** [AI documentation](./ai-documentation.md) and [Contributing guide](../CONTRIBUTING.md). | ||
| - [x] **Systematic use of Git and GitHub:** the work is planned and tracked with issues, developed on branches, and merged through pull requests with code review. The history is visible in the repository, and the practices are described in the [Contributing guide](../CONTRIBUTING.md). | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.