# Migrate frontend from Next.js to Angular

- Status: accepted
- Date: 2026-04-26

## Context and Problem Statement

The project was initially built with Next.js (React). The development team already maintained an existing Angular stack for other projects, creating a knowledge split between two frontend frameworks. Server-side rendering — Next.js's main differentiator — was not required: all data is user-specific and served via authenticated API calls.

## Considered Options

- Keep Next.js/React
- Migrate to Angular
- Migrate to Vue or Svelte

## Decision Outcome

Chosen option: "Migrate to Angular", because the team already maintained an Angular stack for other projects, making it the path of least resistance with no additional knowledge split.

### Positive Consequences

- Single frontend framework across projects — reuse of existing expertise, libraries, and patterns.
- No SSR complexity; the app is a pure SPA, which fits Angular's model naturally.

### Negative Consequences

- Complete rewrite — no incremental migration path exists between React and Angular.
- Next.js artifacts (`.next/`, `src/modules/`, `src/middleware.ts`, etc.) required a dedicated cleanup pass after the migration.

## Pros and Cons of the Options

### Keep Next.js/React

- Good, because no rewrite cost.
- Bad, because maintaining two frontend frameworks in parallel increases overhead.
- Bad, because SSR provides no benefit for this authenticated, user-specific application.

### Migrate to Angular

- Good, because leverages existing team expertise.
- Good, because consistent toolchain across projects.
- Bad, because full rewrite required.

### Migrate to Vue or Svelte

- Good, because smaller bundle size.
- Bad, because no existing team expertise — introduces a third framework.
