{"id":18081922,"url":"https://github.com/vindarel/cl-cookieweb","last_synced_at":"2025-04-05T22:29:13.478Z","repository":{"id":38363877,"uuid":"371196846","full_name":"vindarel/cl-cookieweb","owner":"vindarel","description":"Cookiecutter template to start a web project.","archived":false,"fork":false,"pushed_at":"2025-04-03T11:17:23.000Z","size":103,"stargazers_count":39,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-03T12:25:58.101Z","etag":null,"topics":["common-lisp","cookiecutter"],"latest_commit_sha":null,"homepage":"","language":"Common Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vindarel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-26T23:54:50.000Z","updated_at":"2025-04-03T11:17:27.000Z","dependencies_parsed_at":"2022-08-25T04:51:33.653Z","dependency_job_id":null,"html_url":"https://github.com/vindarel/cl-cookieweb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vindarel%2Fcl-cookieweb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vindarel%2Fcl-cookieweb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vindarel%2Fcl-cookieweb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vindarel%2Fcl-cookieweb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vindarel","download_url":"https://codeload.github.com/vindarel/cl-cookieweb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411241,"owners_count":20934650,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["common-lisp","cookiecutter"],"created_at":"2024-10-31T13:17:15.810Z","updated_at":"2025-04-05T22:29:13.471Z","avatar_url":"https://github.com/vindarel.png","language":"Common Lisp","readme":"cl-cookieweb\n============\n\nA [cookiecutter](https://github.com/audreyr/cookiecutter) web template for Common Lisp.\n\nProvides a working toy web app with the Hunchentoot web server, easy-routes, Djula templates, styled with Bulma, based on SQLite, with migrations and an example table definition.\n\nFeaturing:\n\n- Recipe to run the project from sources or to build a binary, choosing your Lisp implementation\n- Test suite using [Fiveam](https://common-lisp.net/project/fiveam/docs/)\n- DB:\n  - creation of a DB (SQLite by default. That is easily configurable)\n  - a simple models.lisp with a Product table definition with the Mito ORM (see [Cookbook/databases#the Mito ORM](https://lispcookbook.github.io/cl-cookbook/databases.html#the-mito-orm-and-sxql))\n  - migrations (built-in Mito feature)\n- Djula templates\n  - showing inheritance and custom filters\n  - styled with [Bulma](https://github.com/jgthms/bulma)\n  - showing a default dashboard\n- JavaScript:\n  - load static assets with a dummy JS file.\n- run the project:\n  - from sources\n    - CLI args parsing (port, help)\n    - port is also taken from an environment variable\n  - build a self-contained binary\n    - (xxx: static assets not included?)\n    - with Deploy: ship shared libraries, run on another machine (rely on libssl of the host system). You then have to ship the `bin/` folder.\n  - Roswell integration to run the app as a script and to build, install and share binaries.\n- Systemd example\n\nBased on [cl-cookieproject](https://github.com/vindarel/cl-cookieproject): a ready-to-use project template.\n\nMight eventually appear:\n\n- access roles\n- login and logout\n- JSON API example\n- Vue.js integration\n- HTMX example\n- ~~ISSR example~~ [view here](https://github.com/vindarel/ISSR-productlist/)\n- ~~SystemD example~~ OK\n\n![](cookieweb.png)\n\nUsage\n-----\n\nCreate a new project. You'll be prompted to provide some basic\ninformation about your new project, which will then be auto-generated\nin the current working directory:\n\n```bash\n$ pip install cookiecutter\n$ cookiecutter https://github.com/vindarel/cl-cookieweb\nproject_name [cookie-web-project]:\nrepo_name [cookie-web-project]:\ndescription []: A test project\nversion [0.0.1]:\nyear [1984]:\nauthor [CL User]: me\nemail [me@mail.com]:\nusername [mme]:\nbranch [master]:\nremote [origin]:\nInitialised empty Git repository in /home/vince/bacasable/lisp-projects/cookie-web-project/.git/\nSwitched to a new branch 'master'\n```\n\nRun it straight away:\n\n```bash\n$ cd cookie-web-project\n$ make run\nrlwrap sbcl --load run.lisp\nThis is SBCL 2.0.10, an implementation of ANSI Common Lisp.\nMore information about SBCL is available at \u003chttp://www.sbcl.org/\u003e.\n\nSBCL is free software, provided as is, with absolutely no warranty.\nIt is mostly in the public domain; some portions are provided under\nBSD-style licenses.  See the CREDITS and COPYING files in the\ndistribution for more information.\nTo load \"cffi\":\n  Load 1 ASDF system:\n    cffi\n; Loading \"cffi\"\n.\nTo load \"cookie-web-project\":\n  Load 1 ASDF system:\n    cookie-web-project\n; Loading \"cookie-web-project\"\ncookie-web-project version 0.0.1\nApplication started on port 4242.\n*\n```\n\nYou can see the `Hello` from the `main` function, and we are given a Lisp REPL.\n\nBuild an executable:\n\n```bash\n$ make build\n[…]\n; Loading \"cookie-web-project\"\n..................................................\n[package cookie-web-project/utils]...............\n[package cookie-web-project/models]..............\n[package cookie-web-project/web].................\n[package cookie-web-project]...\n\n#P\"/home/vindarel/projects/cl-cookieweb/cookie-web-project/bin/cookie-web-project\"\n ==\u003e Running load hooks.\n ==\u003e Gathering system information.\n   -\u003e Will load the following foreign libs on boot:\n      (#\u003cDEPLOY:LIBRARY LIBSSL\u003e)\n ==\u003e Deploying files to /home/vindarel/projects/cl-cookieweb/cookie-web-project/bin/\n   -\u003e Copying library #\u003cLIBRARY LIBZ\u003e\n ==\u003e Running build hooks.\n   -\u003e Closing foreign library #\u003cLIBRARY LIBSSL\u003e.\n ==\u003e Dumping image to /home/vindarel/projects/cl-cookieweb/cookie-web-project/bin/cookie-web-project\n[undoing binding stack and other enclosing state... done]\n[defragmenting immobile space... 2002+33897+3559+3148+28073+31776 objects... done]\n[saving current Lisp image into /home/vindarel/projects/cl-cookieweb/cookie-web-project/bin/cookie-web-project:\nwriting 0 bytes from the read-only space at 0x20000000\ncompressed 0 bytes into 8 at level -1\nwriting 1648 bytes from the static space at 0x20100000\ncompressed 32768 bytes into 582 at level -1\nwriting 95027200 bytes from the dynamic space at 0x1000000000\ncompressed 95027200 bytes into 18359087 at level -1\nwriting 3043328 bytes from the immobile space at 0x20300000\ncompressed 3047424 bytes into 795041 at level -1\nwriting 22947392 bytes from the immobile space at 0x21b00000\ncompressed 22970368 bytes into 6758085 at level -1\ndone]\n```\n\nA `bin/` directory is created with shared .so libraries:\n\n```\n$ ls bin\ncookie-web-project  libz.so\n```\n(and when required, you'll find libmagic.so, libosicat.so etc)\n\nRun the binary from the `bin/` folder. We can see that Deploy handles\nloading those shared libraries.\n\n```\n$ ./bin/cookie-web-project\n ==\u003e Performing warm boot.\n   -\u003e Runtime directory is /home/vince/projets/cl-cookieweb/cookie-web-project/bin/\n   -\u003e Resource directory is /home/vince/projets/cl-cookieweb/cookie-web-project/bin/\n ==\u003e Running boot hooks.\n ==\u003e Reloading foreign libraries.\n   -\u003e Loading foreign library #\u003cLIBRARY LIBSSL\u003e.\n ==\u003e Launching application.\n […]\ncookie-web-project version 0.0.1\nLoading config file config.lisp…\nSkipping config file.Starting Hunchentoot on port 4545…\nApplication started on port 4545.\n```\n\nYou can access your app on http://localhost:4545\n\n### Systemd\n\nCreate a new file in `/etc/systemd/system/webcookie.service`:\n\n```\n[Unit]\nDescription=Lisp web project skeleton\n\n[Service]\nWorkingDirectory=/home/path/to/cookie-web-project/  # \u003c- directory\nExecStart=/home/path/to/cookie-web-project/bin/cookie-web-project  # \u003c- binary\nType=simple\nRestart=on-failure\nRestartSec=3\n[Install]\nWantedBy=network.target\n```\n\n\u003c!-- WorkingDirectory=/home/vince/projets/cl-cookieweb/cookie-lisp-project/ --\u003e\n\u003c!-- ExecStart=/home/vince/projets/cl-cookieweb/cookie-lisp-project/bin/cookie-lisp-project --\u003e\n\nCommands:\n\n    sudo systemctl start webcookie.service\n\nand also `stop` and `status`.\n\nTo see logs:\n\n    journalctl -u webcookie.service\n\nTo start the app on (re)boot:\n\n    sudo systemctl enable webcookie.service\n\nIf you want to run the app from sources, you can use the command\n`/usr/bin/make run`, but tweak `run.lisp` so that it calls `(run)`\ninstead of `(main)`, so that the server thread is placed on the\nforeground. Otherwise, the Lisp process quits instantly and your\nprocess is not started.\n\n\n## cookiecutter options\n\nYou can use command line options: https://cookiecutter.readthedocs.io/en/1.7.2/advanced/cli_options.html\n\n- `--no-input`: do not prompt for parameters and only use cookiecutter.json file content\n- ` --replay`: do not prompt for parameters and only use information entered previously\n- ` -f, --overwrite-if-exists`: overwrite the contents of the output directory if it already exists\n- ` -s, --skip-if-file-exists`: skip the files in the corresponding directories if they already exist\n- ` -o, --output-dir`: where to output the generated project dir into\n- ` --config-file`: user configuration file\n\n# See also\n\nOther demos and skeletons:\n\n- [Feather](https://hg.sr.ht/~wnortje/feather), a template for web\n  application development, shows a functioning Hello World app\n  with an HTML page, a JSON API, a passing test suite, a Postgres DB\n  and DB migrations. Uses Qlot, Buildapp, SystemD for deployment.\n  - =\u003e probably a bit more serious as of yet.\n- [lisp-web-template-productlist](https://github.com/vindarel/lisp-web-template-productlist),\n  a simpler example (no DB models and it is not a project template, only a working example).\n- [lisp-web-live-reload-example](https://github.com/vindarel/lisp-web-live-reload-example/) -\n  a toy project to show how to interact with a running web app.\n\nResources:\n\n- NEW as of 2025: [Web Apps in Lisp: Know-How](https://web-apps-in-lisp.github.io/)\n- The CL Cookbook: https://lispcookbook.github.io/cl-cookbook/web.html\n- libraries: https://github.com/CodyReichert/awesome-cl\n\nApps:\n\n- [ABStock](https://github.com/vindarel/ABStock) - a products catalogue, made for bookshops\n- [OpenBookStore](https://github.com/OpenBookStore/openbookstore) (WIP) - books management software. With user access roles, user login, a Vue.js page, API endpoints…\n\n# CHANGELOG\n\n- 2022/06: build with Deploy (handle shared libraries). Make ASDF not crash when running the binary on a system with an old configuration (it's a self-contained binary dude!).\n  - \u003c2025-04-03\u003e this was because we didn't reference the DB module in the .asd. Added `:dbd-sqlite3`, see .asd for the other drivers.\n  - added Systemd service example.\n- 2021/12: load a `config.lisp` init file before web startup. Same could be done with a post-init file.\n- init.\n\n---\n\nWTFPL\n\nhttps://github.com/sponsors/vindarel/\n\n\u003ca href='https://ko-fi.com/K3K828W0V' target='_blank'\u003e\u003cimg height='36' style='border:0px;height:36px;' src='https://cdn.ko-fi.com/cdn/kofi2.png?v=2' border='0' alt='buy me a coffee!' title='Is that useful and do you want to see more? Buy Me a Coffee, it is useful, no big income here!' /\u003e\u003c/a\u003e\n","funding_links":["https://github.com/sponsors/vindarel/","https://ko-fi.com/K3K828W0V'"],"categories":["Interfaces to other package managers"],"sub_categories":["Web project skeletons and generators"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvindarel%2Fcl-cookieweb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvindarel%2Fcl-cookieweb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvindarel%2Fcl-cookieweb/lists"}