Browse Source

Merges pull request #7

Issue #161 Docker container
master
silberengel 1 year ago
parent
commit
fe5735bf0d
No known key found for this signature in database
GPG Key ID: 962BEC8725790894
  1. 6
      Dockerfile
  2. 81
      README.md
  3. 118
      package-lock.json

6
Dockerfile

@ -1,13 +1,13 @@ @@ -1,13 +1,13 @@
FROM node:22.13.1-alpine AS build
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 nginx:1.19-alpine
FROM nginx:1.27.4
COPY --from=build /app/build /usr/share/nginx/html

81
README.md

@ -2,81 +2,86 @@ @@ -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).
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.
## Features
## Issues and Patches
### 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/)
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, install 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:
> 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 `npm run preview`.
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
You can preview the (non-static) production build with:
```bash
npm run preview
```
## 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
```
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.
<br>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
```

118
package-lock.json generated

@ -1327,9 +1327,9 @@ @@ -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 @@ @@ -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 @@ @@ -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 @@ @@ -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 @@ @@ -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 @@ @@ -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 @@ @@ -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 @@ @@ -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 @@ @@ -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 @@ @@ -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 @@ @@ -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": "*"
},

Loading…
Cancel
Save