Kitten

Technical Manual sections

This is a map of the Kitten repository. Use it to find the code for a subsystem, then read the section of this manual that covers it. For what Kitten writes where on disk, see Data on disk.

PathWhat it is
install, build, package, deployScripts that install Kitten, build the distribution in dist/, archive it in packages/, and publish a signed package to the distribution server.
build-templates/Files the build copies into the distribution: the launcher (kitten), the Kitten Process Manager, the distribution’s package.json, the Prism theme, and the runtime checksums.
src/entry/The three entry points the build bundles: main.ts (the Kitten bundle), loader.js (the loader bundle), and update-guard.ts (the update guard).
src/cli/The command-line interface, with one file per command in commands/ (and the files that kitten init copies in commands/init/).
src/Server.tsThe Kitten Server.
src/middleware/Polka middleware, added in the order in index.ts.
src/Routes.ts, src/Files.ts, src/routes/, src/lib/routeFiles.ts, src/lib/routeTable.tsRoutes from files, the route classes, and the order and collisions of route patterns.
src/routes/lib/routeHandler.ts, src/lib/router.ts, src/lib/body.tsThe handler Kitten registers for each route, the router object that main.script.js receives, and request body parsing.
src/lib/html.ts, markup.ts, markdown.ts, markdownModule.ts, loader.tsRendering and module loading.
src/lib/KittenComponent.ts, KittenPage.tsStateful components and live pages.
src/lib/globals.tsBuilds the global kitten object. (src/types/globals.d.ts declares it.)
src/lib/paths.tsThe paths of Kitten’s own files on disk. (Globals.initialise() in src/lib/globals.ts adds the paths of the app being served.)
src/AppDatabase.ts, src/InternalDatabase.ts, src/GlobalInternalDatabase.ts, src/migrations/Databases and data migrations.
src/Sessions.ts, src/lib/storeOnUse.ts, src/lib/signIn.ts, src/lib/signInChallenge.ts, crypto.ts, keyStore.ts, KittenMoji.tsSessions, sign-in, and cryptography.
src/Uploads.ts, src/lib/uploadLimits.ts, src/lib/serveFile.tsUploads.
src/ServerError.ts, src/lib/log.tsError pages and sectioned logs.
src/REPL.tsThe interactive shell.
src/lib/deploy.ts, src/AppRepository.tsDeployment as a systemd service, and the deployed app’s git working copy.
src/AutomaticUpdates.ts, src/lib/KittenPackage.ts, src/lib/applyUpdate.ts, and the src/lib/update*.ts filesUpdates.
src/lib/components/Built-in components (copyButton, toast, and CopyButton).
lib/Client-side libraries that the build copies or bundles into /🐱/library/: our fork of htmx 2 and its WebSocket extension, our copy of the idiomorph htmx extension, kitten-1.js, kitten-alpine-1.js, and kitten-hot-reload-1.js.
src/lib/check/The kitten check command’s project reader, probe engine, report, fixes, and one module per check in checks/.
web/Kitten’s internal web app (the /🐱/ and /šŸ’•/ routes).
src/types/, sync-types.jsKitten’s types, and the script that syncs them to the @small-web/kitten-types package.
update-version.js, sign-package.js, generate-signing-key.js, contributors.jsBuild and release helpers.
tests/Unit, regression, and end-to-end tests, a start-up benchmark, and the automatic updates rehearsal.
examples/Example apps. The end-to-end suite loads the ones listed in tests/end-to-end/examples.spec.ts.

Like this? Fund us!

Small Technology Foundation is a tiny, independent not-for-profit.

We exist in part thanks to patronage by people like you. If you share our vision and want to support our work, please become a patron or donate to us today and help us continue to exist.