diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..55b822b --- /dev/null +++ b/.env.example @@ -0,0 +1,5 @@ +# Connection string for local development and tests. +# The role must be allowed to CREATE DATABASE (sqlx::test provisions temp DBs). +DATABASE_URL=postgres://postgres:postgres@localhost:5432/cms_dev +BIND_ADDR=0.0.0.0:8080 +APP_NAME=Collection Management System diff --git a/.gitignore b/.gitignore index ea8c4bf..fedaa2b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target +.env diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..6fd7983 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +services: + postgres: + image: postgres:17 + environment: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: cms_dev + ports: + - "5432:5432" + volumes: + - pgdata:/var/lib/postgresql/data + +volumes: + pgdata: diff --git a/justfile b/justfile new file mode 100644 index 0000000..c204c38 --- /dev/null +++ b/justfile @@ -0,0 +1,20 @@ +set dotenv-load + +# Run the server (reads .env) +run: + cargo run -p server + +# Run the full test suite +test: + cargo test --workspace + +# Format with the nightly toolchain +fmt: + cargo +nightly fmt + +# Lint, treating warnings as errors +lint: + cargo clippy --workspace --all-targets -- -D warnings + +# Format, lint, and test +check: fmt lint test