Books About Food
Beautifully designed cookbooks and the people making them.
Learn more »
To get a local copy up and running, please follow these simple steps.
- Node.js (Version: >=20.x)
- PostgreSQL
- NPM
BAF relies on
npm workspacesto manage multiple components simultaneously, it's untested with yarn or pnpm.
-
You'll need environment variables set up for each package. Each package that needs a
.envfile locally has a.env.examplefile checked in, on unix systems you can find them withfind . -name ".env*". Copy these and fill in the missing values. -
Run
npm run devto run the local development servers for all relevant packages.
| Directory | Description | |
|---|---|---|
| Next.js Frontend | /web | A user facing frontend app built with Next.js |
| Admin Backend | /admin | A server connecting to Forest with customisations. Also acting as server for Inngest |
| Core Services | /packages/core | A set of shared services, with consistent APIs, for performing business logic. |
| Database | /packages/database | Prisma schema and client instantiation |
| End to End tests | /packages/e2e | a set of black-box e2e specs for testing critical flows |
| /packages/email | Email templates using react.email, including a development preview server | |
| Jobs | /packages/jobs | A set of asynchronous background jobs, run as functions using Inngest |
- Frontend →
http://localhost:5000 - Admin Backend* →
http://localhost:5001 - Email preview →
http://localhost:3883 - Inngest dev server →
http://localhost:8288
*(N.B. this is not designed to be accessed in the browser, only via Forest, Inngest or API call)
Right now, the end to end tests in the e2e/tests project are run on merge to main against a production preview deployment. These require a production-equivalent environment to pass.
Run npx playwright install chromium to download a test browser.
The web frontend for booksaboutfood.info is deployed to Vercel, but can be deployed to any Node server.
The admin backend server for Forest requires a long running Node process, so is more suitable for a platform like Heroku, Digital Ocean, etc.