Explorar o código

Add Quickstart in README.

scossu hai 5 días
pai
achega
85b53cd98b
Modificáronse 1 ficheiros con 89 adicións e 0 borrados
  1. 89 0
      README.md

+ 89 - 0
README.md

@@ -52,6 +52,95 @@ the place one day, they could be periodically harvested, linked together, and
 presented in one large, central archive (it's Linked Data, after all), without
 any detriment to the indepencence of the individual archives.
 
+## Quickstart
+
+This has been tested on Linux only. It's not guaranteed to work on other
+systems at the moment.
+
+### System prerequisites
+
+- A build environment (at least Git, libc, a C compiler, and Make)
+- UUID library (`uuid/uuid.h` - util-linux or linux-headers in most distros)
+- xxhash development package
+- lmdb development package
+- libvips development package
+- Lua 5.4 development package (lua-dev in some distros)
+- Luarocks 5.4
+
+If using Arch Linux:
+
+```
+pacman -Syu
+pacman -S base-devel util-linux-libs git xxhash lmdb libvips lua luarocks
+```
+
+### Install Volksdata & Pocket Archive
+
+Pocket Archive and Volksdata are still alpha and not in the Luarocks artifact
+repo yet, so the rocks must be installed manually for the time being.
+
+Installing locally or in a dedicated container is strongly recommended at this
+stage.
+
+```
+# Note: tested on Archlinux. Other distros (especially Alpine) may need tweaks.
+eval $(luarocks path)  # for local install
+luarocks install --local debugger  # Not in dependencies file but temporarily required
+git clone --recurse-submodules https://git.knowledgetx.com/scossu/volksdata_lua.git
+cd volksdata_lua
+luarocks build --local
+lua test.lua  # optional
+cd ../
+git clone --recurse-submodules https://git.knowledgetx.com/scossu/pocket_archive.git
+cd pocket_archive
+luarocks build --local
+luarocks path >> ~/.bashrc  # or whatever shell init script you use at login
+```
+
+### Run demo submission
+
+Initialize the archive first:
+
+```
+pkar init
+```
+
+This will create the required folders and database file in the archive root
+(a temporary folder by default). Then:
+
+```
+pkar submission test/sample_submission/demo01/pkar_submission.csv
+```
+
+### Generate static site from archive
+
+```
+pkar gen-site
+```
+
+Will generate the static site in `out/http/`. Note that this is static HTML but
+it needs a web server to resolve links (completely server-less version is in
+the works).
+
+If you don't have a configured web server yet, the provided `darkhttpd` will
+work in a pinch:
+
+```
+cd ext/darkhttpd/
+make
+cd -
+```
+
+Serve the site:
+
+```
+./ext/darkhttpd/darkhttpd out/html
+```
+
+(see more options with `darkhttpd --help`)
+
+Point your browser to `localhost:8080` and enjoy.
+
 ## Basic concepts
 
 Until some proper reference is written, this should serve as a high-level