Skip to content
Jupiter documentation
Menu

hello-fresh API

Menu planning service for weekly menus, recipes, ingredients and reviews, running as a Cloudflare Worker with a D1 database.

Start

Install it and run it for the first time.

Guides

Steps for one task each.

Reference

Every command, option and file format.

Concepts

How it works and why it is built this way.

Develop

Build, test and release the project.

hello-fresh API manages weekly menus, recipes, ingredients, customers and their reviews. It runs as a Cloudflare Worker and stores data in D1. A rewrite of a 2021 Flask service, it keeps the original API contract. See From Flask to Workers for what changed.

What it does#

  • Stores recipes with ingredients, nutrition, directions and a Classification.
  • Puts recipes into the Weekly menu for each week and scores the week from customer reviews.
  • Secures every endpoint except registration and login with a JWT in the x-access-tokens header.
  • Validates every request body with Zod and returns JSON errors.

Quick start#

The worker serves http://localhost:8787. Log in with the seeded account user / password:

Classification
A recipe category, such as Meat & Veggis. A recipe belongs to one classification.
D1
Cloudflare's serverless SQLite database. The binding name in this project is DB.
JWT
A JSON Web Token. The API signs HS256 tokens with SECRET_KEY and accepts them in the x-access-tokens header.
Mapping
A row in weekly_recipe_map that puts a recipe into a weekly menu.
Soft delete
A delete that keeps the row and clears is_publish or is_active, so list endpoints stop returning it.
Weekly menu
A calendar week of recipes, identified by a unique week number.