Local Development Setup

Prerequisites

First run

git clone https://github.com/pmgasset/fortadamswebsite.git
cd fortadamswebsite
npm install
cp .env.example .env.local     # fill in what you need (see below)
npm run dev                    # http://localhost:3000

.env* files are git-ignored except .env.example. Never commit real secrets.

Scripts

Command Purpose
npm run dev Dev server with hot reload
npm run build Production static export to out/. Run this before pushing; it catches type errors and export-incompatible code.
npm run start Not useful with output: "export". Serve out/ with any static server instead, for example npx serve out.
npm run lint ESLint
npm run format Prettier (writes), including Tailwind class sorting
npm run format:check Prettier check (CI-friendly)

Environment for local development

Most features work with an empty .env.local:

Testing the event inquiry function locally

next dev doesn't run Cloudflare Pages Functions, so POST /api/event-inquiry returns 404 and the form shows its error state. To test end to end, build and run with Wrangler:

npm run build
npx wrangler pages dev out

Wrangler reads the GHL_* secrets from a .dev.vars file in the project root. The existing .env* ignore rule does not cover .dev.vars, so add .dev.vars to .gitignore before creating it. Use a HighLevel test pipeline or sub-account, because this creates real contacts and opportunities.

Editing CMS content locally

public/admin/config.yml has local_backend: true, so you can use the CMS without GitHub auth:

npm run dev            # terminal 1
npx decap-server       # terminal 2 (proxy on port 8081)

Then open http://localhost:3000/admin/edit/ (or start from the workspace at /admin/). Changes are written straight to your working copy. Review them with git diff and commit as usual.

Before you push

npm run lint && npm run format:check && npm run build

There's no CI in the repository (no .github/workflows). Cloudflare Pages is the only automated build, so a broken build only shows up there. Run the build locally.


Revision #1
Created 2026-09-28 14:25:57 UTC by David Prata
Updated 2026-09-28 14:25:57 UTC by David Prata