Browse Source

Update ReadMe.md and close issue#161 with new docker container

master
Silberengel 1 year ago
parent
commit
c6f185a858
  1. 4
      Dockerfile
  2. 83
      README.md

4
Dockerfile

@ -1,4 +1,4 @@
FROM node:22.13.1-alpine AS build FROM node:23-alpine AS build
WORKDIR /app WORKDIR /app
@ -9,5 +9,5 @@ COPY . ./
RUN npm run build RUN npm run build
EXPOSE 80 EXPOSE 80
FROM nginx:1.19-alpine FROM nginx:1.27.4
COPY --from=build /app/build /usr/share/nginx/html COPY --from=build /app/build /usr/share/nginx/html

83
README.md

@ -2,81 +2,86 @@
# Alexandria # Alexandria
Alexandria is a Nostr Knowledge Base (NKB) and a reader for long-form articles. Alexandria is a reader and writer for curated publications.
For a thorough introduction, please refer to our [project documention](https://wikistr.com/gc-alexandria*dd664d5e4016433a8cd69f005ae1480804351789b59de5af06276de65633d319). 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 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.
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/)
## Developing ## Developing
Make sure that you have [Node.js](https://nodejs.org/en/download/package-manager) installed. 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 ```bash
npm run dev 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 npm run dev -- --open
``` ```
## Building ## Building
To create a production version of your app: To create a production version of your app, including the static site:
```bash ```bash
npm run build 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. > To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
## Docker ## Docker
To run docker type: This docker container performs the build.
To build the container:
```bash ```bash
docker build . -t gc-alexandria 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.
<br>Internet page used as guide: https://www.sveltesociety.dev/recipes/publishing-and-deploying/dockerize-a-svelte-app
## Testing ## 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 ```bash
npm run test npm run test
``` ```
For the Playwright end-to-end (e2e) tests: For the Playwright end-to-end (e2e) tests:
```bash ```bash
npx playwright test npx playwright test
``` ```
Loading…
Cancel
Save