docs(dev): align setup with current stack

This commit is contained in:
cesnimda
2026-08-30 11:32:00 +02:00
parent 16ef3b9463
commit 2d7a51c3fd
10 changed files with 104 additions and 78 deletions
-4
View File
@@ -1,4 +0,0 @@
# react-scripts (kept only as the Jest test runner, see package.json) still declares a
# typescript ^3.2.1||^4 peer constraint that's stale for our actual (Next.js-driven) TS 5.x --
# it doesn't type-check via that peer path, so the conflict is safe to relax.
legacy-peer-deps=true
+44 -26
View File
@@ -1,46 +1,64 @@
# Getting Started with Create React App
# Job Tracker frontend
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
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`.
## Available Scripts
## Requirements
In the project directory, you can run:
- 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
### `npm start`
Install the lockfile exactly:
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
```powershell
npm ci
```
The page will reload if you make edits.\
You will also see any lint errors in the console.
## Development
### `npm test`
Start the application on Next.js's default development port:
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
```powershell
npm run dev
```
### `npm run build`
Open `http://localhost:3000`. The client calls `http://localhost:5202/api` on localhost unless `NEXT_PUBLIC_API_BASE_URL` overrides it.
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
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.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
## Quality gates
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
```powershell
npm run lint
npm test -- --runInBand
npm run build
```
### `npm run eject`
The production build is written to `out/` and is served by nginx in the frontend container.
**Note: this is a one-way operation. Once you `eject`, you cant go back!**
Run the browser suite after installing Chromium once:
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
```powershell
npx playwright install chromium
npm run test:e2e
```
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
The browser suite covers login, job creation, Career Workspace routing, and public CV/PDF access against isolated services.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.
## Useful paths
## Learn More
- `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
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
## Runtime configuration
To learn React, check out the [React documentation](https://reactjs.org/).
`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.
@@ -239,13 +239,12 @@ test('custom entries can be added, edited, reordered and deleted with confirmati
await waitFor(() => expect(screen.getAllByLabelText(/^Entry /)).toHaveLength(1));
await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
fireEvent.click(screen.getByRole('button', { name: 'Save now' }));
expect(await screen.findByText('Saved')).toBeInTheDocument();
expect(mockedApi.put).toHaveBeenLastCalledWith('/cv/variants/3', expect.objectContaining({
await waitFor(() => expect(mockedApi.put).toHaveBeenLastCalledWith('/cv/variants/3', expect.objectContaining({
settings: expect.objectContaining({
customSections: [expect.objectContaining({ title: 'Selected projects', items: ['First project'] })],
}),
}));
})), { timeout: 5000 });
expect(await screen.findByText('Saved')).toBeInTheDocument();
fireEvent.click(screen.getByRole('button', { name: 'Remove Selected projects section from this CV' }));
dialog = await screen.findByRole('dialog', { name: 'Delete custom section' });
@@ -279,15 +278,13 @@ test('profile-backed sections expand, reorder, hide and persist variant-only ove
fireEvent.click(screen.getByRole('button', { name: 'Move Engineer entry down' }));
fireEvent.click(screen.getByRole('button', { name: 'Hide Lead entry' }));
fireEvent.click(screen.getByRole('button', { name: 'Move Experience section down' }));
fireEvent.click(screen.getByRole('button', { name: 'Save now' }));
expect(await screen.findByText('Saved')).toBeInTheDocument();
expect(mockedApi.put).toHaveBeenLastCalledWith('/cv/variants/3', expect.objectContaining({
await waitFor(() => expect(mockedApi.put).toHaveBeenLastCalledWith('/cv/variants/3', expect.objectContaining({
settings: expect.objectContaining({
sections: expect.arrayContaining([expect.objectContaining({ key: 'experience', itemOrder: ['job-2', 'job-1'], presentation: 'grid', columns: 2 })]),
overrides: expect.objectContaining({ 'job-2': expect.objectContaining({ hidden: true }) }),
}),
}));
})), { timeout: 5000 });
expect(await screen.findByText('Saved')).toBeInTheDocument();
});
test('preview failure is visible and retryable without leaving the editor', async () => {