Thanks for being here! Fern gives a lot of importance to being a community project, and we rely on your help as much as you rely on ours. If you have any feedback on what we could improve, please open an issue to discuss it!
Our repo uses pnpm to manage dependencies.
To get started:
Step 1: Clone this repo
git clone <...>
cd fern-platform
code .
Step 2: Install dependencies
pnpm install
(If pnpm is not installed, installing specific version 9.4.0 is recommended using curl -fsSL https://get.pnpm.io/install.sh | env PNPM_VERSION=9.4.0 sh -)
To compile the packages in this monorepo, run pnpm compile.
This repo contains both unit tests and integration (end-to-end) tests.
To run the unit tests: pnpm test.
To build and run the NextJS docs UI, first make sure vercel is installed:
npm install -g vercel
From the fern-platform repository, link vercel to the Fern project:
vercel link --project prod.ferndocs.com- When prompted to setup the project, say
yes - When prompted what scope should contain the project, say
fern - When prompted to link to the project, say
yes
Then, run vercel pull, which will create /fern-platform/.vercel/.env.development.local
Then, copy that file (creating if necessary) to /fern-platform/packages/fern-docs/bundle/.env.local
Finally, to run the dev server, cd packages/fern-docs/bundle and run pnpm docs:dev, which should begin running on localhost:3000
To set a dev docs domain, add a NEXT_PUBLIC_DOCS_DOMAIN to .env.local. For instance:
NEXT_PUBLIC_DOCS_DOMAIN=customer.docs.buildwithfern.com
Finally, run pnpm docs:dev. This compiles and runs a NextJS app that communicates with our cloud production environment.
After pushing a commit to a PR, vercel will automatically generate a preview URL for that PR, i.e.
fern-prod-it1bn6vh9-buildwithfern.vercel.app
To access the preview for a given customer site, use the following pattern:
https://fern-prod-it1bn6vh9-buildwithfern.vercel.app/api/fern-docs/preview?host=proficientai.docs.buildwithfern.com
Before cutting a release from main, we test our changes in a staging environment. All production URLs have a secret staging URL:
https://vellum.docs.buildwithfern.com -> https://vellum.docs.staging.buildwithfern.com
https://docs.buildwithfern.com -> https://fern.docs.staging.buildwithfern.com
https://documentation.sayari.com -> https://sayari.docs.staging.buildwithfern.com