# Examples > small toku projects that toku init --example creates, each demonstrating one capability with its files shown in full This file is one tab of the santoku reference, at https://santoku.dev/examples/llms.txt. https://santoku.dev/examples is the same tab in a browser, https://santoku.dev/llms.txt indexes every tab, and https://santoku.dev/llms-small.txt summarizes them all on one page. Each example is a small toku project that santoku-make ships and toku init --example creates. Each one demonstrates one capability and names the rocks it exercises. - toku init --example NAME my-project creates the project from the example NAME, and toku init with no --example creates the lib example. - --example needs santoku-cli 8.0.0 and santoku-make 13.0.0. - An unknown name lists every example with its summary and fails before init writes anything. - The site build runs the real toku init for every example, and this page shows the files it writes. Each rock's tab links the examples that use it. - santoku-make's suite runs every example's toku test before a release. - The project initializer adds --license, --copyright and --comments to each example: https://santoku.dev/santoku-cli/init ## Examples ### A JSON API An OpenResty server with no frontend, over a server-side sqlite database. ```text toku init --example api my-api ``` Tags: api, server, sqlite. Rocks: santoku-resty, santoku-sqlite, santoku-migrate, santoku-http. Files: - https://santoku.dev/santoku-cli/init/examples/api/.gitignore - https://santoku.dev/santoku-cli/init/examples/api/make.lua - https://santoku.dev/santoku-cli/init/examples/api/res/server/migrations/0.0.1.sql - https://santoku.dev/santoku-cli/init/examples/api/res/server/nginx.mustache - https://santoku.dev/santoku-cli/init/examples/api/server/lib/my_api/migrations.tk.lua - https://santoku.dev/santoku-cli/init/examples/api/server/lib/my_api/store.lua - https://santoku.dev/santoku-cli/init/examples/api/server/lib/my_api/web/db.lua - https://santoku.dev/santoku-cli/init/examples/api/server/lib/my_api/web/init.lua - https://santoku.dev/santoku-cli/init/examples/api/server/lib/my_api/web/init_worker.lua - https://santoku.dev/santoku-cli/init/examples/api/server/lib/my_api/web/items.lua - https://santoku.dev/santoku-cli/init/examples/api/server/lib/my_api/web/status.lua - https://santoku.dev/santoku-cli/init/examples/api/server/nginx.tk.conf - https://santoku.dev/santoku-cli/init/examples/api/server/test/spec/db_file.lua - https://santoku.dev/santoku-cli/init/examples/api/server/test/spec/my_api.lua - https://santoku.dev/santoku-cli/init/examples/api/server/test/spec/status.lua ### A browser script A command that loads a page in headless Chromium, reads its title and links, and saves a screenshot. ```text toku init --example browser my-browser ``` Tags: lib, cli, browser. Rocks: santoku-cdp. Files: - https://santoku.dev/santoku-cli/init/examples/browser/.gitignore - https://santoku.dev/santoku-cli/init/examples/browser/bin/my-browser.lua - https://santoku.dev/santoku-cli/init/examples/browser/lib/my_browser.lua - https://santoku.dev/santoku-cli/init/examples/browser/make.lua - https://santoku.dev/santoku-cli/init/examples/browser/test/spec/my_browser.browser.lua ### A text classifier A command that trains a kernel ridge text classifier on a small built-in dataset and labels new text. ```text toku init --example classify my-classify ``` Tags: lib, cli, learn, classify. Rocks: santoku-learn, santoku-matrix. Files: - https://santoku.dev/santoku-cli/init/examples/classify/.gitignore - https://santoku.dev/santoku-cli/init/examples/classify/bin/my-classify.lua - https://santoku.dev/santoku-cli/init/examples/classify/lib/my_classify.lua - https://santoku.dev/santoku-cli/init/examples/classify/lib/my_classify/data.lua - https://santoku.dev/santoku-cli/init/examples/classify/make.lua - https://santoku.dev/santoku-cli/init/examples/classify/test/spec/my_classify.lua ### A library with a command A Lua rock with a C module, a sqlite store behind migrations, and an argparse command. ```text toku init --example lib my-lib ``` Tags: lib, cli, sqlite, c. Rocks: santoku, santoku-sqlite, santoku-migrate, santoku-make. Files: - https://santoku.dev/santoku-cli/init/examples/lib/.gitignore - https://santoku.dev/santoku-cli/init/examples/lib/bin/my-lib.lua - https://santoku.dev/santoku-cli/init/examples/lib/lib/my_lib.lua - https://santoku.dev/santoku-cli/init/examples/lib/lib/my_lib/capi.c - https://santoku.dev/santoku-cli/init/examples/lib/lib/my_lib/migrations.tk.lua - https://santoku.dev/santoku-cli/init/examples/lib/lib/my_lib/store.lua - https://santoku.dev/santoku-cli/init/examples/lib/make.lua - https://santoku.dev/santoku-cli/init/examples/lib/res/lib/migrations/0.0.1.sql - https://santoku.dev/santoku-cli/init/examples/lib/test/spec/my_lib.lua ### An offline web app The web app with its data in sqlite in the browser, synced to the server, and a service worker so it boots offline. ```text toku init --example pwa my-app ``` Tags: web, wasm, pwa, offline, sqlite, sync. Rocks: santoku-web, santoku-sqlite, santoku-migrate, santoku-resty, santoku-cdp. Files: - https://santoku.dev/santoku-cli/init/examples/pwa/.gitignore - https://santoku.dev/santoku-cli/init/examples/pwa/client/bin/bundle.lua - https://santoku.dev/santoku-cli/init/examples/pwa/client/lib/my_app/async.lua - https://santoku.dev/santoku-cli/init/examples/pwa/client/lib/my_app/core.lua - https://santoku.dev/santoku-cli/init/examples/pwa/client/lib/my_app/db.lua - https://santoku.dev/santoku-cli/init/examples/pwa/client/lib/my_app/main.lua - https://santoku.dev/santoku-cli/init/examples/pwa/client/lib/my_app/migrations.tk.lua - https://santoku.dev/santoku-cli/init/examples/pwa/client/lib/my_app/store.lua - https://santoku.dev/santoku-cli/init/examples/pwa/client/lib/my_app/sync.lua - https://santoku.dev/santoku-cli/init/examples/pwa/client/lib/my_app/sync_view.lua - https://santoku.dev/santoku-cli/init/examples/pwa/client/lib/my_app/templates.tk.lua - https://santoku.dev/santoku-cli/init/examples/pwa/client/lib/my_app/todos.lua - https://santoku.dev/santoku-cli/init/examples/pwa/client/static/index.html - https://santoku.dev/santoku-cli/init/examples/pwa/client/static/serviceworker.tk.js - https://santoku.dev/santoku-cli/init/examples/pwa/client/test/spec/my_app.lua - https://santoku.dev/santoku-cli/init/examples/pwa/client/test/spec/store.lua - https://santoku.dev/santoku-cli/init/examples/pwa/make.common.lua - https://santoku.dev/santoku-cli/init/examples/pwa/make.lua - https://santoku.dev/santoku-cli/init/examples/pwa/make.prod.lua - https://santoku.dev/santoku-cli/init/examples/pwa/res/client/migrations/0.0.1.sql - https://santoku.dev/santoku-cli/init/examples/pwa/res/client/partials/settings.mustache - https://santoku.dev/santoku-cli/init/examples/pwa/res/client/partials/todo_settings.mustache - https://santoku.dev/santoku-cli/init/examples/pwa/res/client/partials/toolbar.mustache - https://santoku.dev/santoku-cli/init/examples/pwa/res/client/todo-app.html - https://santoku.dev/santoku-cli/init/examples/pwa/res/server/migrations/0.0.1.sql - https://santoku.dev/santoku-cli/init/examples/pwa/res/server/nginx.mustache - https://santoku.dev/santoku-cli/init/examples/pwa/res/server/nginx/pages.mustache - https://santoku.dev/santoku-cli/init/examples/pwa/server/lib/my_app/migrations.tk.lua - https://santoku.dev/santoku-cli/init/examples/pwa/server/lib/my_app/store.lua - https://santoku.dev/santoku-cli/init/examples/pwa/server/lib/my_app/web/api.lua - https://santoku.dev/santoku-cli/init/examples/pwa/server/lib/my_app/web/db.lua - https://santoku.dev/santoku-cli/init/examples/pwa/server/lib/my_app/web/init.lua - https://santoku.dev/santoku-cli/init/examples/pwa/server/lib/my_app/web/init_worker.lua - https://santoku.dev/santoku-cli/init/examples/pwa/server/lib/my_app/web/status.lua - https://santoku.dev/santoku-cli/init/examples/pwa/server/nginx.tk.conf - https://santoku.dev/santoku-cli/init/examples/pwa/server/test/res/browser.lua - https://santoku.dev/santoku-cli/init/examples/pwa/server/test/res/shadow.lua - https://santoku.dev/santoku-cli/init/examples/pwa/server/test/spec/db_file.lua - https://santoku.dev/santoku-cli/init/examples/pwa/server/test/spec/my_app.lua - https://santoku.dev/santoku-cli/init/examples/pwa/server/test/spec/offline.browser.lua - https://santoku.dev/santoku-cli/init/examples/pwa/server/test/spec/page.browser.lua - https://santoku.dev/santoku-cli/init/examples/pwa/server/test/spec/status.lua - https://santoku.dev/santoku-cli/init/examples/pwa/server/test/spec/sync_page.browser.lua ### A command that runs under OpenResty A Lua rock whose command and specs run under OpenResty's resty CLI and fetch URLs at once. ```text toku init --example resty my-tool ``` Tags: lib, cli, resty. Rocks: santoku-resty, santoku-http. Files: - https://santoku.dev/santoku-cli/init/examples/resty/.gitignore - https://santoku.dev/santoku-cli/init/examples/resty/bin/my-tool.lua - https://santoku.dev/santoku-cli/init/examples/resty/lib/my_tool.lua - https://santoku.dev/santoku-cli/init/examples/resty/make.lua - https://santoku.dev/santoku-cli/init/examples/resty/test/spec/my_tool.resty.lua ### A full-text search command A command that indexes notes in a sqlite file and ranks them for a query with BM25. ```text toku init --example search my-search ``` Tags: lib, cli, sqlite, search. Rocks: santoku-sqlite, santoku-learn, santoku-matrix. Files: - https://santoku.dev/santoku-cli/init/examples/search/.gitignore - https://santoku.dev/santoku-cli/init/examples/search/bin/my-search.lua - https://santoku.dev/santoku-cli/init/examples/search/lib/my_search.lua - https://santoku.dev/santoku-cli/init/examples/search/make.lua - https://santoku.dev/santoku-cli/init/examples/search/test/spec/my_search.lua ### A web app A WebAssembly client and an OpenResty server in one repository, with the data in sqlite on the server. ```text toku init --example web my-app ``` Tags: web, wasm, server, sqlite. Rocks: santoku-web, santoku-resty, santoku-sqlite, santoku-migrate, santoku-cdp. Files: - https://santoku.dev/santoku-cli/init/examples/web/.gitignore - https://santoku.dev/santoku-cli/init/examples/web/client/bin/bundle.lua - https://santoku.dev/santoku-cli/init/examples/web/client/lib/my_app/async.lua - https://santoku.dev/santoku-cli/init/examples/web/client/lib/my_app/core.lua - https://santoku.dev/santoku-cli/init/examples/web/client/lib/my_app/main.lua - https://santoku.dev/santoku-cli/init/examples/web/client/lib/my_app/templates.tk.lua - https://santoku.dev/santoku-cli/init/examples/web/client/lib/my_app/todos.lua - https://santoku.dev/santoku-cli/init/examples/web/client/static/index.html - https://santoku.dev/santoku-cli/init/examples/web/make.common.lua - https://santoku.dev/santoku-cli/init/examples/web/make.lua - https://santoku.dev/santoku-cli/init/examples/web/make.prod.lua - https://santoku.dev/santoku-cli/init/examples/web/res/client/partials/settings.mustache - https://santoku.dev/santoku-cli/init/examples/web/res/client/partials/todo_settings.mustache - https://santoku.dev/santoku-cli/init/examples/web/res/client/partials/toolbar.mustache - https://santoku.dev/santoku-cli/init/examples/web/res/client/todo-app.html - https://santoku.dev/santoku-cli/init/examples/web/res/server/migrations/0.0.1.sql - https://santoku.dev/santoku-cli/init/examples/web/res/server/nginx.mustache - https://santoku.dev/santoku-cli/init/examples/web/res/server/nginx/pages.mustache - https://santoku.dev/santoku-cli/init/examples/web/server/lib/my_app/migrations.tk.lua - https://santoku.dev/santoku-cli/init/examples/web/server/lib/my_app/store.lua - https://santoku.dev/santoku-cli/init/examples/web/server/lib/my_app/web/api.lua - https://santoku.dev/santoku-cli/init/examples/web/server/lib/my_app/web/db.lua - https://santoku.dev/santoku-cli/init/examples/web/server/lib/my_app/web/init.lua - https://santoku.dev/santoku-cli/init/examples/web/server/lib/my_app/web/init_worker.lua - https://santoku.dev/santoku-cli/init/examples/web/server/lib/my_app/web/status.lua - https://santoku.dev/santoku-cli/init/examples/web/server/nginx.tk.conf - https://santoku.dev/santoku-cli/init/examples/web/server/test/res/browser.lua - https://santoku.dev/santoku-cli/init/examples/web/server/test/res/shadow.lua - https://santoku.dev/santoku-cli/init/examples/web/server/test/spec/db_file.lua - https://santoku.dev/santoku-cli/init/examples/web/server/test/spec/latest.browser.lua - https://santoku.dev/santoku-cli/init/examples/web/server/test/spec/my_app.lua - https://santoku.dev/santoku-cli/init/examples/web/server/test/spec/page.browser.lua - https://santoku.dev/santoku-cli/init/examples/web/server/test/spec/status.lua - https://santoku.dev/santoku-cli/init/examples/web/server/test/spec/store.lua ### A WebSocket echo server An OpenResty server that echoes WebSocket messages, with a spec that talks to it from a native client. ```text toku init --example websocket my-websocket ``` Tags: server, websocket. Rocks: santoku-websocket, santoku-resty, santoku-socket. Files: - https://santoku.dev/santoku-cli/init/examples/websocket/.gitignore - https://santoku.dev/santoku-cli/init/examples/websocket/make.lua - https://santoku.dev/santoku-cli/init/examples/websocket/res/server/nginx.mustache - https://santoku.dev/santoku-cli/init/examples/websocket/server/lib/my_websocket/web/echo.lua - https://santoku.dev/santoku-cli/init/examples/websocket/server/nginx.tk.conf - https://santoku.dev/santoku-cli/init/examples/websocket/server/test/spec/my_websocket.lua