This is an example project of a Remix application talking to a Rust backend using gRPC. It uses a local Postgres database for persistence, leveraging SQLx's type safe queries.
This codebase supplements the End-to-end type safety with Remix and Rust blog series Please check out the blog posts for a step-by-step guide for developing this application.
These tools are needed to run the application:
- A recent version of Node (v18+).
- A recent version of Rust (1.75+).
- Docker.
- SQLx CLI - you can install this using Cargo.
- protobuf
- grpcui - if you want an interactive UI for gRPC.:w
In order to run the service, we'll need a Postgres database running locally.
You can spin up one using docker compose in the ./api
directory:
docker compose up -d db
Create an .env
file to set the DATABASE_URL
for SQLx.
DATABASE_URL=postgres://postgres:dummy@localhost:5432/trading
Use SQLx's CLI to create the database and apply the migrations.
sqlx database create
sqlx migrate run
With the database ready, you should be able to use Cargo to run the service:
cargo run