From c191872365b7ec53a75c44a60242b7e284653d11 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Sun, 14 Jul 2024 17:36:08 +0200 Subject: [PATCH] Add basic README --- README.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..058ce46 --- /dev/null +++ b/README.md @@ -0,0 +1,47 @@ + + +# li7y + +*li7y* (pronounced *lily*) is a *lightweight inventory management system*. + +## Development + +To start a development server, run + + SUPERUSER_PASSWORD=foo SECRET_KEY=[replace me with the output of head -c 64 /dev/urandom | base64 -w0] DATABASE_URL=postgres://postgres:postgres@localhost/li7y cargo watch -x run + +This sets the superuser password to `foo`, +specifies a fixed secret key (to keep sessions persistent across restarts) +and configures a database at `postgres://postgres:postgres@localhost/li7y`. +A development database can be set up for example with podman: + + podman run --rm -it -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=li7y -p 5432:5432 postgres:15-alpine + +Then you can open your browser on . + +When changing SQL queries or the database schema, +the SQLx cache needs to be updated with + + DATABASE_URL=postgres://postgres:postgres@localhost/li7y cargo sqlx prepare + +Migrations should be run automatically, +but during development the `sqlx` command-line tool can be used to run and revert the migrations: + + # manually apply unapplied operations + DATABASE_URL=postgres://postgres:postgres@localhost/li7y sqlx migrate run + # manually revert most recent migration + DATABASE_URL=postgres://postgres:postgres@localhost/li7y sqlx migrate revert + +## Licence + +Most files are licensed under the terms of [`AGPL-3.0-or-later`](./LICENSES/AGPL-3.0-or-later.txt), +but some files (especially vendored external files) are licensed differently. +Every file has its licence specified according to the [REUSE](https://reuse.software/) specification. +You can use the [`reuse` tool](https://github.com/fsfe/reuse-tool) to get detailed copyright and licensing information on all files. + +The built software includes third-party libraries. +A detailed list of them can be generated with `cargo tree` or `cargo deny list -l crate`.