Skip to content

docs: update readme #129

Merged
merged 1 commit into from
Apr 30, 2026
Merged
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
98 changes: 98 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Nettdetektivene Frontend

This repository contains the frontend for Nettdetektivene, built with Vue 3, Vite, TypeScript, Pinia, Vue Router, and Tailwind CSS. It is the client application for the game and teacher flows, and is intended to run together with the backend services from the main `nettdetektivene` repository.

## Getting started

Use Node.js `20.19+` or `22.12+`, then install dependencies:

```bash
npm install
```

For local development, this frontend should normally be run together with the backend through Docker Compose in the main repository:

- Backend and shared local setup: [nettdetektivene](https://git.ntnu.no/idatt2106-v26-04/nettdetektivene)
- Start the backend stack from that repository as described there.
- Run this frontend locally with:

```bash
npm run dev
```

By default, Vite proxies `/api` and `/assets` requests to `http://backend:8080`, which matches the Docker Compose setup. If needed, you can override this with `VITE_API_BASE_URL` or `VITE_API_PROXY_TARGET`.

## Available scripts

```bash
npm run dev
```

Starts the Vite development server.

```bash
npm run build
```

Runs type-checking and creates a production build.

```bash
npm run type-check
```

Runs `vue-tsc` across the project.

```bash
npm run lint
```

Runs Oxlint and ESLint with fixes.

```bash
npm run format
```

Formats the `src/` directory with Prettier.

## Testing

Run unit tests with:

```bash
npm run test:unit -- --run
```

Run end-to-end tests with:

```bash
npm run test:e2e
```

Before pushing changes, it is a good baseline to run:

```bash
npm run type-check
npm run test:unit -- --run
```

For changes affecting navigation, login, or full user flows, also run:

```bash
npm run test:e2e
```

## Project structure

- `src/app/` contains app-level setup such as router, layouts, audio, styles, and shared bootstrapping.
- `src/auth/`, `src/classrooms/`, `src/map/`, `src/stops/`, `src/mystery/` and similar folders are organized by feature.
- Most feature folders contain their own `api/`, `components/`, `model/`, `pages/`, and `routes.ts` where relevant.
- `src/shared/` contains cross-feature components and utilities.
- `src/locales/` contains localized strings.
- Tests live close to the code, for example in `__tests__/` folders and feature-specific test directories.
- `e2e/` contains Playwright tests.

## Notes

- Use Vite environment variables for backend configuration, such as `VITE_API_BASE_URL`.
- Do not commit secrets or local test artifacts.
- The functional scope is defined primarily by the wiki and project documents, even if the current code does not yet cover everything.