Two commands
Prerequisites
Node.js 22+
The repo requires
node >= 22. Download Node.jspnpm 10
What pnpm dev:mock starts
It runs two processes side by side and stops both if either one fails:
The mock is a real HTTP server: an Express app serving MSW handlers, not
a browser service worker. Server components,
generateMetadata, and the sitemap all talk to it
too, because the script points both NEXT_PUBLIC_API_URL and INTERNAL_SERVER_API_URL at
localhost:4000.
The script sets every environment variable it needs inline, so you do not need to copy
.env.example. Only the optional feature-request form and S3 metadata assets read
variables the mock doesn’t provide.Signing in without OAuth
You’re signed in by default: the mock API issues the same session cookie the real backend uses, so protected routes like/dashboard/my-projects and /projects/create just work.
To test signed-out states, use the Mock mode button in the bottom-left corner of the
page. It flips between Signed in and Signed out and reloads.
Verify your setup
1
The homepage lists projects
http://localhost:3000 should show a grid of seeded open-source
projects with working filters and search.
2
A protected route loads
Visit http://localhost:3000/dashboard/my-projects.
You should see projects owned by the mock user, not a redirect to the login page.
3
The mock API answers
{ "data": [...], "timestamp": "..." } payload.4
The test suite passes
Common issues
Port 3000 or 4000 is already in use
Port 3000 or 4000 is already in use
If 3000 is taken, Next.js just picks the next free port and tells you which one in the
terminal. Nothing to do.If 4000 is taken, the mock API can’t start. Free that port and run
pnpm dev:mock
again.A request returns 501
A request returns 501
The mock API returns
501 for any route it doesn’t handle, and logs
[mock-api] UNHANDLED <method> <path> in the terminal. It means the flow you’re building
needs a handler that doesn’t exist yet. See adding a handler.`pnpm install` fails on the lockfile
`pnpm install` fails on the lockfile
CI installs with
--frozen-lockfile. If you changed dependencies, commit the updated
pnpm-lock.yaml along with your package.json change.I want to run against the real API
I want to run against the real API
pnpm dev (without :mock) expects the API at http://localhost:4000 and requires access
to the private backend. Contributors should use pnpm dev:mock.Next steps
How to contribute
Branches, commits, and what CI will check
The codebase
How features, the data layer, and conventions fit together
Mock API guide
Add handlers and seed data for new flows
Web app setup & scripts
Every script, env var, and tooling detail