No description
  • PHP 46.8%
  • Svelte 27%
  • TypeScript 22.2%
  • Shell 2.3%
  • JavaScript 0.8%
  • Other 0.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Tomáš Lipenský 8e803e65cb
All checks were successful
CI / backend (push) Successful in 2m8s
CI / commits (push) Successful in 1m16s
CI / frontend (push) Successful in 5m15s
CI / release (push) Successful in 1m2s
CI / images (push) Successful in 2m52s
fix(deploy): patch base image CVEs and update laravel framework
Upgrade Alpine packages in both images (busybox CVE-2026-140044, openssl
CVE-2026-107494), always pull fresh base images when building in CI and
update laravel/framework to 13.45 (CVE-2026-142610).
2026-12-04 21:51:39 +01:00
.claude docs: wait for the running pipeline before pushing again 2026-10-03 22:03:50 +02:00
.forgejo fix(deploy): patch base image CVEs and update laravel framework 2026-12-04 21:51:39 +01:00
.githooks ci: check commit messages with commitlint 2026-10-03 21:26:10 +02:00
backend fix(deploy): patch base image CVEs and update laravel framework 2026-12-04 21:51:39 +01:00
docker/postgres-init build: add Docker images and compose files for local and production use 2026-10-03 19:12:18 +02:00
frontend fix(deploy): patch base image CVEs and update laravel framework 2026-12-04 21:51:39 +01:00
release fix(deps): update dependencies and fix audited vulnerabilities 2026-11-05 16:41:43 +01:00
.editorconfig chore: set up the repository with project notes and workflow skills 2026-10-03 19:06:19 +02:00
.gitignore chore: ignore the design export and record the feature workflow 2026-10-03 21:54:21 +02:00
.releaserc.json ci: check, release and deploy with Forgejo Actions 2026-10-03 19:13:25 +02:00
ci-local.sh ci: check commit messages with commitlint 2026-10-03 21:26:10 +02:00
CLAUDE.md docs: wait for the running pipeline before pushing again 2026-10-03 22:03:50 +02:00
docker-compose.prod.yml build: add Docker images and compose files for local and production use 2026-10-03 19:12:18 +02:00
docker-compose.yml build: add Docker images and compose files for local and production use 2026-10-03 19:12:18 +02:00
README.md ci: check commit messages with commitlint 2026-10-03 21:26:10 +02:00

Domácí knihovna

Web app for a personal home library – owned books, a wishlist, series and a "wheel of fortune" that picks the next book to read. Planning and design live in Notion (project Domácí knihovna – webová aplikace).

Part Stack Production
backend/ Laravel 13 REST API (/api/v1), Sanctum, PostgreSQL, Scramble https://library-api.nestplan.cz
frontend/ Svelte 5 + SvelteKit SPA, Tailwind CSS https://library.nestplan.cz

Development

Once per clone, enable the commit message check (Conventional Commits, see Releasing):

npm ci --prefix release
git config core.hooksPath .githooks
docker compose up -d db                     # PostgreSQL on localhost:5432 (+ library_test)

cd backend
composer install
cp .env.example .env && php artisan key:generate
php artisan migrate
php artisan serve                           # http://localhost:8000

cd frontend
npm install
npm run dev                                 # http://localhost:5173

The whole stack built from the production images: docker compose up -d --build (app on http://localhost:8080, API on http://localhost:8000).

The API is documented code-first: Scramble generates backend/openapi.json from the Laravel code (docs UI on http://localhost:8000/docs/api while developing) and the frontend generates its types from it. After changing an endpoint:

cd backend && composer api:export
cd frontend && npm run api:types

Before pushing, run the CI gates locally – the same Docker images and scripts as Forgejo Actions, on the working tree (backend, frontend and the messages of unpushed commits, in parallel):

./ci-local.sh            # or ./ci-local.sh backend|frontend|commits

The individual checks on the host:

cd backend && composer lint && composer analyse && php artisan test
cd frontend && npm run lint && npm run check && npm test && npm run build

Releasing and deployment

Commits follow Conventional Commits. Every push to main runs the checks; if they pass, semantic-release picks the next version from the commits since the last tag (feat → minor, fix/perf → patch, breaking change → major), tags vX.Y.Z and creates the Forgejo release. CI then builds both images, pushes them to the Forgejo container registry as X.Y.Z and latest, and triggers the Dokploy deploy, which runs docker-compose.prod.yml. The backend migrates the database on start.

GET https://library-api.nestplan.cz/api/v1/health reports the deployed version. To redeploy without a release (after changing Dokploy's environment, or to roll back once APP_VERSION is set there), run the Deploy workflow by hand in Forgejo Actions.

One-time setup

  • Forgejo Actions secrets (repository → Settings → Actions → Secrets):
    • PACKAGES_TOKEN – access token with write:package, used to push images,
    • DOKPLOY_WEBHOOK_URL – deploy webhook of the Dokploy compose service as the job container sees it: http://10.0.1.5:3000/api/deploy/compose/<token>, where 10.0.1.5 is the virtual IP of the dokploy service in dokploy-network (docker exec docker_dind nslookup dokploy 127.0.0.11); optional – without it deploy by hand in Dokploy.
  • Runner (/opt/forgejo-runner on the Dokploy server): forgejo-runner with the docker label and a Docker-in-Docker daemon (the image job uses the Docker CLI). The DinD container must be attached to the external dokploy-network so jobs can reach Dokploy; names don't resolve inside DinD, hence the IP in the webhook.
  • User accounts: there is no registration. Create an account in the backend container (Dokploy → the compose service → Terminal → backend, /bin/sh – the image has no bash; the shell starts in /, the app is in /var/www/html): cd /var/www/html && php artisan user:create --name="…" --email="…". Pass the options – the interactive prompts don't render well in Dokploy's terminal. It prints a one-time link (valid 60 minutes) where the user sets the password; php artisan user:password-link <email> prints a new one.
  • Dokploy: a Docker Compose service from this repository with compose path docker-compose.prod.yml, the environment variables and domains listed at the top of that file, Auto Deploy turned off (CI deploys once the images exist), and registry credentials for git.nestplan.cz (or public packages).