Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
1bc62a8
feat: add initial project setup with TypeScript, Vite, and assets
Sep 14, 2026
7351ea0
feat: refactor project structure to use React with Vite
Sep 14, 2026
246be88
feat: added centralized api to fetch driver data, and displayed a little
wilhelsr Sep 14, 2026
f33646e
moved Driver interface to api service
wilhelsr Sep 14, 2026
3ca0e2c
Merge pull request #3 from IT2810-H26/1-create-centralized-openf1-api…
krgjert Sep 14, 2026
2a0d0e3
feat: create DriverCard component and update App to display driver data
Sep 14, 2026
5cbbc99
Merge pull request #4 from IT2810-H26/2-create-driver-component
krgjert Sep 14, 2026
ebd0661
feat: expanded the api service to include driver standings and team s…
wilhelsr Sep 14, 2026
897c229
feat: added apis for every meet, session, and driver results incase w…
wilhelsr Sep 15, 2026
122dbc6
implemented the SearchAndFilter component, and the logic for simple s…
Sep 15, 2026
65c689b
Merge pull request #11 from IT2810-H26/5-add-necessary-apis-and-TanSt…
oscarog Sep 15, 2026
394ef23
merged dev into this branch
wilhelsr Sep 15, 2026
5cd7de6
implemented sorting function on position based on the new params from…
Sep 15, 2026
c0a51de
Merge pull request #12 from IT2810-H26/9-add-search-and-filtering
wilhelsr Sep 16, 2026
bd62bfa
feat: Add favorites functionality with local storage support
Sep 16, 2026
91312c5
feat: added style to favorites button
Sep 16, 2026
ac9ab63
Merge pull request #13 from IT2810-H26/8-add-favorites-functionality
oscarog Sep 16, 2026
1077063
feat: add detailed driver overview and selection functionality
ludvigz Sep 16, 2026
0f95f7a
Merge branch dev, combining driver detail panel, favorites, and searc…
ludvigz Sep 16, 2026
a6a04a6
Merge branch 'dev' of git.ntnu.no:IT2810-H26/T15-Project-1 into 6-add…
ludvigz Sep 16, 2026
4180a9a
Merge pull request #16 from IT2810-H26/6-add-a-detailed-overview-of-e…
wilhelsr Sep 16, 2026
d377121
Delete node_modules directory
wilhelsr Sep 16, 2026
f057674
Merge pull request #17 from IT2810-H26/14-remove-unnecessary-files-fr…
wilhelsr Sep 16, 2026
afc6522
feat: Added style to inputs, and border color on DriverDetail component
Sep 16, 2026
90afa8a
bug: fixed zoomed in on mibile
Sep 16, 2026
d82e32a
feat: removed the unused meeting api, and cleaned up the code a little
wilhelsr Sep 16, 2026
8ac3d26
feat: enhance driver detail component with close button
Sep 16, 2026
b3a5d42
Merge pull request #20 from IT2810-H26/19-remove-the-uneccesary-api-r…
wilhelsr Sep 16, 2026
67b9594
Merge pull request #21 from IT2810-H26/18-style-improvement
krgjert Sep 16, 2026
75ffa30
feat: update README with VM build instructions and update Vite config
ludvigz Sep 16, 2026
21799d4
docs: update README to include website availability link
ludvigz Sep 16, 2026
fe74974
Added some clarifications to the README
ludvigz Sep 16, 2026
a0b050d
Merge pull request #23 from IT2810-H26/22-set-up-vm-update-the-readme…
oscarog Sep 16, 2026
7cce5e4
feat: added tests to components with mock data as well as snapshot te…
wilhelsr Sep 16, 2026
ab9121c
documentation: added tests and use of artificial intelligence to the …
wilhelsr Sep 16, 2026
3fe6e7b
minimal design and styling changes
Sep 16, 2026
af70cd4
Merge pull request #26 from IT2810-H26/24-set-up-vitest-and-add-basic…
ludvigz Sep 16, 2026
eadf28a
Merge pull request #27 from IT2810-H26/25-improve-user-experience
ludvigz Sep 16, 2026
e7b543b
Small chaneg to header + betetr responsive
Sep 16, 2026
8b49dd5
feat: added animation for header and remove outdated testing documen…
Sep 16, 2026
55ce32f
Merge pull request #28 from IT2810-H26/7-verify-responsiveness-before…
wilhelsr Sep 16, 2026
3a23ffc
change: cahged tests to fit the new implementation and some small css…
wilhelsr Sep 16, 2026
7d5cd4e
Merge pull request #30 from IT2810-H26/29-documentation-and-test-changes
krgjert 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
node_modules/
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
51 changes: 50 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,36 @@
# T15-Project-1

[The website should now be available](http://it2810-15.idi.ntnu.no/project1/)

Repository for team IT2810-H26-T15 in IT2810-H26.

An F1 driver overview with search, team filtering, sorting, favorites and driver details.

## Run locally

```bash
npm install
npm run dev
```

## Technical choices

- **React and TypeScript:** separate components for cards, details and filters, with typed props to catch mistakes during development.
- **Vite:** provides the development server and production build.
- **OpenF1 and TanStack Query:** a shared API module handles fetching and HTTP errors; TanStack Query handles query caching and loading/error states. Standings use the latest completed race in 2026.
- **Browser storage:** `localStorage` keeps favorites between visits, while `sessionStorage` keeps search, team and sorting choices within the tab session.
- **Vitest and Testing Library:** test component behavior through props and user actions. Mock data makes tests independent of OpenF1.

## Testing

Run `npm run test:run` for the Vitest tests, or `npm test` for watch mode.

Tests cover component props, search, favorite state, saved favorites, filter and navigation callbacks, and loading/error messages. `DriverCard` also has a DOM snapshot test.

The API is mocked with fixed data, so tests do not fetch live data.

The website has also been manually tested for both desktop and mobile view.

## Working in this repository

`main` is protected — you cannot push to it directly. Work on a branch and
Expand All @@ -21,4 +50,24 @@ Before a pull request can be merged:
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.
approved is what gets merged.


## Building / Copying over to the VM

To build on your own pc and then copy the files over to the VM.
Replace NTNU-USERNAME with your NTNU username, and use your NTNU password when promted.

```bash
npm run build
scp -r dist/ NTNU-USERNAME@it2810-15.idi.ntnu.no:/tmp
ssh NTNU-USERNAME@it2810-15.idi.ntnu.no
sudo cp -r /tmp/dist/* /var/www/html/project1
```

## Use of Artificial Intelligence

The group used AI to support areas where we had less experience, particularly setting up and writing tests and using TanStack Query. We also used AI as a discussion partner during development to explore solutions, understand concepts, and help debug code.
AI helped us understand unfamiliar tools and debug code, but some suggestions needed simplifying and careful review.

The car animation in the header is made with a lot of help from AI.
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.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>t15-project-1</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading