Skip to content

morlinbrot/web-starter-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

web-starter-rs

Starter template for a web application written in Rust, leveraging the "default" stack of tokio, axum, and sqlx.

If you're looking to quickly spin up a solid, production-ready foundation of a scalable web application, this template is for you.

The template provides the necessary building blocks for a proper Rust web application, such as:

  • Database connection pool provided via Axum state
  • Database migrations using sqlx-cli
  • Basic request tracing
  • Crate set up as both lib and bin to facilitate e2e testing

Usage

Make sure you have installed all the prerequisites.

Spin up the database:

just db
docker run -d --rm --name web-starter-db -p 5432:5432 --env-file .env postgres:17-alpine

Run the migrations:

just mig-up
sqlx migrate run

Run the server:

just watch
cargo watch -x run

Run tests:

just watch test
cargo watch -x test

Prerequisites

cargo install just
cargo install cargo-watch --locked
cargo install sqlx-cli

About

A Rust web starter template using tokio + axum + sqlx

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors