Ryanhub - file viewer
filename: README.md
branch: main
back to repo
tiny php api router and services

run locally:
docker compose up -d --build

quick endpoints:
/api/ -> info page
/api/health/ping -> simple health checks (routing, db, auth)
/api/auth/challenge -> get proof-of-work challenge
/api/auth/submit -> submit to receive api key
/api/<service>/<endpoint> -> runs services/<service>/<endpoint>.php (use Authorization: Bearer <key>)

config:
create config/.env (DB_HOST, DB_NAME, DB_USER, DB_PASS)

db:
sql/init.sql seeds schema (api_keys, pow_challenges)

to build out APIs, create a new directory under services and see examples for endpoint implementations

to build admin features, implement directly in html/admin and be sure to require_admin() first thing on every page