Skip to content

samtgarson/books-about-food

Repository files navigation

Books About Food

The cookbook industry's new digital home.
Learn more »

Test & Deploy Contributor Covenant

Built With

Getting Started

To get a local copy up and running, please follow these simple steps.

Prerequisites

  • Node.js (Version: >=20.x)
  • PostgreSQL
  • NPM

BAF relies on npm workspaces to manage multiple components simultaneously, it's untested with yarn or pnpm.

Setup

  1. You'll need environment variables set up for each package. Each package that needs a .env file locally has a .env.example file checked in, on unix systems you can find them with find . -name ".env*". Copy these and fill in the missing values.

  2. Run npm run dev to run the local development servers for all relevant packages.

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
Email /packages/email Email templates using MJML and Mailing, including a development preview server
Jobs /packages/jobs A set of asynchronous background jobs, run as functions using Inngest

Development Apps

  1. Frontend → http://localhost:5000
  2. Admin Backend* → http://localhost:5001
  3. Email preview → http://localhost:3883
  4. 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)

End To End Tests

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.

Deployment

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.

About

The cookbook industry's new digital home

Resources

Code of conduct

Stars

Watchers

Forks

Languages