From 72ec551e6cb422531e543e3fb431324aed5ac025 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Sun, 13 Aug 2023 18:40:49 +0200 Subject: feat: Add better tooling for running the project * Add watch option for hot reload(ish). * Read from `.env` file. This make local development a bit easier since now can easily run the application with custom configuration. --- README.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index a008d7f..256cfb3 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,59 @@ # Lens A read only file explorer with media capabilities. - -# Dev requirements + +# Dev + +To run the project you simply need to run: + +```bash +make run +``` + +It should run using sqlite with a randon AES key. But if you don't set a +`AES_KEY` a new one will generated every time the project is realead and you +will be logged out. + +You can also create a `.env` file which will be read by make to populate the +environment variables, e.g.: + +```ini +# .env +DB_TYPE=psql +DB_CON=host=localhost user=admin password=admin dbname=lens port=5432 +LOG_LEVEL=error +SCHEDULER_COUNT=10 +CACHE_PATH=/home/myhome/.thumb +AES_KEY=X4Eu3OT/WqUtUJhGLUtQ4xRahwhWYaSs+k2a03Kz1A8= +``` + +Obs.: don't quote the value, that will be done automatically. + +Throughout the development you can also run `make watch` for a hot reload +experience. It will feedback loop a bit faster. + +## Build and install + +To build you simply run: +``` +make +``` + +And a `./bin/lens` will be created. + +To install run: + +``` +make install +``` + +Or you can pass a custom target folder. + +``` +PREFIX=~/.local/ make install +``` + +# Requirements ## qtc -- cgit v1.2.3