- PHP 46.8%
- Svelte 27%
- TypeScript 22.2%
- Shell 2.3%
- JavaScript 0.8%
- Other 0.8%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
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). |
||
| .claude | ||
| .forgejo | ||
| .githooks | ||
| backend | ||
| docker/postgres-init | ||
| frontend | ||
| release | ||
| .editorconfig | ||
| .gitignore | ||
| .releaserc.json | ||
| ci-local.sh | ||
| CLAUDE.md | ||
| docker-compose.prod.yml | ||
| docker-compose.yml | ||
| README.md | ||
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 withwrite: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 thedokployservice indokploy-network(docker exec docker_dind nslookup dokploy 127.0.0.11); optional – without it deploy by hand in Dokploy.
- Runner (
/opt/forgejo-runneron the Dokploy server): forgejo-runner with thedockerlabel and a Docker-in-Docker daemon (the image job uses the Docker CLI). The DinD container must be attached to the externaldokploy-networkso 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 forgit.nestplan.cz(or public packages).