# PHC Storage Web server per gestire la nuova macchina di backup e storage. ## Architecture - `_frontend/` This is a Vite project for building all the static pages used by this app. - `database/` Module with a `Database` interface and two implementation: `memDB` is an in-memory database for testing purposes while `sqliteDB` is a wrapper for working with an SQLite database. - `routes/` Various functions for configuring all the server routes. ## Usage First install the required npm packages ```bash $ cd _frontend _frontend/ $ npm install ``` ### Development ```bash # Development $ MODE=dev go run -v . # Development with watcher $ fd -e go | MODE=dev entr -r go run -v . ``` ### Production First build the `_frontend/dist` folder using ```bash $ cd _frontend $ npm run build ``` and then ```bash # Production $ go run -v . ``` ### Production with Docker ```bash $ mkdir buckets.local/ $ cat < database.local.json { "prefixSize": 2, "dashboardState": { "widgets": [] }, "buckets": {}, "api-keys": [] } EOF $ cat < .env MODE="development" HOST=":4000" ADMIN_PASSWORD="secret" MONITOR_SCRIPTS_DIR="./scripts" MONITOR_CACHE_TIMEOUT="5s", time.ParseDuration EOF ```