-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |