li7y/README.md

48 lines
1.9 KiB
Markdown
Raw Permalink Normal View History

2024-07-14 17:36:08 +02:00
<!--
SPDX-FileCopyrightText: 2024 Simon Bruder <simon@sbruder.de>
SPDX-License-Identifier: CC-BY-SA-4.0
-->
# 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 <http://localhost:8080>.
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`.