Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
4d8e14b
feat: set up Vite + React + TypeScript project
sawaymas Sep 10, 2026
a23620a
Merge pull request #17 from IT2810-H26/1-set-up-vite-react-typescript…
sawaymas Sep 10, 2026
6901477
chore: configure ESLint and Prettier
sawaymas Sep 12, 2026
91a9ff4
Merge pull request #18 from IT2810-H26/2-configure-eslint-and-prettier
sawaymas Sep 12, 2026
e2abae0
feat: create the basic project structure
sawaymas Sep 12, 2026
91c92d0
docs: add wireframes and component structure
edving Sep 12, 2026
519cb0c
Merge pull request #19 from IT2810-H26/5-create-the-basic-project-str…
sawaymas Sep 12, 2026
33b0df6
Merge pull request #20 from IT2810-H26/4-create-wireframes-and-compon…
edving Sep 13, 2026
8ce0b82
docs: select and document a REST API
sawaymas Sep 13, 2026
afb2838
feat: install and configure TanStack Query
edving Sep 13, 2026
f1a95fd
Merge pull request #21 from IT2810-H26/6-select-and-document-a-rest-api
sawaymas Sep 13, 2026
96ff3bd
Merge pull request #22 from IT2810-H26/7-tanstack-query
edving Sep 13, 2026
e0310c4
feat: implement a function for fetching country data
sawaymas Sep 13, 2026
feb3e89
Merge pull request #23 from IT2810-H26/9-implement-a-function-for-fet…
sawaymas Sep 13, 2026
f9397f0
feat: define TypeScript types for country data
edving Sep 13, 2026
8cad7cf
Merge pull request #24 from IT2810-H26/8-country-types
edving Sep 13, 2026
efc42b5
feat: create a query hook for country data
sawaymas Sep 13, 2026
a433d1b
Merge pull request #25 from IT2810-H26/10-create-a-query-hook-for-cou…
sawaymas Sep 13, 2026
f17c44e
feat: create application main layout
sawaymas Sep 13, 2026
f1413da
Merge pull request #26 from IT2810-H26/11-create-the-applications-mai…
sawaymas Sep 13, 2026
907ac94
feat: add loading and error message components
sawaymas Sep 13, 2026
f24c097
Merge pull request #27 from IT2810-H26/12-create-loading-and-error-me…
sawaymas Sep 13, 2026
80c7edd
feat: add reusable country card
edving Sep 13, 2026
ab31921
Merge pull request #42 from IT2810-H26/13-country-card
edving Sep 13, 2026
ad57abf
feat: implement active country state
edving Sep 13, 2026
7829b29
Merge pull request #43 from IT2810-H26/14-implement-state-for-the-act…
edving Sep 14, 2026
800f0cf
feat: add previous and next country navigation
edving Sep 14, 2026
d3f2ee3
Merge pull request #44 from IT2810-H26/15-create-navigation-for-previ…
edving Sep 14, 2026
480d1dc
feat: add accessible country selector
edving Sep 14, 2026
7d467f9
feat: add region filtering
edving Sep 14, 2026
19c5eb8
Merge pull request #56 from IT2810-H26/16-create-direct-country-selec…
edving Sep 14, 2026
46c1a66
Merge pull request #57 from IT2810-H26/28-implement-filtering-by-region
edving Sep 14, 2026
4dfcd28
feat: implement sorting of countries
sawaymas Sep 14, 2026
4d1a5e4
Merge pull request #58 from IT2810-H26/29-implement-sorting-of-countries
sawaymas Sep 15, 2026
944ff91
feat: persist display choices in sessionStorage
sawaymas Sep 15, 2026
2e632e6
Merge pull request #59 from IT2810-H26/30-persist-display-choices-in-…
sawaymas Sep 15, 2026
e8528ca
feat: implement favorites state
sawaymas Sep 15, 2026
ed38c42
Merge pull request #60 from IT2810-H26/31-implement-favorites-state
sawaymas Sep 15, 2026
1f32789
feat: add favorite button to country card
felixtro Sep 15, 2026
862036d
Merge pull request #61 from IT2810-H26/32-create-an-accessible-favori…
felixtro Sep 15, 2026
8ddc9f5
feat: persist favorites in localStorage
felixtro Sep 15, 2026
6177005
Merge pull request #62 from IT2810-H26/33-persist-favorites-in-locals…
felixtro Sep 15, 2026
eb35849
feat: add favorites overview
felixtro Sep 15, 2026
533db54
test: configure Vitest and the test environment
sawaymas Sep 15, 2026
274db94
docs: document AI usage
edving Sep 15, 2026
0ba205f
Merge pull request #63 from IT2810-H26/34-create-a-favorites-overview
felixtro Sep 15, 2026
d7b0535
Merge pull request #64 from IT2810-H26/38-configure-vitest-and-the-te…
sawaymas Sep 15, 2026
104e292
Merge pull request #65 from IT2810-H26/52-document-the-use-of-ai
edving Sep 15, 2026
1d6912a
test: mock the REST API in tests
sawaymas Sep 15, 2026
29c5f60
Merge pull request #66 from IT2810-H26/39-mock-the-rest-api-in-tests
sawaymas Sep 15, 2026
b28bbc6
style: give Country Explorer a cohesive design
edving Sep 15, 2026
154a6c1
test: test country card props rendering
sawaymas Sep 15, 2026
62ccca8
Merge pull request #67 from IT2810-H26/35-create-a-basic-visual-stylee
edving Sep 15, 2026
2254bd1
Merge pull request #68 from IT2810-H26/40-test-the-country-cards-props
sawaymas Sep 15, 2026
9fb7120
style: adapt layout for desktop, tablet and mobile
edving Sep 15, 2026
2ebd6ff
test: test navigation and active state
sawaymas Sep 15, 2026
59f66d2
Merge pull request #70 from IT2810-H26/41-test-navigation-and-active-…
sawaymas Sep 15, 2026
a771f56
fix: keep dropdown menus within the page and allow selection
edving Sep 15, 2026
ef5b895
Merge pull request #69 from IT2810-H26/36-implement-responsive-designn
edving Sep 15, 2026
30adfc2
test: test filtering and sorting
sawaymas Sep 16, 2026
bb86ace
docs: add usability evaluation
edving Sep 16, 2026
feb82af
docs: Update ai-usage.md
edving Sep 16, 2026
6ef6b38
Merge pull request #71 from IT2810-H26/45-test-filtering-and-sorting
sawaymas Sep 16, 2026
373cf2d
Merge pull request #72 from IT2810-H26/48-manually-test-the-applicati…
edving Sep 16, 2026
a273ed8
test: verify Web Storage persistence and restoration
edving Sep 17, 2026
2add397
Merge pull request #73 from IT2810-H26/46-test-web-storage
edving Sep 17, 2026
96d69d3
docs: document VM deployment
sawaymas Sep 17, 2026
9b38ebb
Merge pull request #74 from IT2810-H26/50-deploy-a-test-version-to-th…
sawaymas Sep 17, 2026
e555ded
docs: verify API calls and performance
sawaymas Sep 17, 2026
176abc9
fix: improve accessibility
felixtro Sep 17, 2026
679db9c
Merge pull request #75 from IT2810-H26/49-verify-api-calls-and-perfor…
sawaymas Sep 17, 2026
1fbae1c
Merge pull request #76 from IT2810-H26/37-carry-out-accessibility-imp…
felixtro Sep 17, 2026
f8f65ed
test: create a snapshot test
sawaymas Sep 17, 2026
1cddb17
style: refine page colors and header layout
edving Sep 17, 2026
f580c3e
Merge pull request #78 from IT2810-H26/47-create-a-snapshot-test
sawaymas Sep 17, 2026
a8b83ef
Merge pull request #79 from IT2810-H26/77-update-the-appearance-and-css
edving Sep 17, 2026
c5a9924
docs: improve project documentation and setup instructions
edving Sep 17, 2026
23482a8
docs: improve project documentation and setup instructions
edving Sep 17, 2026
92cd689
Update git-workflow.md
edving Sep 17, 2026
84d45a0
Update README.md
edving Sep 17, 2026
7ca8870
Merge pull request #80 from IT2810-H26/51-write-a-complete-readme
edving Sep 17, 2026
94ccd37
docs: complete final project quality check
edving Sep 17, 2026
29bf8b7
Update git-workflow.md
edving Sep 17, 2026
b0cce26
Merge pull request #81 from IT2810-H26/53-perform-the-final-quality-c…
sawaymas Sep 17, 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
78 changes: 70 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,86 @@
# T23-Project-1
# T23-Project-1 — Country Explorer

