Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
6e2e8b6
chore: initialize react project
emmafre Sep 2, 2026
1a86b25
chore: create folder for pages and add placeholder
emmafre Sep 3, 2026
181b83c
Merge pull request #2 from IT2810-H26/1-set-up-project
emmafre Sep 3, 2026
1126852
feat: fetch and display characters
emmafre Sep 3, 2026
b3ce489
feat: make cards responsive and set up layout
emmafre Sep 6, 2026
f0002f3
refactor: refactor CharactersPage
emmafre Sep 7, 2026
5f17023
refactor: refactor CharacterCard
emmafre Sep 7, 2026
a0913e9
chore: clean up
emmafre Sep 7, 2026
809e993
Merge pull request #6 from IT2810-H26/4-lay-groundwork-for-character-…
emmafre Sep 10, 2026
2fcc2eb
refactor: move Character type and set up detail card
karenska Sep 10, 2026
255d7d6
feat: create character detail card component
karenska Sep 10, 2026
2fbfd70
feat: connect character detail card
karenska Sep 10, 2026
5aa4dac
feat: :sparkles: Search is now implemented
gurveers Sep 11, 2026
0c51c29
feat: :sparkles: Filters now work
gurveers Sep 11, 2026
f66490c
feat: :sparkles: Favorite system works
gurveers Sep 11, 2026
387c749
feat: style character detail card
karenska Sep 11, 2026
3ca79bb
feat: fetch and display character episodes
karenska Sep 11, 2026
c8ddca6
feat: refine character detail card layout
karenska Sep 11, 2026
cca0124
feat: add character navigation
karenska Sep 11, 2026
b0e18d7
feat: make character detail card responsive
karenska Sep 11, 2026
4c32e5d
feat: refine character detail card responsiveness
karenska Sep 11, 2026
f862096
chore: add AI notice and polish styling
karenska Sep 11, 2026
ae86a70
chore: update AI-assisted code marking
karenska Sep 11, 2026
6a2b42d
feat: add favorite button to character detail card
karenska Sep 11, 2026
52904cf
feat: set up home page
minael Sep 12, 2026
cfbb06c
feat: create hero section
minael Sep 12, 2026
7afca14
Merge branch 'dev' into 3-create-hero
minael Sep 12, 2026
6125756
fix: remove unused HomePage CSS import
minael Sep 12, 2026
3352fc0
fix: rename conflicting CSS class names
minael Sep 12, 2026
474044a
chore: add spacing above character section
minael Sep 12, 2026
d55b7f3
Merge pull request #10 from IT2810-H26/3-create-hero
minael Sep 14, 2026
ea44437
Merge pull request #9 from IT2810-H26/5-create-character-details-card
karenska Sep 14, 2026
48754cc
Merge branch 'dev' of https://git.ntnu.no/IT2810-H26/T12-Project-1 in…
gurveers Sep 15, 2026
569604e
Merge pull request #8 from IT2810-H26/issue7
gurveers Sep 15, 2026
e6766cb
chore: persist filters and favorites using Web Storage
minael Sep 15, 2026
0289a9e
feat: add favorite toggle to character detail card
minael Sep 15, 2026
16100fe
Merge pull request #12 from IT2810-H26/11-persist-filters-and-favorit…
minael Sep 15, 2026
b358689
chore: set up Prettier and Vitest
minael Sep 15, 2026
e458acb
style: format project with Prettier
minael Sep 15, 2026
efa8926
Update README.md
gurveers Sep 16, 2026
54edce1
Merge pull request #19 from IT2810-H26/18-set-up-prettier-and-vitest
minael Sep 16, 2026
08aa00c
Make character cards and page layout responsive
karenska Sep 16, 2026
1803e3c
Make Hero responsive
karenska Sep 16, 2026
01b968a
Make the Character Details card responsive
karenska Sep 16, 2026
5b2e7f4
docs: update README with overview, AI and getting started sections
emmafre Sep 16, 2026
6c6b959
refactor: move main layout to App
minael Sep 16, 2026
ee2c901
feat: fetch characters with TanStack Query
minael Sep 16, 2026
f19e8fa
feat: fetch episode data with TanStack Query
minael Sep 16, 2026
0122a47
chore: add sentence about AI use
minael Sep 16, 2026
5ac7558
chore: add TanStack Query dependency
minael Sep 16, 2026
5a079f7
Improve character card layout and mobile responsiveness
karenska Sep 16, 2026
e7c7457
Merge pull request #14 from IT2810-H26/13-use-tanstack-query-for-api-…
minael Sep 16, 2026
d18f88e
change background color
karenska Sep 16, 2026
d73fd04
docs: add deployed app link to README
minael Sep 16, 2026
b74d861
Merge pull request #24 from IT2810-H26/21-deploy-app-to-vm
minael Sep 16, 2026
c319468
fix layout for search and filter
karenska Sep 16, 2026
da287cd
refactor: move searchbar form to a seperate component
emmafre Sep 16, 2026
11f5912
refactor: move filter logic to seperate file
emmafre Sep 16, 2026
d9d5e56
refactor: remove filter logic from character page
emmafre Sep 16, 2026
3419f5d
Merge pull request #23 from IT2810-H26/15-improve-responsiveness
karenska Sep 16, 2026
77813f4
Merge pull request #26 from IT2810-H26/25-extract-search-field-into-a…
emmafre Sep 16, 2026
3c0302b
refactor: remove unused code and change favicon
emmafre Sep 17, 2026
50f656d
feat: clean up and adjust layout on character detail card
emmafre Sep 17, 2026
9e5cfbe
refactor: change page structure
emmafre Sep 17, 2026
1a37e7e
refactor: refactor HeroPage
emmafre Sep 17, 2026
c574ab8
refactor: refactor CharacterDetailCard
emmafre Sep 17, 2026
07f343b
style: Star is now filled when favorited.
gurveers Sep 17, 2026
135648d
feat: You can now filter favorites
gurveers Sep 17, 2026
3c36d24
Merge pull request #28 from IT2810-H26/27-clean-up-webpage
emmafre Sep 17, 2026
610d7c8
feat: set up test files and add tests for searchbar
emmafre Sep 17, 2026
c110f4b
test: add tests for CharacterCardSmall
emmafre Sep 17, 2026
6a0aa37
test: create tests for CharacterDetailCard
emmafre Sep 17, 2026
c528bd0
test: create tests for CharactersPage
emmafre Sep 17, 2026
21c7b96
docs: remove comments
emmafre Sep 17, 2026
f2c9714
style: Changed how the filter works for more responsivness
gurveers Sep 17, 2026
a28e5b1
Merge branch 'dev' of https://git.ntnu.no/IT2810-H26/T12-Project-1 in…
gurveers Sep 17, 2026
7af5b5a
Merge pull request #29 from IT2810-H26/20-add-tests
emmafre Sep 17, 2026
5d194b6
docs: write paragraph abouch technical choices and make tweaks
emmafre Sep 18, 2026
1413e59
Merge pull request #30 from IT2810-H26/22-implement-favorites-functio…
gurveers Sep 18, 2026
3ea6c9d
Merge branch 'dev' into 17-update-project-readme
emmafre Sep 18, 2026
b71e971
Merge pull request #32 from IT2810-H26/17-update-project-readme
emmafre Sep 18, 2026
5b6783c
chore: add coverage/ to gitignore
emmafre Sep 18, 2026
e484c64
feat: create footer
emmafre Sep 18, 2026
c45e4f9
feat: add functionality to close detailcard with "esc"
emmafre Sep 18, 2026
658e632
fix: fix test bug from having two female filters and typos
emmafre Sep 18, 2026
d68caff
refactor: small changes to documentation and structure
emmafre Sep 18, 2026
f9adb3d
docs: add paragraph about manual testing and Node version
emmafre Sep 18, 2026
a0a9300
docs: remove unused markdown
emmafre Sep 18, 2026
fdbad2c
docs: explain choice of dataset
emmafre Sep 18, 2026
5adb5b2
Merge pull request #33 from IT2810-H26/31-tidy-up-project
emmafre Sep 18, 2026
1c2b2c1
fix: improve character card accessibility
minael Sep 18, 2026
46e8c54
fix: improve character detail accessibility
minael Sep 18, 2026
2401d32
fix: add accessible labels to search bar
minael Sep 18, 2026
4b23a95
refactor: improve semantic HTML in characters page
minael Sep 18, 2026
7ddba91
refactor: improve semantic HTML in hero page
minael Sep 18, 2026
7f151e2
refactor: improve page structure in App
minael Sep 18, 2026
3733b73
style: format project with Prettier
minael Sep 18, 2026
f3812b4
test: update character card tests and snapshot
minael Sep 18, 2026
1f29a8d
Merge pull request #34 from IT2810-H26/16-improve-html-accessibility
minael Sep 18, 2026
2b95592
docs: change test coverage percentage in README
emmafre Sep 18, 2026
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
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
coverage/
95 changes: 79 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,87 @@
# T12-Project-1
# T12 - Project - 1 - Rick and Morty character explorer

Repository for team IT2810-H26-T12 in IT2810-H26.
## Virtual machine

## Working in this repository
The webpage can be accessed through a virtual machine at:

`main` is protected — you cannot push to it directly. Work on a branch and
open a pull request:
- http://it2810-12.idi.ntnu.no/project1/

## Overview

This project collects and displays data from an external REST API for the popular TV show _Rick and Morty_. To demonstrate the application's functionality and navigation without using an unnecessarily large dataset, only the first page of characters is fetched from the API. Users can search for and filter characters using the search bar or filter menu. More detailed information about each character can be viewed by clicking the `Details` button. Each character card also has a star button that allows users to add characters to their favorites.

The API documentation can be found here:

- https://rickandmortyapi.com/documentation

## Get started

Before running the project, make sure you have `Node.js v24.6.X+` and `npm v11.+` installed on your machine. Install the project dependencies with:

```bash
npm install
```

Start the development server with:

```bash
npm run dev
```

The webpage will then be available at the local URL provided in the terminal (localhost:5173)

## Tests

The project has a test line coverage of 86%. To measure and review the current test coverage, run the following command in the terminal:

```bash
git checkout -b my-feature
git push -u origin my-feature
npm test -- --coverage
```

Before a pull request can be merged:
Each component has its own test file covering its most important functionality. `CharactersPage.tsx` also has a separate test file that covers the main functionality of the page. `HeroPage.tsx` consists only of static HTML elements and does not contain any functionality that requires testing. The test files are located in the same folders as their corresponding components or pages and follow the same naming convention. To run project tests run the following command in the terminal:

```bash
npm test
```

We performed manual testing for responiveness and user experience. This was done in both landscape and portrait orientations on the following devices:

- iPhone 16
- iPhone 17
- iPhone 13
- iPad Air
- Macbook Air
- Macbook Pro

## Developed by

- Emma Fredriksen
- Mina Ellingsen
- Karen Skauge
- Gurveer Singh

## Technologies

The project was developed using the following technologies and tools:

- React
- Vite
- TypeScript
- TanStack Query
- HTML and plain CSS
- Vitest
- Prettier

## Technical choices

The webpage is divided into smaller React components to seperate responsibilities and make the code easier to understand, maintain and test. React state is used for data that changes during user interaction, such as the selected character, search query, and filters, while props are used to pass data and functionality between components. Character and episode data is fetched from the Rick and Morty REST API using TanStack Query. TanStack Query was chosen to handle asynchronous API requests and caching, reducing the need to manually manage loading and fetched data in React state. API data is fetched when needed and is not persisted in Web Storage.

Web Storage is used for user-specific choices. Filter selections are stored in `sessionStorage`, allowing them to survive page reloads during the same browser session. Favorites are stored in `localStorage` so that they remain available after the browser has been closed and reopened. This also allowed us to gain experience with the different persistence behavior of the two storage APIs.

The user interface is built with our own React components and plain CSS, without third-party UI component libraries. CSS, Flexbox, and media queries are used to adapt the layout to different screen sizes and orientations.

## Use of AI

During development, our use of AI has been limited. Any code written with the assistance of AI is marked with a comment above the relevant code snippet. We chose this approach based on our understanding of AI and our previous experience. AI can be a great accelerator when programming, but using it effectively requires a good understanding of the fundamental principles behind the technology being used. Without this understanding it is hard to evaluate the code produced by AI and make informed decisions. Since we are still developing our understanding of React, TypeScript and the other technologies used in this project, we decided it was better to use AI as a coach rather than a developer. This approach affected our development speed, and we spent more time exploring documentation and other learning resources. However, it also gave us a better understanding of the project as a whole and helped us avoid introducing unnecessary code that we did not fully understand or know how to maintain.

1. **A member of IT2810-H26-T12 must approve it.** You cannot approve your own pull
request, and approvals from staff do not count — you review each other's
code.
2. **Every review comment must be marked resolved.** Reply to each one, fix it
or explain why not, then click *Resolve conversation*.
3. **Pushing new commits dismisses the approval**, so if you change something
after being approved, ask for another review. This is deliberate: what was
approved is what gets merged.
We also found that establishing a shared standard for documenting AI-assisted code made it easier to be transparent about the use of AI and to review each other's work. Knowing which parts were developed with AI assistance made it easier to discuss the reasoning behind the code and evaluate whether we understood and agreed with the proposed solutions. At the same time, we recognize that we could probably have achieved a higher development speed by using AI more actively, and AI might also have helped us identify more efficient solutions in some areas. However, for this project, we felt that the benefits of prioritizing learning, transparency, and understanding outweighed the potential increase in productivity. We therefore intend to continue using this approach while gradually increasing our use of AI as our own knowledge and ability to evaluate its output improve.
22 changes: 22 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import js from "@eslint/js";
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";
import { defineConfig, globalIgnores } from "eslint/config";

export default defineConfig([
globalIgnores(["dist"]),
{
files: ["**/*.{ts,tsx}"],
extends: [
js.configs.recommended,
tseslint.configs.recommended,
reactHooks.configs.flat.recommended,
reactRefresh.configs.vite,
],
languageOptions: {
globals: globals.browser,
},
},
]);
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Rick and Morty Character Explorer</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading