- JavaScript 83.3%
- Go 13.7%
- templ 1.9%
- CSS 1.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| docs | ||
| internal | ||
| test | ||
| .gitignore | ||
| .goreleaser.yaml | ||
| .markdownlint.json | ||
| .prettierrc.json | ||
| .sqruff | ||
| CLAUDE.md | ||
| Containerfile | ||
| go.mod | ||
| go.sum | ||
| main.go | ||
| README.md | ||
| renovate.json | ||
| sqlc.yaml | ||
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_adminandlearn_it_member. - Image uploads for lesson chapters through simple drag and drop.
Requirements
- Go (see
go.modfor the exact version). templfor generating the frontend templates, andgolangci-lintfor linting. Both are installed withmise use -g templ@latestandmise 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 servestarts the web server.learn-it checkcalls the running server's/healthzendpoint 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.