From 7d06c9e93d7f16eec90f0c1658bf4d937827f094 Mon Sep 17 00:00:00 2001 From: stefiosif Date: Wed, 24 Jun 2026 20:11:07 +0300 Subject: [PATCH] docs: add README and env examples --- .env.example | 5 +++++ README.md | 41 +++++++++++++++++++++++++++++++++++++++ backend/.env.example | 5 +++++ backend/.env.test.example | 3 +++ 4 files changed, 54 insertions(+) create mode 100644 .env.example create mode 100644 README.md create mode 100644 backend/.env.example create mode 100644 backend/.env.test.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..8a40cb4 --- /dev/null +++ b/.env.example @@ -0,0 +1,5 @@ +POSTGRES_USER=postgres +POSTGRES_PASSWORD=your-password-here +POSTGRES_DB=loft +DATABASE_URL=postgres://postgres:your-password-here@db:5432/loft +STORAGE_PATH=/app/storage diff --git a/README.md b/README.md new file mode 100644 index 0000000..b6563a5 --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +# loft + +A minimal, self-hosted web app (with a cloud storage option planned), built as a learning exercise to get more familiar with Axum and Svelte. + +## What it does +- Register / log in (session-based auth) +- Upload, list, download, and delete files +- Browse files in a grid/tile view with image preview and prev/next navigation +- Stream file content via HTTP range requests — the groundwork for video streaming + +## Requirements +- **To run:** Docker + Docker Compose — that's all (Rust/Node build inside the image). +- **To develop:** Rust (cargo + `sqlx-cli`), Node + pnpm, `just`, and Docker (for Postgres). + +## Quick start +```bash +git clone https://git.stefiosif.dev/stefiosif/loft +cd loft +cp .env.example .env + +# Run in Docker (http://localhost:3000): +docker compose up -d + +# Run locally (http://localhost:5173): +cp backend/.env.example backend/.env +just db-setup +# inside tmux together frontend and backend +just watch +# or separately +just watch-backend +just watch-frontend + +# API docs (Swagger UI, generated with utoipa): http://localhost:3000/swagger-ui + +# Run tests: +cp backend/.env.test.example backend/.env.test +just watch-test +``` + +## Commands +Run `just --list` to see all recipes. diff --git a/backend/.env.example b/backend/.env.example new file mode 100644 index 0000000..3892002 --- /dev/null +++ b/backend/.env.example @@ -0,0 +1,5 @@ +DATABASE_URL=postgres://postgres:your-password-here@localhost:5432/loft +STORAGE_PATH=/tmp/loft-files +POSTGRES_USER=postgres +POSTGRES_PASSWORD=your-password-here +POSTGRES_DB=loft diff --git a/backend/.env.test.example b/backend/.env.test.example new file mode 100644 index 0000000..dc88622 --- /dev/null +++ b/backend/.env.test.example @@ -0,0 +1,3 @@ +DATABASE_URL=postgres://postgres:your-password-here@localhost:5432/loft_test +STORAGE_PATH=/tmp/loft-files-test +ENVIRONMENT=test