Use npm to install the dependencies recorded in package-lock.json:
npm installTo update dependencies within the version ranges declared in package.json, run:
npm updateUse npm outdated to check for newer versions. To add a dependency, use
npm install <package>; add --save-dev for a development dependency.
You can start the server using this command:
npm run devOpen http://localhost:3000 with your browser to see the result. You can start editing the page by modifying src/pages/index.tsx.
Run the followed command:
- Build the project:
npm run build - Launch linter:
npm run lint:strict - Launch Typecheck:
npm run typecheck - Launch Prettier:
npm run format:check - Launch Jest:
npm test
The calculator (Pinkometer) has focused reducer tests and a rendered modal-flow regression test covering product selection, frequency selection, summary, and loading. Run them with:
npm test -- src/components/calculator/__tests__The calculator sends its initial answers and selected reduced-impact commitment to the Pinkbombs FastAPI (https://github.com/dataforgoodfr/12_pinkbombs) service when the badge form is submitted. The calculation itself remains local to the Next.js application.
Configure this server-only environment variable in Vercel for Development, Preview, and Production:
PINKBOMBS_API_BASE_URL
For local development, set PINKBOMBS_API_BASE_URL=http://localhost:8000 in
.env.local. The Vercel Route Handlers proxy /api/v1/options and
/api/v1/submissions; the browser does not call FastAPI directly. Configure the
FastAPI CORS allowlist with the deployed frontend's exact origin (never *);
CORS is not an authentication mechanism. Do not expose API credentials through
NEXT_PUBLIC_ variables.
Next.js generates /sitemap.xml at build time from src/app/sitemap.ts.
It includes the current pages and articles in French and English, using the localized routes and article titles. Archive pages are excluded and retain their noindex metadata.
After npm run build, run npm start and open
http://localhost:3000/sitemap.xml.
There is no generated sitemap file in public/. Submit the production
/sitemap.xml URL in Google Search Console after deploying.
The footer and calculator badge form can subscribe an email address to the
Brevo newsletter through the Pages Router Vercel Function at
/api/newsletter/subscribe. Configure these server-only environment variables
in Vercel for Development, Preview, and Production:
BREVO_API_KEYBREVO_NEWSLETTER_LIST_ID
For local development, pull the Development values into .env.local:
vercel env pull .env.local --environment=developmentThe API treats an existing contact as a successful subscription and does not expose Brevo credentials or provider error details to the browser.
Before deploying, log in to the Vercel account linked to this project:
vercel loginVercel requires the latest commit's author email to match the email linked to the Vercel account. Set the Git email and create an empty commit so Vercel can accept the deployment:
git config --global user.email "pinkbombs.dev@gmail.com"
git commit -m "fix config user email for vercel" --allow-emptyRun the deployment command from the project directory. Use the Preview target for staging:
vercel --target previewUse the Production target for the live site:
vercel --target productionMake sure the required environment variables are configured for the matching Preview or Production environment in Vercel before deploying.
This starter is using conventional commits, it is mandatory to use it to commit changes.