docs: add README and env examples
This commit is contained in:
5
.env.example
Normal file
5
.env.example
Normal file
@@ -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
|
||||
41
README.md
Normal file
41
README.md
Normal file
@@ -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.
|
||||
5
backend/.env.example
Normal file
5
backend/.env.example
Normal file
@@ -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
|
||||
3
backend/.env.test.example
Normal file
3
backend/.env.test.example
Normal file
@@ -0,0 +1,3 @@
|
||||
DATABASE_URL=postgres://postgres:your-password-here@localhost:5432/loft_test
|
||||
STORAGE_PATH=/tmp/loft-files-test
|
||||
ENVIRONMENT=test
|
||||
Reference in New Issue
Block a user