This guide takes you from a fresh download of the repository to a running local website.
Install these tools first:
- Node.js for running JavaScript and TypeScript.
- Corepack, which comes with recent Node.js versions and installs the right version of pnpm.
The required pnpm version is stored in the root package.json. You normally do not need to choose
a version yourself.
If you have not downloaded it yet, clone it and enter the new folder:
git clone <repository-url>
cd programmer.barReplace <repository-url> with the URL from GitHub.
corepack enable
corepack installThis will install the correct version of pnpm for this project. The pnpm command should now be
available in your terminal. Check that it works:
pnpm --versionThe environment file stores settings and secret values that should not be committed to Git. You can create it by copying the example file:
cp programmerbar-web/.env.example programmerbar-web/.envOpen programmerbar-web/.env and fill in the values you have received from the web team. The
example already contains test values for Cloudflare Turnstile.
Feide login needs these three values:
FEIDE_CLIENT_ID=
FEIDE_CLIENT_SECRET=
FEIDE_REDIRECT_URI="https://localhost:5173/auth/feide/callback"Never commit real secrets. If you do not have the Feide values, ask on Slack. You should be able to use the whole website without these values, except for login through Feide.
From the repository root, run:
pnpm installThis installs packages for all three projects in the monorepo.
Apply the existing database migrations. This should be done every time you pull new code and the first time you set up the project:
pnpm db:migrate:localpnpm devThe main services are:
- Website: https://localhost:5173
- Sanity Studio: http://localhost:3333
The website uses a local HTTPS certificate. Your computer may ask for permission to create or trust it the first time you start the project.
Open the website and make sure the front page loads. Then run:
pnpm check
pnpm lintYou now have a working development setup.
Stop the development server and run pnpm db:migrate:local from the repository root.
Another development server may already be running. Stop it with Ctrl+C in its terminal, then run
pnpm dev again.
Read the architecture guide for a map of the code, or the development guide before making your first change.