Something went wrong. Try again.
An app for quitters
Something went wrong. Try again.
Files
- Rust 77%
- CSS 8%
- Shell 7%
- Docker 7%
- HTML <1%
README.md
Quitter (Alcoholics Audacious) #
A habit avoidance and abstinence tracker web app.
Overview #
Prerequisites #
- Rust: Latest stable version.
- PostgreSQL: Database server.
- Trunk: For building the Leptos frontend (
cargo install trunk). - SQLx CLI: For database migrations (
cargo install sqlx-cli). - Protobuf Compiler (
protoc): Required for compiling the shared proto files.
Setup #
-
Database: Create a PostgreSQL database (e.g.,
quitter).export DATABASE_URL="postgres://postgres:password@localhost/quitter" -
Migrations: Run migrations to set up the schema.
cd api sqlx migrate run
Running the Application #
Backend #
The backend serves the API and the static frontend files.
# In the api/ directory
cargo run
The server defaults to port 8080.
Frontend #
For development with hot-reloading:
# In the frontend/ directory
trunk serve
To build for production (files will be output to frontend/dist, which the API server serves):
# In the frontend/ directory
trunk build --release
Project Structure #
api/: Backend server (Axum).frontend/: Frontend application (Leptos).shared/: Shared library and Protocol Buffer definitions.