Tags: #fullstack #rust #warp #sqlx #sqlb #postgres #native-web-components
Note: Ensure Node.js, Docker, and Rust with Cargo are installed.
-
Start the PostgreSQL database:
# Terminal 1 docker run --rm -p 5432:5432 -e "POSTGRES_PASSWORD=postgres" --name pg postgres:14
-
Build the client:
# Terminal 2 cd client yarn run build # npm | yarn | bun | pnpm
-
Run the server:
# Terminal 3 cd server cargo run -- ../client/web-folder
To streamline development with live reloading:
-
Build and watch the server:
# Terminal 1 cd server cargo watch -q -c -w src/ -x 'run -- ../client/web-folder'
-
Build and watch the client:
# Terminal 2 cd client yarn build -- -w
Run the test suites for the server with live updates:
cd server
# Test Suite 1: Database Model Tests
cargo watch -q -c -w src/ -x 'test model_db_ -- --test-threads=1 --nocapture'
# Test Suite 2: Todo Model Tests
cargo watch -q -c -w src/ -x 'test model_todo_ -- --test-threads=1 --nocapture'
# Test Suite 3: Web Todo Tests
cargo watch -q -c -w src/ -x 'test web_todo_ -- --test-threads=1 --nocapture'- Arc: Atomic Reference Counting, used for thread-safe shared ownership.
- _fx: Fixture, typically used for test setup data.