Skip to content
et-dagenPublic

About

The second version of the E&T-dagen website. This time built with Nuxt 3 instead of Django.

Resources

Security policy

Stars

8 stars

Watchers

2 watching

Forks

Latest commit

 

History

1,161 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

etdagen.no

The second version of the E&T-dagen website. This time built with Nuxt 3 instead of Django.

NB! You can find further reading materials in the Repository Wiki if the content in this README is not satisfactory

How the code is structured is in ARCHITECTURE.md. Coding agents follow CLAUDE.md, which AGENTS.md points to. Report security problems privately as described in SECURITY.md.

Getting started

Look at the Nuxt 3 documentation to learn more.

Pre-requisites

  • Node.js v22 or higher (see .nvmrc)
  • bun 1.3.14 (see the packageManager field in package.json)

Installation

Clone the repository using SSH:

git clone git@github.com:et-dagen/et-dagen.git

Install dependencies:

# Navigate to the project root
cd ./et-dagen

# Install dependencies
bun install

Setup

Create a .env file in the project root by copying the .env.example file:

cp .env.example .env
cp .env.example .env.development

Missing environment variables in the .env file will be provided by the project manager.

Development

Start the development server on http://localhost:3000

bun run dev

Production

Locally preview production build:

bun run preview

Checks

The same checks CI runs on every pull request can be run locally:

bun run lint       # eslint + prettier --check
bun run typecheck  # gating typecheck (see tsconfig.typecheck.json)
bun run test       # vitest
bun run build      # nuxt build

bun run lintfix fixes most lint and formatting failures in place.

Deployment

A release moves prod forward to a commit that is already on dev. Digital Ocean App Platform deploys whatever prod points at, so production runs the exact commit CI tested on dev.

  1. Open Promote to production in the Actions tab and choose Run workflow.
  2. Leave ref as dev to release the latest commit, or enter a commit SHA from dev to release an earlier one.
  3. The verify job checks that the commit is on dev, that prod can fast-forward to it, and that lint, typecheck, test and build passed on it. It then opens a Release <commit> issue with the changes being released and the release checklist.
  4. A member of @et-dagen/managers ticks the checklist in that issue, fills in the rollback plan and testing notes, and then approves the production deployment on the workflow run.
  5. The promote job fast-forwards prod, tags the commit release-<date>, publishes release notes under Releases, and closes the issue. Digital Ocean then builds and deploys.

Past releases, with their ticked checklists, are the closed issues labelled release. A rejected or failed release closes its issue as not planned.

Follow the deploy in the Digital Ocean control panel.

Rolling back. Redeploy the previous deployment from the Digital Ocean control panel, then fix the problem on dev and release again. Do not push to prod by hand.

If verify says prod cannot fast-forward, prod has a commit that dev lacks, usually from an emergency fix made on prod. Open a pull request from prod into dev and merge it with a merge commit, never a squash, then run the workflow again.

Development guidelines

Issues

Issues should be created for all new features and bugs. The issue should be assigned to the person who will be working on it. The issue should be labeled with the appropriate label(s).

When deciding to work on a new issue, assign yourself to the issue and move it to the In progress column on the project board.

When opening a branch for the issue, click the Create a branch under Development on the GitHub issue page. Name the branch feature/issue_number-issue-title-in-kebab-case, and select Checkout locally. For example, if the issue number is 42 and the issue title is Add a new page, the branch should be named feature/42-add-a-new-page.

When the issue is completed, create a pull request and assign the pull request to the person who should review it. The issue should be moved to the In review column on the project board.

When the pull request is approved and CI is green, merge it into dev and close the issue.

Branches

NB! All branches created working on issues should be branched off of dev.

The project uses a two-branch flow:

  • dev — the default branch and integration target. All feature work is merged here.
  • prod — production. Only ever moved forward by the Promote to production workflow, which triggers the Digital Ocean deploy.

Both branches are protected: no force-pushes, no deletion, and no merging until CI is green. Nobody pushes to prod directly; only the release workflow can, after a manager approves. A pull request into dev needs one approval, from @et-dagen/managers if it touches .github/workflows/, and a new push dismisses earlier approvals. Feature branches into dev should be squashed.

Branch naming conventions:

  • feature/issue_number-issue-title-in-kebab-case - A branch for a new feature.
  • docs/... - A branch for documentation.
  • fix/... - A branch for a bug fix.
  • refactor/... - A branch for refactoring.
  • chore/... - A branch for miscellaneous tasks.
  • More may be added in the future.

Commits

Commit messages must follow Conventional Commits. This is enforced, not just recommended — two husky hooks run locally:

  • pre-commit runs lint-staged, which applies prettier --write and eslint --fix to staged files.
  • commit-msg runs commitlint, which rejects messages that do not parse as Conventional Commits. Allowed types are listed in commitlint.config.mjs.

Because feature branches are squash-merged, the pull request title becomes the commit subject on dev — so it must be conventional too. CI checks this and reports it, without blocking.

Pull requests

  • Pull requests should be created for all new features and bugs. The pull request should be assigned to the person who should review it. The pull request should be labeled with the appropriate label(s).
  • A pull request cannot be merged until the lint, typecheck, test and build checks pass.

Who can merge

Write access comes from organisation membership, not from per-person grants on this repository. In practice:

  • Organisation members can review and merge into dev. Every pull request needs one approval from another member.
  • Members of @et-dagen/managers can additionally approve a release to production, and must approve any pull request that changes .github/workflows/.
  • Managers and organisation admins can merge a pull request without the approval, but only explicitly: the "Merge without waiting for requirements" checkbox, or gh pr merge <n> --admin. Use it when a review is stuck, never on a red build. GitHub logs every bypass under Settings → Rules → Insights.
  • Everyone else is welcome to fork the repository and open a pull request. Those PRs are automatically labelled external-contribution, and an approval from an external contributor does not satisfy the branch ruleset.

If you are contributing regularly and keep having to fork, ask an organisation owner to add you to the organisation.

Testing

Tests run on Vitest:

bun run test        # unit tests, as CI runs them
bun run test:watch  # unit tests in watch mode
bun run build && bun run test:api  # API tests against the Firebase emulators

Unit tests cover domain/ and pure server and composable code. Component tests need a Nuxt runtime environment via @nuxt/test-utils, which is not set up yet.

The API tests in tests/api/ send real HTTP requests to the production build, running against the Firebase Auth, Realtime Database and Storage emulators. They pin down what the v1 API does today, so that moving a handler onto the new architecture cannot change its behaviour unnoticed. test:api starts the emulators with a pinned firebase-tools through bunx, which needs Java 21 or newer (brew install --cask temurin@21 on macOS). The emulators use a demo- project, so they never reach a real Firebase project, and the server gets a throwaway key, never the one in your .env. Build first: the tests use whatever is in .output/.

Type checking

There are two typecheck commands, and the split is deliberate:

  • bun run typecheck checks the plain-TypeScript surface (server/, stores/, composables/, middleware/, plugins/, …). It is clean, and CI blocks merges on it.
  • bun run typecheck:full additionally checks Vue SFCs with vue-tsc. These carry pre-existing type errors that predate any typechecking in this repo, so it cannot be a plain pass/fail gate yet.

Instead CI runs typecheck:full as a ratchet: it passes while the error count stays at or below the number recorded in .github/typecheck-baseline.txt, and fails only if a change adds errors. When you fix some, lower the baseline to match. When it reaches zero, fold the SFC surface into the gating command and delete the job.

About

The second version of the E&T-dagen website. This time built with Nuxt 3 instead of Django.

Resources

Security policy

Stars

8 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages