From c6f185a858273a1ae59c9fd21ce55bf4f227dbdb Mon Sep 17 00:00:00 2001 From: Silberengel Date: Sun, 16 Feb 2025 03:22:27 -0800 Subject: [PATCH 1/5] Update ReadMe.md and close issue#161 with new docker container --- Dockerfile | 4 +-- README.md | 83 +++++++++++++++++++++++++++++------------------------- 2 files changed, 46 insertions(+), 41 deletions(-) diff --git a/Dockerfile b/Dockerfile index a2a27a4..69b36c9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:22.13.1-alpine AS build +FROM node:23-alpine AS build WORKDIR /app @@ -9,5 +9,5 @@ COPY . ./ RUN npm run build EXPOSE 80 -FROM nginx:1.19-alpine +FROM nginx:1.27.4 COPY --from=build /app/build /usr/share/nginx/html \ No newline at end of file diff --git a/README.md b/README.md index 748669b..f11f933 100644 --- a/README.md +++ b/README.md @@ -2,81 +2,86 @@ # Alexandria -Alexandria is a Nostr Knowledge Base (NKB) and a reader for long-form articles. -For a thorough introduction, please refer to our [project documention](https://wikistr.com/gc-alexandria*dd664d5e4016433a8cd69f005ae1480804351789b59de5af06276de65633d319). - -## Features - -### Elegant Design - -As Alexandria is targeted toward those who are trying to focus on longer, more-complex content, the design has been stripped down of any distracting elements or unnecessary details, so that the user can concentrate on the valuable information stored in the documents that they are viewing. Both light-mode and dark-mode are available. - -![Menu](https://i.nostr.build/4oAlm.png) - -![event display](https://i.nostr.build/KG2D2.png) - -![cards](https://i.nostr.build/Vwkl0.png) - -### Modular articles - -The specialty of this client is the ability to display long-form articles, particularly of the modular variety: event kinds [30040 and 30041](https://wikistr.com/nkbip-01). It will eventually also able to display wiki pages (event kind [30818](https://wikistr.com/nip-54)) and normal long-form articles (event kind [30023](https://wikistr.com/nip-23)). - -Modular articles are often referred to as the *Nostr eBook format*, with 30040 events containing the metadata and the ordered list of the 30041 notes, which contain the formatted content. The 30040 index is used to create a sidebar containing the table of contents, and the 30041 sections can be individually selected and interacted with. -![Alexandria reading page](https://i.nostr.build/KEReOZ0LH6w9jrM8.png) - -### Write articles - -Alexandria features an Asciidoc upload facility, for you to transform your well-formatted text to Nostr events and publish them to your preferred relays. The GitCitadel relay is set as the default, to ensure that you have at least one relay that is sure to work. - -For an interim solution, please use the [command line program.](https://gitworkshop.dev/r/naddr1qqxx2sn0da442arfd35hg7gpz4mhxue69uhhqatjwpkx2un9d3shjtnrdaksyg8ayz8w3j8jsduq492j39hysg7vnhrtl4zzqcugj4m3q62qlkf8cypsgqqqw7vs555whg/) +Alexandria is a reader and writer for curated publications. +For a thorough introduction, please refer to our [project documention](https://next-alexandria.gitcitadel.eu/publication?d=gitcitadel-project-documentation-by-stella-v-1), viewable on Alexandria. + +## Issues and Patches + +If you would like to suggest a feature or report a bug, or submit a patch for review, please use the [Nostr git interface](https://gitcitadel.com/r/naddr1qvzqqqrhnypzplfq3m5v3u5r0q9f255fdeyz8nyac6lagssx8zy4wugxjs8ajf7pqyt8wumn8ghj7ur4wfcxcetjv4kxz7fwvdhk6tcqpfqkcetcv9hxgunfvyamcf5z) on our homepage. ## Developing Make sure that you have [Node.js](https://nodejs.org/en/download/package-manager) installed. -Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`) -- make sure to use an independent shell for this step, and not a terminal embedded in an IDE --, start a development server: +Once you've cloned this repo, installed dependencies with: +```bash +npm install +``` + +then start a development server: ```bash npm run dev +``` -# or start the server and open the app in a new browser tab +or start the server and open the app in a new browser tab: +```bash npm run dev -- --open ``` ## Building -To create a production version of your app: - +To create a production version of your app, including the static site: ```bash npm run build ``` -You can preview the production build with `npm run preview`. +You can preview the production build with: +```bash +npm run preview +``` > To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. ## Docker -To run docker type: +This docker container performs the build. + +To build the container: ```bash docker build . -t gc-alexandria -docker run --rm --name=gc-alexandria -p 4174:80 gc-alexandria +``` +To run the container, in detached mode (-d): +```bash +docker run -d --rm --name=gc-alexandria -p 4174:80 gc-alexandria -d +``` + +The container is then viewable on your [local machine](http://localhost:4174). + +If you want to see the container process (assuming it's the last process to start), enter: + +```bash +docker ps -l +``` + +which should return something like: + +```bash +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +1d83d736322f gc-alexandria "/docker-entrypoint.…" 2 minutes ago Up 2 minutes 0.0.0.0:4174->80/tcp, [::]:4174->80/tcp gc-alexandria ``` -Notes: -Dockerized Alexandria starts at port 4174 instead of 4173 in the example. Change the port if you like it. -
Internet page used as guide: https://www.sveltesociety.dev/recipes/publishing-and-deploying/dockerize-a-svelte-app ## Testing -To run the Vitest suite we've built, install the program locally and run the tests. +*These tests are under development, but will run. They will later be added to the container.* +To run the Vitest suite we've built, install the program locally and run the tests. ```bash npm run test ``` For the Playwright end-to-end (e2e) tests: - ```bash npx playwright test ``` \ No newline at end of file From c2eb73846e3c2a6e33935a37ac8a6193012c8784 Mon Sep 17 00:00:00 2001 From: Silberengel Date: Wed, 19 Feb 2025 13:09:42 -0800 Subject: [PATCH 2/5] fix ReadMe typos --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f11f933..e39f094 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ If you would like to suggest a feature or report a bug, or submit a patch for re Make sure that you have [Node.js](https://nodejs.org/en/download/package-manager) installed. -Once you've cloned this repo, installed dependencies with: +Once you've cloned this repo, install dependencies with: ```bash npm install @@ -31,7 +31,7 @@ npm run dev -- --open ## Building -To create a production version of your app, including the static site: +To build a production version of your app, as a static site: ```bash npm run build ``` @@ -41,7 +41,7 @@ You can preview the production build with: npm run preview ``` -> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. +> We have configured Alexandria to use the static adapter. To deploy your app with a different adapter, you will need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. ## Docker From d0336979ba86e868ef5121b7832a7878b348c627 Mon Sep 17 00:00:00 2001 From: goldengel Date: Sun, 23 Feb 2025 22:40:13 +0100 Subject: [PATCH 3/5] moved copy of the main folder above package-lock.json as proposed by ChipTuner in PR --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 69b36c9..f11d306 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,10 +2,10 @@ FROM node:23-alpine AS build WORKDIR /app +COPY . ./ COPY package.json ./ COPY package-lock.json ./ RUN npm install -COPY . ./ RUN npm run build EXPOSE 80 From d3017e548c8ae4bf0bd5f191738c2279c019a1c1 Mon Sep 17 00:00:00 2001 From: Silberengel Date: Mon, 24 Feb 2025 21:40:25 -0800 Subject: [PATCH 4/5] Docker container and instruction bug-fixes --- README.md | 2 +- package-lock.json | 118 +++++++++++++++++++++++----------------------- 2 files changed, 60 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index e39f094..fd95ef4 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ docker build . -t gc-alexandria To run the container, in detached mode (-d): ```bash -docker run -d --rm --name=gc-alexandria -p 4174:80 gc-alexandria -d +docker run -d --rm --name=gc-alexandria -p 4174:80 gc-alexandria ``` The container is then viewable on your [local machine](http://localhost:4174). diff --git a/package-lock.json b/package-lock.json index 2f048b9..34229ac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1327,9 +1327,9 @@ } }, "node_modules/@sveltejs/kit": { - "version": "2.17.1", - "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-2.17.1.tgz", - "integrity": "sha512-CpoGSLqE2MCmcQwA2CWJvOsZ9vW+p/1H3itrFykdgajUNAEyQPbsaSn7fZb6PLHQwe+07njxje9ss0fjZoCAyw==", + "version": "2.17.2", + "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-2.17.2.tgz", + "integrity": "sha512-Vypk02baf7qd3SOB1uUwUC/3Oka+srPo2J0a8YN3EfJypRshDkNx9HzNKjSmhOnGWwT+SSO06+N0mAb8iVTmTQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1471,15 +1471,15 @@ "license": "MIT" }, "node_modules/@vitest/expect": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.0.5.tgz", - "integrity": "sha512-nNIOqupgZ4v5jWuQx2DSlHLEs7Q4Oh/7AYwNyE+k0UQzG7tSmjPXShUikn1mpNGzYEN2jJbTvLejwShMitovBA==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.0.6.tgz", + "integrity": "sha512-zBduHf/ja7/QRX4HdP1DSq5XrPgdN+jzLOwaTq/0qZjYfgETNFCKf9nOAp2j3hmom3oTbczuUzrzg9Hafh7hNg==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/spy": "3.0.5", - "@vitest/utils": "3.0.5", - "chai": "^5.1.2", + "@vitest/spy": "3.0.6", + "@vitest/utils": "3.0.6", + "chai": "^5.2.0", "tinyrainbow": "^2.0.0" }, "funding": { @@ -1487,13 +1487,13 @@ } }, "node_modules/@vitest/mocker": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.0.5.tgz", - "integrity": "sha512-CLPNBFBIE7x6aEGbIjaQAX03ZZlBMaWwAjBdMkIf/cAn6xzLTiM3zYqO/WAbieEjsAZir6tO71mzeHZoodThvw==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.0.6.tgz", + "integrity": "sha512-KPztr4/tn7qDGZfqlSPQoF2VgJcKxnDNhmfR3VgZ6Fy1bO8T9Fc1stUiTXtqz0yG24VpD00pZP5f8EOFknjNuQ==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/spy": "3.0.5", + "@vitest/spy": "3.0.6", "estree-walker": "^3.0.3", "magic-string": "^0.30.17" }, @@ -1524,9 +1524,9 @@ } }, "node_modules/@vitest/pretty-format": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.0.5.tgz", - "integrity": "sha512-CjUtdmpOcm4RVtB+up8r2vVDLR16Mgm/bYdkGFe3Yj/scRfCpbSi2W/BDSDcFK7ohw8UXvjMbOp9H4fByd/cOA==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.0.6.tgz", + "integrity": "sha512-Zyctv3dbNL+67qtHfRnUE/k8qxduOamRfAL1BurEIQSyOEFffoMvx2pnDSSbKAAVxY0Ej2J/GH2dQKI0W2JyVg==", "dev": true, "license": "MIT", "dependencies": { @@ -1537,38 +1537,38 @@ } }, "node_modules/@vitest/runner": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.0.5.tgz", - "integrity": "sha512-BAiZFityFexZQi2yN4OX3OkJC6scwRo8EhRB0Z5HIGGgd2q+Nq29LgHU/+ovCtd0fOfXj5ZI6pwdlUmC5bpi8A==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.0.6.tgz", + "integrity": "sha512-JopP4m/jGoaG1+CBqubV/5VMbi7L+NQCJTu1J1Pf6YaUbk7bZtaq5CX7p+8sY64Sjn1UQ1XJparHfcvTTdu9cA==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/utils": "3.0.5", - "pathe": "^2.0.2" + "@vitest/utils": "3.0.6", + "pathe": "^2.0.3" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/snapshot": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.0.5.tgz", - "integrity": "sha512-GJPZYcd7v8QNUJ7vRvLDmRwl+a1fGg4T/54lZXe+UOGy47F9yUfE18hRCtXL5aHN/AONu29NGzIXSVFh9K0feA==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.0.6.tgz", + "integrity": "sha512-qKSmxNQwT60kNwwJHMVwavvZsMGXWmngD023OHSgn873pV0lylK7dwBTfYP7e4URy5NiBCHHiQGA9DHkYkqRqg==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "3.0.5", + "@vitest/pretty-format": "3.0.6", "magic-string": "^0.30.17", - "pathe": "^2.0.2" + "pathe": "^2.0.3" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/spy": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.0.5.tgz", - "integrity": "sha512-5fOzHj0WbUNqPK6blI/8VzZdkBlQLnT25knX0r4dbZI9qoZDf3qAdjoMmDcLG5A83W6oUUFJgUd0EYBc2P5xqg==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.0.6.tgz", + "integrity": "sha512-HfOGx/bXtjy24fDlTOpgiAEJbRfFxoX3zIGagCqACkFKKZ/TTOE6gYMKXlqecvxEndKFuNHcHqP081ggZ2yM0Q==", "dev": true, "license": "MIT", "dependencies": { @@ -1579,14 +1579,14 @@ } }, "node_modules/@vitest/utils": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.0.5.tgz", - "integrity": "sha512-N9AX0NUoUtVwKwy21JtwzaqR5L5R5A99GAbrHfCCXK1lp593i/3AZAXhSP43wRQuxYsflrdzEfXZFo1reR1Nkg==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.0.6.tgz", + "integrity": "sha512-18ktZpf4GQFTbf9jK543uspU03Q2qya7ZGya5yiZ0Gx0nnnalBvd5ZBislbl2EhLjM8A8rt4OilqKG7QwcGkvQ==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "3.0.5", - "loupe": "^3.1.2", + "@vitest/pretty-format": "3.0.6", + "loupe": "^3.1.3", "tinyrainbow": "^2.0.0" }, "funding": { @@ -2029,9 +2029,9 @@ "license": "CC-BY-4.0" }, "node_modules/chai": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.2.tgz", - "integrity": "sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.2.0.tgz", + "integrity": "sha512-mCuXncKXk5iCLhfhwTc0izo0gtEmpz5CtG2y8GiOINBlMVS6v8TMRc5TaLWKS6692m9+dVVfzgeVxR5UxWHTYw==", "dev": true, "license": "MIT", "dependencies": { @@ -6270,16 +6270,16 @@ } }, "node_modules/vite-node": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.0.5.tgz", - "integrity": "sha512-02JEJl7SbtwSDJdYS537nU6l+ktdvcREfLksk/NDAqtdKWGqHl+joXzEubHROmS3E6pip+Xgu2tFezMu75jH7A==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.0.6.tgz", + "integrity": "sha512-s51RzrTkXKJrhNbUzQRsarjmAae7VmMPAsRT7lppVpIg6mK3zGthP9Hgz0YQQKuNcF+Ii7DfYk3Fxz40jRmePw==", "dev": true, "license": "MIT", "dependencies": { "cac": "^6.7.14", "debug": "^4.4.0", "es-module-lexer": "^1.6.0", - "pathe": "^2.0.2", + "pathe": "^2.0.3", "vite": "^5.0.0 || ^6.0.0" }, "bin": { @@ -6293,9 +6293,9 @@ } }, "node_modules/vitefu": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.0.4.tgz", - "integrity": "sha512-y6zEE3PQf6uu/Mt6DTJ9ih+kyJLr4XcSgHR2zUkM8SWDhuixEJxfJ6CZGMHh1Ec3vPLoEA0IHU5oWzVqw8ulow==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.0.5.tgz", + "integrity": "sha512-h4Vflt9gxODPFNGPwp4zAMZRpZR7eslzwH2c5hn5kNZ5rhnKyRJ50U+yGCdc2IRaBs8O4haIgLNGrV5CrpMsCA==", "dev": true, "license": "MIT", "workspaces": [ @@ -6312,31 +6312,31 @@ } }, "node_modules/vitest": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.0.5.tgz", - "integrity": "sha512-4dof+HvqONw9bvsYxtkfUp2uHsTN9bV2CZIi1pWgoFpL1Lld8LA1ka9q/ONSsoScAKG7NVGf2stJTI7XRkXb2Q==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.0.6.tgz", + "integrity": "sha512-/iL1Sc5VeDZKPDe58oGK4HUFLhw6b5XdY1MYawjuSaDA4sEfYlY9HnS6aCEG26fX+MgUi7MwlduTBHHAI/OvMA==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/expect": "3.0.5", - "@vitest/mocker": "3.0.5", - "@vitest/pretty-format": "^3.0.5", - "@vitest/runner": "3.0.5", - "@vitest/snapshot": "3.0.5", - "@vitest/spy": "3.0.5", - "@vitest/utils": "3.0.5", - "chai": "^5.1.2", + "@vitest/expect": "3.0.6", + "@vitest/mocker": "3.0.6", + "@vitest/pretty-format": "^3.0.6", + "@vitest/runner": "3.0.6", + "@vitest/snapshot": "3.0.6", + "@vitest/spy": "3.0.6", + "@vitest/utils": "3.0.6", + "chai": "^5.2.0", "debug": "^4.4.0", "expect-type": "^1.1.0", "magic-string": "^0.30.17", - "pathe": "^2.0.2", + "pathe": "^2.0.3", "std-env": "^3.8.0", "tinybench": "^2.9.0", "tinyexec": "^0.3.2", "tinypool": "^1.0.2", "tinyrainbow": "^2.0.0", "vite": "^5.0.0 || ^6.0.0", - "vite-node": "3.0.5", + "vite-node": "3.0.6", "why-is-node-running": "^2.3.0" }, "bin": { @@ -6352,8 +6352,8 @@ "@edge-runtime/vm": "*", "@types/debug": "^4.1.12", "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", - "@vitest/browser": "3.0.5", - "@vitest/ui": "3.0.5", + "@vitest/browser": "3.0.6", + "@vitest/ui": "3.0.6", "happy-dom": "*", "jsdom": "*" }, From fba4bb5c9e1f9f73645744203620a8286fec0241 Mon Sep 17 00:00:00 2001 From: Silberengel Date: Mon, 24 Feb 2025 21:48:16 -0800 Subject: [PATCH 5/5] Update readme about the preview instance. Close issue#161 --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fd95ef4..8a4e713 100644 --- a/README.md +++ b/README.md @@ -31,18 +31,18 @@ npm run dev -- --open ## Building +> We have configured Alexandria to use the static adapter. To deploy your app with a different adapter, you will need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. + To build a production version of your app, as a static site: ```bash npm run build ``` -You can preview the production build with: +You can preview the (non-static) production build with: ```bash npm run preview ``` -> We have configured Alexandria to use the static adapter. To deploy your app with a different adapter, you will need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. - ## Docker This docker container performs the build.