This repository contains backend services for the Playful Programming website and (future) content management system.
The REST API is the external interface for Hoof, which handles tasks via enqueuing to Redis. Tasks are pulled from Redis via the worker. The worker spawns worker threads done to avoid overburdening with CPU and memory intensive tasks
flowchart LR
API[REST API]
REDIS[Redis]
WORKER[Worker]
PROC[Processors]
DB[(Postgres)]
S3[(S3)]
API -->|enqueue job| REDIS
WORKER -->|fetch job| REDIS
WORKER --> PROC
PROC -->|write| DB
API -->|read| DB
PROC -->|upload| S3
- Node.js 22
- Docker
- pnpm 10.6.1
Install the project dependencies:
pnpm installSet up secrets & environment variables:
cp .env.example .envStart background services:
docker compose up -dRun the dev server:
pnpm devOnce it's running, you should see the API documentation hosted at http://localhost:3000/docs/. This can also be used to test the endpoints!
To test the server in its docker container, instead of running pnpm dev, you can build & start the docker image with:
docker compose --profile=app watch- Manage tasks for post image & metadata generation (initial deployment)
- Index & sync post content from the main repository
- Provide APIs to query that content on-demand (so that playfulprogramming can switch to SSR)
- Enable user accounts & login
- Provide APIs to directly create and edit site content