No description
  • JavaScript 83.3%
  • Go 13.7%
  • templ 1.9%
  • CSS 1.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
onlyati 22c3f38313
All checks were successful
ci/woodpecker/push/change_log Pipeline was successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/cron/auto_merge Pipeline was successful
ci/woodpecker/cron/release Pipeline was successful
ci/woodpecker/tag/release Pipeline was successful
fix: Cap the chapter sidebar height with inner scroll, add a progress meter and scroll to top on chapter change in the reading view and admin editor (#44)
Reviewed-on: #44
2026-10-03 20:42:20 +00:00
docs fix: Cap the chapter sidebar height with inner scroll, add a progress meter and scroll to top on chapter change in the reading view and admin editor (#44) 2026-10-03 20:42:20 +00:00
internal fix: Cap the chapter sidebar height with inner scroll, add a progress meter and scroll to top on chapter change in the reading view and admin editor (#44) 2026-10-03 20:42:20 +00:00
test fix: Add Swagger UI and profile page, fix CSRF on plain forms and textarea resize 2026-09-12 13:10:14 +02:00
.gitignore feat: Add test file to testing OIDC 2026-09-12 16:04:48 +02:00
.goreleaser.yaml ci: Fit goreleaser config to the learn_it project 2026-09-12 01:28:24 +02:00
.markdownlint.json feat: Implement basic description 2026-09-12 00:54:37 +02:00
.prettierrc.json feat: Implement basic description 2026-09-12 00:54:37 +02:00
.sqruff feat: Add initial goose migration for the docs/db.md schema, verified with sqruff 2026-09-12 03:35:39 +02:00
CLAUDE.md feat: Rework admin UI (#41) 2026-10-03 11:44:03 +00:00
Containerfile maint: Update gcr.io/distroless/static-debian13:nonroot Docker digest to 2293b36 #17 2026-09-14 03:12:29 +00:00
go.mod maint: Update module modernc.org/sqlite to v1.60.1 #33 2026-09-29 15:12:38 +00:00
go.sum feat: Add URL for vouchers (#34) 2026-10-01 09:41:30 +00:00
main.go feat: Add app bootstrap, auth providers, DB migration runner, and healthz 2026-09-12 12:34:57 +02:00
README.md docs: Add project README 2026-09-12 21:45:24 +02:00
renovate.json ci: Add renovate.json 2026-09-12 19:07:46 +02:00
sqlc.yaml feat: Add sqlc/oapi-codegen scaffolding, web routes doc, and static assets 2026-09-12 12:28:42 +02:00

Learn IT

Learn IT is a personal learning platform to organize, create and share IT learning content. It lets an administrator write lessons made of markdown chapters, and lets students subscribe to lessons and track their progress chapter by chapter.

Features

  • Single, statically linked Go binary. No external runtime dependencies, no separate frontend build step.
  • Server rendered HTMX frontend styled after the GNOME Human Interface Guidelines, with minimal JavaScript.
  • A REST API under /api/, built contract first from an OpenAPI 3.1 spec, with a hosted Swagger UI.
  • SQLite storage through a pure Go driver, so the binary stays CGO free. Schema migrations run automatically at startup, with a backup taken before each migration.
  • Login through an external OIDC provider (for example Authelia), or a mock login page for local development. Two Authelia groups control access: learn_it_admin and learn_it_member.
  • Image uploads for lesson chapters through simple drag and drop.

Requirements

  • Go (see go.mod for the exact version).
  • templ for generating the frontend templates, and golangci-lint for linting. Both are installed with mise use -g templ@latest and mise use -g golangci-lint@latest.

Building

templ generate
CGO_ENABLED=0 go build .

The build must run with CGO_ENABLED=0 to keep the binary statically linked. You can check this afterward with file learn-it (it should say "statically linked") or ldd learn-it (it should say "not a dynamic executable").

Running

The binary takes a subcommand:

  • learn-it serve starts the web server.
  • learn-it check calls the running server's /healthz endpoint and exits 0 or 1. This is meant to be used as a container health check.

All configuration is supplied through environment variables, each prefixed with LEARN_IT_. The main ones are:

Variable Description
LEARN_IT_LISTEN_ADDR Address to listen on. Defaults to :8080.
LEARN_IT_DATA_DIR Directory for the database and uploaded images. Required.
LEARN_IT_AUTH_MODE Either oidc or mock.
LEARN_IT_MOCK_AUTH_FILE Path to a fixture file of mock users, used when LEARN_IT_AUTH_MODE=mock.
LEARN_IT_OIDC_ISSUER_URL Base URL of the OIDC provider, used when LEARN_IT_AUTH_MODE=oidc.
LEARN_IT_OIDC_CLIENT_ID OIDC client ID.
LEARN_IT_OIDC_CLIENT_SECRET OIDC client secret.
LEARN_IT_OIDC_REDIRECT_URL The app's own /oidc/callback URL.

For local development, run with LEARN_IT_AUTH_MODE=mock and point LEARN_IT_MOCK_AUTH_FILE at test/mockauth.json. This gives you a login page listing a few fixture users, so you do not need a real identity provider to try the app out.

Deployment

The project ships a Containerfile and is meant to run as a container. On a systemd based host with Podman, it can be run as a Quadlet unit, for example:

[Unit]
Description=Learn IT service
StartLimitBurst=5
StartLimitIntervalSec=90

[Container]
# Base options
Image=localhost/learn-it:latest

# Storage options
Volume=learn-it.volume:/data

# Network options
PublishPort=127.0.0.1:9000:9000

# Environment options
Environment="LEARN_IT_OIDC_CLIENT_ID=<your-oidc-client-id>"
Environment="LEARN_IT_OIDC_CLIENT_SECRET=<your-oidc-client-secret>"
Environment="LEARN_IT_OIDC_ISSUER_URL=https://your-authelia-host"

# Healthcheck options
HealthCmd=[ "learn-it", "check" ]
HealthInterval=30s
HealthRetries=10
HealthStartPeriod=15s
HealthTimeout=15s

[Service]
Restart=on-failure
RestartSec=2

Replace the OIDC values with your own, and make sure a learn-it.volume Podman volume exists to hold /data (the SQLite database and uploaded images) between container restarts.

Documentation

More detailed design notes live under docs/:

  • docs/api.md, the REST API design.
  • docs/web.md, the HTMX web routes.
  • docs/db.md, the database schema.
  • docs/editor.md, the lesson and chapter editor.
  • docs/migrations.md, how schema migrations and backups work.

CLAUDE.md in the repository root has the full architecture and styling guide for the project.

License

GPL 3.0.