docs: consolidate repository guides and preserve audit history
This commit is contained in:
@@ -1,64 +1,20 @@
|
||||
# Job Tracker frontend
|
||||
|
||||
The frontend is a statically exported Next.js 16 application using React 19, TypeScript, Material UI, and React Router. Next.js supplies the build shell; authenticated and public application routes are defined in `src/App.tsx`.
|
||||
This directory contains the statically exported Next.js 16 / React 19 / TypeScript frontend. Next supplies the build shell; React Router and `src/App.tsx` define the application routes.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Node.js 24 (the version used by CI)
|
||||
- npm 11 or a compatible npm release
|
||||
- The Job Tracker API at `http://localhost:5202` for normal local use
|
||||
|
||||
Install the lockfile exactly:
|
||||
## Development and checks
|
||||
|
||||
```powershell
|
||||
npm ci
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
Start the application on Next.js's default development port:
|
||||
|
||||
```powershell
|
||||
npm run dev
|
||||
```
|
||||
|
||||
Open `http://localhost:3000`. The client calls `http://localhost:5202/api` on localhost unless `NEXT_PUBLIC_API_BASE_URL` overrides it.
|
||||
|
||||
The Playwright harness uses port `3300` and starts its own isolated API and SQLite database. Do not point it at a development or production database.
|
||||
|
||||
## Quality gates
|
||||
|
||||
```powershell
|
||||
npm run lint
|
||||
npm test -- --runInBand
|
||||
npm run typecheck
|
||||
npm run build
|
||||
```
|
||||
|
||||
The production build is written to `out/` and is served by nginx in the frontend container.
|
||||
Open `http://localhost:3000`; local API calls use `http://localhost:5202/api`. Install Chromium once and run `npm run test:e2e` for the isolated browser suite.
|
||||
|
||||
Run the browser suite after installing Chromium once:
|
||||
`NEXT_PUBLIC_API_BASE_URL` is the only browser-visible API setting. Leave it empty in production so nginx proxies same-origin `/api` requests. It is embedded at build time and must never contain secrets.
|
||||
|
||||
```powershell
|
||||
npx playwright install chromium
|
||||
npm run test:e2e
|
||||
```
|
||||
|
||||
The browser suite covers login, job creation, Career Workspace routing, and public CV/PDF access against isolated services.
|
||||
|
||||
## Useful paths
|
||||
|
||||
- `app/` — thin Next.js application shell
|
||||
- `src/App.tsx` — application routes and shared authenticated shell
|
||||
- `src/api.ts` — API client and local/default base URL
|
||||
- `src/components/` — feature and shared UI components
|
||||
- `src/i18n/` — English and Norwegian Bokmål UI messages
|
||||
- `src/theme.ts` — application theme
|
||||
- `e2e/` — Playwright browser tests
|
||||
- `next.config.js` — static-export configuration
|
||||
- `playwright.config.ts` — isolated browser-test services
|
||||
|
||||
## Runtime configuration
|
||||
|
||||
`NEXT_PUBLIC_API_BASE_URL` is the only browser-visible API setting. Leave it unset in the production container so nginx proxies same-origin `/api` requests. Values prefixed with `NEXT_PUBLIC_` are embedded at build time and must never contain secrets.
|
||||
|
||||
See the repository `README.md` for full-stack development and `deploy/README.md` for production requirements.
|
||||
See the repository [frontend guide](../docs/frontend/README.md) and [configuration reference](../docs/configuration/environment-variables.md).
|
||||
|
||||
@@ -25,7 +25,7 @@ import { useI18n } from "../i18n/I18nProvider";
|
||||
// These compose systems that already exist. CV editing, preview, PDF export, themes and version
|
||||
// history all live in the CV builder at /cv-builder — this section only chooses WHICH variant the
|
||||
// application uses and links out. The cover letter is the one thing genuinely owned here, because it
|
||||
// is application-specific by nature. docs/architecture/application-workspace.md.
|
||||
// is application-specific by nature. docs/architecture/overview.md.
|
||||
|
||||
function useAsset<T>(load: () => Promise<T>, deps: React.DependencyList) {
|
||||
const { t } = useI18n();
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
// One workflow surface, not a new tracker: the system items arrive already ticked wherever the
|
||||
// existing readiness signals say the work is done (CV attached, cover letter written, follow-up
|
||||
// scheduled...). Everything here is the user's to tick, add to, reorder or dismiss.
|
||||
// docs/architecture/application-workspace.md.
|
||||
// docs/architecture/overview.md.
|
||||
export default function ApplicationChecklist({ jobId, onChanged }: { jobId: number; onChanged?: () => void }) {
|
||||
const { t } = useI18n();
|
||||
const [checklist, setChecklist] = useState<Checklist | null>(null);
|
||||
|
||||
@@ -16,7 +16,7 @@ import { useI18n } from "../i18n/I18nProvider";
|
||||
// Everything here renders a deterministic, read-only backend answer. No component triggers an AI
|
||||
// generation stays in the dedicated document/preparation tools, so nothing on this page can
|
||||
// silently spend a token or change the user's data.
|
||||
// docs/architecture/application-workspace.md.
|
||||
// docs/architecture/overview.md.
|
||||
|
||||
// One loader for all three sections: same fetch/loading/empty/error shape, so the sections stay
|
||||
// consistent and each one is just its own rendering.
|
||||
|
||||
@@ -21,7 +21,7 @@ import { useConfirm } from "../confirm";
|
||||
//
|
||||
// The prep content is the user's. AI suggestions are generated in this dedicated workspace and only
|
||||
// become prep items after an explicit accept action.
|
||||
// docs/architecture/application-workspace.md.
|
||||
// docs/architecture/overview.md.
|
||||
|
||||
function Shell({ title, subtitle, loading, error, children }: {
|
||||
title: string;
|
||||
|
||||
@@ -44,7 +44,7 @@ import {
|
||||
//
|
||||
// This is a surface, not a new data store: the overview is one aggregate read, and each section
|
||||
// reuses the component that already owns that domain (for example Attachments and Correspondence).
|
||||
// docs/architecture/application-workspace.md.
|
||||
// docs/architecture/overview.md.
|
||||
export default function ApplicationWorkspacePage() {
|
||||
return <ApplicationWorkspace />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user