Repository for team IT2810-H26-T23 in IT2810-H26.
**[Open the web app on the group VM](http://it2810-23.idi.ntnu.no/project1/)**

Country Explorer lets you browse European countries, filter by subregion, sort by
name or population, and save favorites. Built with React, TypeScript and Vite by
team IT2810-H26-T23.

## Run locally

1. Clone the repository and enter the application folder:

```bash
git clone https://git.ntnu.no/IT2810-H26/T23-Project-1.git
cd T23-Project-1/country-explorer
```

2. Install the locked dependencies:

```bash
npm ci
```

3. Start the development server:

```bash
npm run dev
```

4. Open [the local app](http://localhost:5173/project1/). If Vite reports a
different port, use that port instead. Stop the server with `Ctrl+C`.

## Test and build

Run these commands from `country-explorer/`:

```bash
npm test # Run automated tests
npm run lint # Check code with ESLint
npm run format:check # Check formatting
npm run build # Type-check and generate dist/
npm run preview # Preview the production build locally
```

The preview normally runs at `http://localhost:4173/project1/`.
See the deployment document below for serving the build on the VM.

## Documentation

- [Component structure](docs/component-structure.md): components, props, state ownership and initial wireframes.
- [API performance](docs/api-performance.md): observed network requests and TanStack Query caching.
- [Testing](docs/testing.md): automated checks, PC/iPhone testing and coverage limitations.
- [Deployment](docs/deployment.md): production build, VM setup and deployment verification.
- [Usability evaluation](docs/usability-evaluation.md): the group's assessment and possible mobile improvements.
- [AI usage](docs/ai-usage.md): tools used, their role and the group's review of suggestions.
- [Git workflow](docs/git-workflow.md): branch and commit templates, pull requests and review rules.
- [Sprint process](docs/sprint-process.md): weekly meetings, issue allocation and progress discussions.
- [REST API details](country-explorer/src/api/README.md): data source, country fields and error handling.

## Working in this repository

`main` is protected — you cannot push to it directly. Work on a branch and
open a pull request:
Development work is integrated through `dev`. Start each issue branch from an
up-to-date `dev` branch, push the issue branch, and open a pull request into
`dev`:

```bash
git checkout -b my-feature
git push -u origin my-feature
git switch dev
git pull --ff-only
git switch -c "<issue-number>-<short-description>"
git push -u origin "<issue-number>-<short-description>"
```

When the complete project is ready for release, `dev` is merged into `main`.
Both shared branches are protected, so changes reach them through reviewed
merge requests rather than direct pushes.

Before a pull request can be merged:

1. **A member of IT2810-H26-T23 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*.
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.
24 changes: 24 additions & 0 deletions country-explorer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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?
17 changes: 17 additions & 0 deletions country-explorer/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Dependencies
node_modules

# Build output
dist
dist-ssr

# Logs
*.log

# Auto-generated, not meant to be formatted
package-lock.json

# Editor / OS
.vscode
.idea
.DS_Store
8 changes: 8 additions & 0 deletions country-explorer/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"printWidth": 100,
"tabWidth": 2,
"endOfLine": "lf"
}
39 changes: 39 additions & 0 deletions country-explorer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Country Explorer application

This directory contains the React, TypeScript, and Vite application. It fetches
European country data from a REST API and lets users filter, sort, navigate, and
save favorite countries.

Project-level installation, testing, deployment, and Git workflow instructions
are in the [main README](../README.md). Details about the data source and mapping
are in the [API documentation](./src/api/README.md).

## Project structure

```text
src/
├── api/ # REST API client and API documentation
├── components/ # React components, styles, and component tests
├── hooks/ # Custom React and TanStack Query hooks
├── lib/ # Shared library configuration
├── test/ # Shared test setup and fixtures
├── types/ # Shared TypeScript types and interfaces
├── utils/ # Storage and sorting helpers
├── assets/ # Images and other bundled assets
├── index.css # Global stylesheet
└── main.tsx # Application entry point
```

Naming conventions:

- Components use PascalCase file names matching their default export and keep
their CSS and tests beside the component.
- Hooks use camelCase names beginning with `use`.
- API functions and utilities use descriptive camelCase names.
- Shared domain types use descriptive camelCase file names.

## Tooling

The app uses React, TanStack Query, TypeScript, Vite, ESLint, Prettier, Vitest,
and Testing Library. The React Compiler is not enabled. Vite's base path is
`/project1/`, matching the deployment path on the group VM.
26 changes: 26 additions & 0 deletions country-explorer/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
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';
import eslintConfigPrettier from 'eslint-config-prettier';

export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
js.configs.recommended,
tseslint.configs.recommended,
reactHooks.configs.flat.recommended,
reactRefresh.configs.vite,
// Must stay last: turns off ESLint stylistic rules that would
// otherwise conflict with Prettier's formatting.
eslintConfigPrettier,
],
languageOptions: {
globals: globals.browser,
},
},
]);
13 changes: 13 additions & 0 deletions country-explorer/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>Country Explorer</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading