Skip to content

tuanvu-hq/learning-warp-3500470a

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PROJECT-3500470a

Tags: #fullstack #rust #warp #sqlx #sqlb #postgres #native-web-components

Running the Application

Note: Ensure Node.js, Docker, and Rust with Cargo are installed.

  1. Start the PostgreSQL database:

    # Terminal 1
    docker run --rm -p 5432:5432 -e "POSTGRES_PASSWORD=postgres" --name pg postgres:14
  2. Build the client:

    # Terminal 2
    cd client
    yarn run build # npm | yarn | bun | pnpm
  3. Run the server:

    # Terminal 3
    cd server
    cargo run -- ../client/web-folder

Development

To streamline development with live reloading:

  1. Build and watch the server:

    # Terminal 1
    cd server
    cargo watch -q -c -w src/ -x 'run -- ../client/web-folder'
  2. Build and watch the client:

    # Terminal 2
    cd client
    yarn build -- -w

Testing

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'

Key Terms

  • Arc: Atomic Reference Counting, used for thread-safe shared ownership.
  • _fx: Fixture, typically used for test setup data.

About

A project focused on learning Rust / Warp by building a mini full-stack application.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published