Skip to content

Latest commit

 

History

History
53 lines (41 loc) · 1.55 KB

README.md

File metadata and controls

53 lines (41 loc) · 1.55 KB

Hoof

"Hoof" provides the backend for Playful Programming's content management experience.

This repository houses:

  • hoof-api: the external-facing REST API
  • hoof-worker: a background task runner in NodeJS, for image fetching & generation

Getting Started

Prerequisites:

To start the postgres database:

cp .env.example .env
docker compose up --wait

To run the API server:

cd api
./gradlew runFlywayMigrate # runs any database migrations
./gradlew run # (or use the Run button in IntelliJ)

To start the worker app:

cd worker

# Set up pnpm through Corepack: https://nodejs.org/api/corepack.html
corepack enable pnpm
corepack install
corepack up

# Install dependencies & run
pnpm install
pnpm run dev

Deployment

  • The database schema is managed by the API, in src/main/sqldelight/...

    • Migrations are executed by FlywayMigrate.kt
    • When you change the schema locally, you'll need to run ./gradlew runFlywayMigrate yourself.
    • This runs automatically on deployment, as a result of fly.io's RELEASE_COMMAND=1 configuration.
  • Object Storage is hosted through Tigris

    • It's a public bucket with CORS enabled, so that preview builds (on subdomains) can also use it
    • This is configured in the S3_* environment variables