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
77 changes: 77 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@

.env*
!.env.example

#INFO: use `.env.example` file if we later need env vars to run project.
# Only include values that can be publicly knows.



# The follwoing is generated by Gemini flash-lite model to cast a wide net
# and avoid repo-bloat which needs to be fixed later. Not sure what code
# environment the rest of the group uses.

# macOS
.DS_Store
.AppleDouble
.LSOverride
Icon?
._*

# Windows
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
Desktop.ini
$RECYCLE.BIN/

# Linux
.directory
*~

# VS Code
.vscode/*
!.vscode/extensions.json

# JetBrains IDEs (IntelliJ, WebStorm, PyCharm, PhpStorm, etc.)
.idea/
*.iml
*.iws
*.ipr

# Sublime Text
*.sublime-workspace
*.sublime-project

# Atom (historical / legacy)
.atom/

# Vim / Neovim
*~
*.swp
*.swo
.netrwhist

# Notepad++
backup/

# Node & Build Artifacts
node_modules/
jspm_packages/
dist/
build/
.out/
.next/
.nuxt/

# Logs & Temporary Files
logs/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
.npm
.cache/
.temp/
.tmp/
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm test
44 changes: 26 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
# T30-Project-1
# Project 1T30-Project-1

Repository for team IT2810-H26-T30 in IT2810-H26.
## Useful commands

## Working in this repository
> These are generated in ./package.json `scripts` tag. Leaving them here as a cheatsheet.
`main` is protected — you cannot push to it directly. Work on a branch and
open a pull request:
- `npm run dev` - Runs the project in memory, view it from localhost address in stdout
- `npm run lint-full` - Scans project for syntax errors, potential bugs, or stylistic inconsistencies.
- `npm run build` - Compiles TS to JS, remove dead code, bundle source files, etc. Moves the compiled resources to ./dist/
- `npm run preview` - Runs the previous build to let you test the build before pushing it to web-server or CDN.

```bash
git checkout -b my-feature
git push -u origin my-feature
```
> The previous commands we're generated automatically when project was created. What follows is custom behaviour.
Before a pull request can be merged:
- `npm run test` - Runs vitest test sets.
- `npm run format` - -Runs prettier to format project (also runs on `git commit`)
- `npm run lint` - Lints only staged changes (`git status`)

1. **A member of IT2810-H26-T30 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.
## Dependencies

> For version numbers, view ./package.json
### Required for assignment:

- @tanstack/react-query
- vitest
- eslint
- prettier

### Added by us:

- husky (automates Git hooks, we use it to run prettier upon `git commit`)
- lint-staged (only lints staged changes (`git status`), saves time not linting the whole project every call)
10 changes: 10 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Docs

This directory contains all the docs for this project.

Fill in this readme as needed to index new subdirectories
with high level information. This avoids our docs from being too abstract

1. ./old_root_readme/
Contains the original readme's that I deleted from root, so you may
read it if you wish
16 changes: 16 additions & 0 deletions docs/old_root_readme/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
> This is a copy of the original README provided by NTNU so all may read it.
# Project 1T30-Project-1

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

Working in this repository
main is protected — you cannot push to it directly. Work on a branch and open a pull request:

git checkout -b my-feature
git push -u origin my-feature
Before a pull request can be merged:

A member of IT2810-H26-T30 must approve it. You cannot approve your own pull request, and approvals from staff do not count — you review each other's code.
Every review comment must be marked resolved. Reply to each one, fix it or explain why not, then click Resolve conversation.
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.
75 changes: 75 additions & 0 deletions docs/old_root_readme/generatedREADME.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
> This is an exact copy of the README generated after running `npm create vite@latest`. Keeping temporary, will probably delete later.
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs)
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/)

## React Compiler

The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:

```js
export default defineConfig([
globalIgnores(["dist"]),
{
files: ["**/*.{ts,tsx}"],
extends: [
// Other configs...

// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,

// Other configs...
],
languageOptions: {
parserOptions: {
project: ["./tsconfig.node.json", "./tsconfig.app.json"],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
]);
```

You can also install [eslint-plugin-react-x](https://npmx.dev/package/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://npmx.dev/package/eslint-plugin-react-dom) for React-specific lint rules:

```js
// eslint.config.js
import reactX from "eslint-plugin-react-x";
import reactDom from "eslint-plugin-react-dom";

export default defineConfig([
globalIgnores(["dist"]),
{
files: ["**/*.{ts,tsx}"],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs["recommended-typescript"],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ["./tsconfig.node.json", "./tsconfig.app.json"],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
]);
```
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>react-ts</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading