Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@ Cargo.lock
# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

.env
.env

# direnv / nix
.direnv/
.envrc.local
result
result-*
42 changes: 25 additions & 17 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ crate-type = ["cdylib", "rlib"]
[dependencies]
# --- Core Leptos Dependencies ---
# Set default-features = false to manually control 'ssr' and 'hydrate' features.
leptos = { version = "0.8.2", features = ["nightly"] }
leptos_router = { version = "0.8.2", features = ["nightly"] }
leptos_meta = { version = "0.8.2" }
leptos-use = { version = "0.16.2" }
leptos = { version = "0.8.17", features = ["nightly"] }
leptos_router = { version = "0.8.12", features = ["nightly"] }
leptos_meta = { version = "0.8.6" }
leptos-use = { version = "0.16.3" }

# --- Client-Side (WASM) Dependencies ---
# These are only needed for the 'hydrate' feature.
console_error_panic_hook = { version = "0.1.7", optional = true }
wasm-bindgen = { version = "0.2.100", optional = true }
web-sys = { version = "0.3.77", features = [
wasm-bindgen = { version = "0.2.114", optional = true }
web-sys = { version = "0.3.91", features = [
"Window",
"Document",
"Storage",
Expand All @@ -27,24 +27,28 @@ web-sys = { version = "0.3.77", features = [

# --- Server-Side (Binary) Dependencies ---
# These are correctly marked as optional and will be enabled by the 'ssr' feature.
axum = { version = "0.8.4", features = ["ws"], optional = true }
leptos_axum = { version = "0.8.2", optional = true }
tokio = { version = "1.45", features = ["rt-multi-thread", "macros"], optional = true }
tower = { version = "0.5.2", optional = true }
tower-http = { version = "0.6.6", features = ["fs"], optional = true }
surrealdb = { version = "2.3.4", optional = true }
axum = { version = "0.8.8", features = ["ws"], optional = true }
leptos_axum = { version = "0.8.8", optional = true }
tokio = { version = "1.50", features = ["rt-multi-thread", "macros"], optional = true }
tower = { version = "0.5.3", optional = true }
tower-http = { version = "0.6.8", features = ["fs"], optional = true }
diesel = { version = "2.2", features = ["postgres", "uuid", "chrono"], optional = true }
diesel-async = { version = "0.5", features = ["postgres", "deadpool"], optional = true }
diesel_migrations = { version = "2.2", optional = true }
uuid = { version = "1", features = ["v4", "serde"], optional = true }
chrono = { version = "0.4", features = ["serde"], optional = true }
dotenvy = { version = "0.15.7", optional = true }
tower-sessions = { version = "0.14.0", optional = true }
argon2 = { version = "0.5.3", optional = true }
async-trait = { version = "0.1.88", optional = true }
async-trait = { version = "0.1.89", optional = true }
time = { version = "0.3", optional = true }
tokio-tungstenite = { version = "0.27.0", optional = true }
futures-util = { version = "0.3.31", optional = true }
futures-util = { version = "0.3.32", optional = true }

# --- Common Dependencies ---
thiserror = "2.0"
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.140"
serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0.149"
validator = { version = "0.20.0", features = ["derive"] }


Expand All @@ -66,7 +70,11 @@ ssr = [
"dep:tower",
"dep:tower-http",
"dep:leptos_axum",
"dep:surrealdb",
"dep:diesel",
"dep:diesel-async",
"dep:diesel_migrations",
"dep:uuid",
"dep:chrono",
"dep:dotenvy",
"dep:tower-sessions",
"dep:argon2",
Expand Down
127 changes: 0 additions & 127 deletions Cargo.toml.prod

This file was deleted.

19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,16 @@ The system keeps everyone synchronized:

### Prerequisites

Install [Rust](https://www.rust-lang.org/tools/install), [Leptos](https://book.leptos.dev/getting_started/) + [TailwindCLI](https://tailwindcss.com/docs/installation/tailwind-cli) and [SurrealDB](https://surrealdb.com/install) as Database

create .env file with Database Connection info in project root:
```Example env
SURREAL_URL=127.0.0.1:8000
SURREAL_USER=root
SURREAL_PASS=root
SURREAL_DB=orderstream
SURREAL_NS=dev
Install [Rust](https://www.rust-lang.org/tools/install) (nightly), [cargo-leptos](https://book.leptos.dev/getting_started/) + [TailwindCLI](https://tailwindcss.com/docs/installation/tailwind-cli).

For the database, start PostgreSQL via Docker Compose:
```bash
docker compose up -d
```

Alternatively, create a `.env` file with your own PostgreSQL connection:
```env
DATABASE_URL=postgres://user:password@localhost:5432/my_database
```

## Development usage
Expand Down
2 changes: 2 additions & 0 deletions diesel.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[print_schema]
file = "src/backend/schema.rs"
21 changes: 21 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
services:
db:
image: postgres:15-alpine
container_name: mem_postgres
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: my_database
ports:
- "5432:5432"
# These flags maximize performance for dev/test environments
command: >
postgres
-c fsync=off
-c full_page_writes=off
-c synchronous_commit=off
volumes:
- pgdata:/var/lib/postgresql/data

volumes:
pgdata:
100 changes: 100 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading