diff --git a/README.org b/README.org index df796a6..13e79f2 100644 --- a/README.org +++ b/README.org @@ -1,11 +1,20 @@ #+title: Nitinol +#+options: toc:nil Nitinol is a framework for building user-malleable web applications and tools, specifically PWAs, built on top of [[https://mithril.js.org/index.html][Mithril.js]] and [[https://lips.js.org/][LIPS scheme]]. It provides all the tools necessary to make a full application stack that the user is easily able to modify; both for themselves or others, and ephemerally or persistently. -:naming: +#+begin_quote Nitinol is an alloy of Nickel and Titanium that has shape memory and superelasticity. -:end: +#+end_quote + +This README includes all the documentation you need to use Nitinol to it's fullest. +If you're not sure how to read ~org~ files, you can convert this file to Markdown with pandoc using the following command: +#+begin_src shell + pandoc -f org -t makrdown README.org +#+end_src + +#+toc: headlines 2 * Design Philosophy Nitinol is heavily inspired by Emacs in terms of extensibility and self-documentation. @@ -23,3 +32,24 @@ Nitinol seeks to address all these problems by providing a Scheme environment in - REPL inputs can be saved to a cached configuration file, which can be shared to other users of the application. - Code is self-documenting via doc string macros and source code links, allowing easy introspection. - Both the front-end and back-end can be modified (within security and access control constraints). + +* Using Nitinol +Nitinol is a project template, you can use it simply by cloning this repo and modifying its content. + +If you're new to Node.js development, start with ~npm i~ to install all dependencies. +You may also wish to install LIPS globally with ~npm -g install lips~, which will allow you to run a local repl with the ~lips~ command. +This is not required to use this framework, but is recommended. + +You should also run ~npm run nitinol:update~ to pull in the Nitinol library files. + +Then, the command ~npm run preview~ will start the backend and frontend. + +* Getting Started + +** Project Structure +There are 3 main folders in this template that you should pay attention to. +- ~app~ contains all frontend application code, including HTML, CSS, and manifest/JS code necessary for a PWA. + - ~app.scm~ in the ~app~ directory is the entry point for the Nitinol application - i.e. the script that is loaded by the HTML template. +- ~server~ contains all backend server code, with the ~server.scm~ file being the entry point used to start the backend. +- ~lib~ contains libraries potentially shared between the front and back end, as well as [[https://git.cyan.sh/BirDt/nitinol][Nitinol]] LIPS libraries included as a git submodule. + - ~npm run nitinol:update~ will update the Nitinol submodule. diff --git a/app/app.scm b/app/app.scm new file mode 100644 index 0000000..e69de29 diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..d9f6644 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,257 @@ +{ + "name": "nitinol", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "nitinol", + "version": "0.1.0", + "license": "AGPL-3.0-or-later", + "dependencies": { + "lips": "^1.0.0-beta.20", + "mithril": "^2.3.8" + } + }, + "node_modules/@cbor-extract/cbor-extract-darwin-arm64": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@cbor-extract/cbor-extract-darwin-arm64/-/cbor-extract-darwin-arm64-2.2.2.tgz", + "integrity": "sha512-ZKZ/F8US7JR92J4DMct6cLW/Y66o2K576+zjlEN/MevH70bFIsB10wkZEQPLzl2oNh2SMGy55xpJ9JoBRl5DOA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@cbor-extract/cbor-extract-darwin-x64": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@cbor-extract/cbor-extract-darwin-x64/-/cbor-extract-darwin-x64-2.2.2.tgz", + "integrity": "sha512-32b1mgc+P61Js+KW9VZv/c+xRw5EfmOcPx990JbCBSkYJFY0l25VinvyyWfl+3KjibQmAcYwmyzKF9J4DyKP/Q==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@cbor-extract/cbor-extract-linux-arm": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@cbor-extract/cbor-extract-linux-arm/-/cbor-extract-linux-arm-2.2.2.tgz", + "integrity": "sha512-tNg0za41TpQfkhWjptD+0gSD2fggMiDCSacuIeELyb2xZhr7PrhPe5h66Jc67B/5dmpIhI2QOUtv4SBsricyYQ==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@cbor-extract/cbor-extract-linux-arm64": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@cbor-extract/cbor-extract-linux-arm64/-/cbor-extract-linux-arm64-2.2.2.tgz", + "integrity": "sha512-wfqgzqCAy/Vn8i6WVIh7qZd0DdBFaWBjPdB6ma+Wihcjv0gHqD/mw3ouVv7kbbUNrab6dKEx/w3xQZEdeXIlzg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@cbor-extract/cbor-extract-linux-x64": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@cbor-extract/cbor-extract-linux-x64/-/cbor-extract-linux-x64-2.2.2.tgz", + "integrity": "sha512-rpiLnVEsqtPJ+mXTdx1rfz4RtUGYIUg2rUAZgd1KjiC1SehYUSkJN7Yh+aVfSjvCGtVP0/bfkQkXpPXKbmSUaA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@cbor-extract/cbor-extract-win32-x64": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@cbor-extract/cbor-extract-win32-x64/-/cbor-extract-win32-x64-2.2.2.tgz", + "integrity": "sha512-dI+9P7cfWxkTQ+oE+7Aa6onEn92PHgfWXZivjNheCRmTBDBf2fx6RyTi0cmgpYLnD1KLZK9ZYrMxaPZ4oiXhGA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@jcubic/lily": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@jcubic/lily/-/lily-0.4.0.tgz", + "integrity": "sha512-Ls2myk57bfXPS9XdNZ7Kbbbx4veQgZG64UpFYLDuPhe/NSqeHW88iz09YZdbpYOSNNQiQKN8D5HN+nLI1ot7Gg==", + "license": "MIT" + }, + "node_modules/bn.js": { + "version": "5.2.5", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.5.tgz", + "integrity": "sha512-Vq886eXykuP5E6HcKSSStP3bJgrE6In5WKxVUvJ8XGpWWYs2xZHWqUwzCtGgEtBcxyd57KBFDPFoUfNzdaHCNg==", + "license": "MIT" + }, + "node_modules/cbor-extract": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/cbor-extract/-/cbor-extract-2.2.2.tgz", + "integrity": "sha512-hlSxxI9XO2yQfe9g6msd3g4xCfDqK5T5P0fRMLuaLHhxn4ViPrm+a+MUfhrvH2W962RGxcBwEGzLQyjbDG1gng==", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "node-gyp-build-optional-packages": "5.1.1" + }, + "bin": { + "download-cbor-prebuilds": "bin/download-prebuilds.js" + }, + "optionalDependencies": { + "@cbor-extract/cbor-extract-darwin-arm64": "2.2.2", + "@cbor-extract/cbor-extract-darwin-x64": "2.2.2", + "@cbor-extract/cbor-extract-linux-arm": "2.2.2", + "@cbor-extract/cbor-extract-linux-arm64": "2.2.2", + "@cbor-extract/cbor-extract-linux-x64": "2.2.2", + "@cbor-extract/cbor-extract-win32-x64": "2.2.2" + } + }, + "node_modules/cbor-x": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/cbor-x/-/cbor-x-1.6.4.tgz", + "integrity": "sha512-UGKHjp6RHC6QuZ2yy5LCKm7MojM4716DwoSaqwQpaH4DvZvbBTGcoDNTiG9Y2lByXZYFEs9WRkS5tLl96IrF1Q==", + "license": "MIT", + "optionalDependencies": { + "cbor-extract": "^2.2.2" + } + }, + "node_modules/compare-versions": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.1.tgz", + "integrity": "sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg==", + "license": "MIT" + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/lips": { + "version": "1.0.0-beta.20", + "resolved": "https://registry.npmjs.org/lips/-/lips-1.0.0-beta.20.tgz", + "integrity": "sha512-aC9x+ZR9YZGVQ41r4ge6/NkwBrPkHHommifoVAJm82HHLxjaQPE/+B9EZQKlMU07eRLhXpmUlSncfvV+riHEeQ==", + "license": "MIT", + "dependencies": { + "@jcubic/lily": "^0.4.0", + "bn.js": "^5.2.1", + "cbor-extract": "^2.2.0", + "cbor-x": "^1.6.0", + "compare-versions": "^6.1.1", + "lzjb-pack": "^0.2.0", + "prism-cli": "^0.5.3", + "prismjs": "^1.29.0", + "unfetch": "^5.0.0" + }, + "bin": { + "lips": "bin/lips.js" + } + }, + "node_modules/lzjb-pack": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/lzjb-pack/-/lzjb-pack-0.2.0.tgz", + "integrity": "sha512-kq31VT9O9XoSR5kdXYglGDeDKgAfmu39MWrc7TzYVJBRT6UMc5PSYhkZHdqKiBFKVk9e5DWNyBF3Yji1GifD+Q==", + "license": "BSD-3-Clause" + }, + "node_modules/mithril": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/mithril/-/mithril-2.3.8.tgz", + "integrity": "sha512-za/Yo7qXEckjm5syrSfaaI9Utf4tCUT3T1IOIYqH6Lrj7G0OZuYYLAY9SV4ygoaAf0+CNqU92MBt+7pmo53JVQ==", + "license": "MIT" + }, + "node_modules/node-gyp-build-optional-packages": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.1.1.tgz", + "integrity": "sha512-+P72GAjVAbTxjjwUmwjVrqrdZROD4nf8KgpBoDxqXXTiYZZt/ud60dE5yvCSr9lRO8e8yv6kgJIC0K0PfZFVQw==", + "license": "MIT", + "dependencies": { + "detect-libc": "^2.0.1" + }, + "bin": { + "node-gyp-build-optional-packages": "bin.js", + "node-gyp-build-optional-packages-optional": "optional.js", + "node-gyp-build-optional-packages-test": "build-test.js" + } + }, + "node_modules/prism-cli": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/prism-cli/-/prism-cli-0.5.3.tgz", + "integrity": "sha512-8tuw/MmG/U3d74j5JTWvTI6quEV4G4a5vsso0LDaYBFEbPd1yN3V/VuOYk47IKS2Iuj8E7j1WPQAFCUEdULo3w==", + "license": "MIT", + "dependencies": { + "@jcubic/lily": "^0.1.0", + "prismjs": "^1.22.0", + "supports-color": "^7.2.0" + }, + "bin": { + "prism": "bin/prism.js" + } + }, + "node_modules/prism-cli/node_modules/@jcubic/lily": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@jcubic/lily/-/lily-0.1.0.tgz", + "integrity": "sha512-kIsp4dmIUHn3YHIqFhEylY+mgI988KcYI8f19og7LqmLzkouPZNBip/oL8iemElie0gqx5CeQ5HxZv/SuNkOaA==", + "license": "MIT" + }, + "node_modules/prismjs": { + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.30.0.tgz", + "integrity": "sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/unfetch": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unfetch/-/unfetch-5.0.0.tgz", + "integrity": "sha512-3xM2c89siXg0nHvlmYsQ2zkLASvVMBisZm5lF3gFDqfF2xonNStDJyMpvaOBe0a1Edxmqrf2E0HBdmy9QyZaeg==", + "license": "MIT", + "workspaces": [ + "./packages/isomorphic-unfetch" + ] + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..9806eca --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "name": "nitinol", + "version": "0.1.0", + "description": "A malleable PWA template using Mithril and LIPS Scheme.", + "author": "Jakub Nowak", + "license": "AGPL-3.0-or-later", + "type": "module", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "dependencies": { + "lips": "^1.0.0-beta.20", + "mithril": "^2.3.8" + } +} diff --git a/server/server.scm b/server/server.scm new file mode 100644 index 0000000..e69de29