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_URL

http://localhost:1337

Strapi CMS base URL

NEXT_PUBLIC_SITE_URL

http://localhost:3000

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

dev

Start Next.js dev server (port 3000)

build

Production build

start

Start production server

lint

Run ESLint

test

Run Vitest once

test:watch

Run Vitest in watch mode