Getting Started¶
Prerequisites¶
Node.js 18+ or 20+ (use project-local version)
npm (comes with Node.js)
Installation¶
cd ~/Projects/fgai/www
npm install
Environment Variables¶
Copy the example file and adjust if needed:
cp .env.example .env.local
Variable |
Default |
Description |
|---|---|---|
|
|
Strapi CMS base URL |
|
|
Public site URL (for SEO) |
Running Locally¶
Two processes are needed: the mock Strapi server and the Next.js dev server.
Terminal 1 — Mock Strapi:
node scripts/mock-strapi.mjs
This starts a lightweight API server on port 1337 serving 20 articles (9 feature articles + 11 edge-case test articles), 1 category, 16 tags, and 1 author. See Seeding & Testing for details.
Terminal 2 — Next.js:
npm run dev
Open http://localhost:3000 in your browser. The middleware will redirect
to /en (or your browser’s preferred locale).
Running Tests¶
# Run once
npm test
# Watch mode
npm run test:watch
Linting¶
npm run lint
Available npm Scripts¶
Script |
Description |
|---|---|
|
Start Next.js dev server (port 3000) |
|
Production build |
|
Start production server |
|
Run ESLint |
|
Run Vitest once |
|
Run Vitest in watch mode |