orders-api/
Pick any file or folder on the left to see what it is, why it exists, when you add it and the mistakes people make with it. Switch the stage to watch the project grow.
# Create the binary crate (also runs git init)
cargo new orders-api && cd orders-api# Add the web stack
cargo add axum tokio --features tokio/full && cargo add tower tower-http --features tower-http/trace,tower-http/timeout,tower-http/request-id,tower-http/cors# Add the database layer and the SQLx CLI
cargo add sqlx --features runtime-tokio,tls-rustls,postgres,macros,migrate,uuid,chrono && cargo install sqlx-cli --no-default-features --features postgres,rustls# Add serde, errors, config and logging
cargo add serde --features derive && cargo add serde_json thiserror anyhow config secrecy tracing && cargo add tracing-subscriber --features env-filter,json# Add test tools
cargo add --dev axum-test && cargo install cargo-nextest# Start PostgreSQL, create the database and run migrations
docker compose up -d db && sqlx database create && sqlx migrate run# Run the server
cargo run