From signup to checkout
An ecommerce REST API built with Rust, Axum, Tokio, and PostgreSQL. It connects account authentication, the product catalog, shopping carts, order creation, and Paystack payment processing in one backend.
Core features
- JWT access and refresh tokens, password hashing, and customer/admin access controls.
- Product listings with search and filters, admin management, and soft deletion.
- Shopping carts with quantity updates and ownership checks.
- Orders created from carts, with stock updates inside a database transaction.
- Paystack payment initialization, verification, and webhook handling.
- OpenAPI documentation generated with Utoipa, alongside Swagger UI.
Orders and payment events
Checkout checks stock availability while updating inventory inside the order transaction. If an item has insufficient stock, order creation fails and the transaction rolls back.
The payment webhook verifies Paystack's HMAC-SHA512 signature before handling an event. An event table tracks payment references and event types to skip duplicate deliveries.
Structure and verification
Routes, handlers, models, authentication, and services live in separate modules. SQLx manages database queries and migrations; integration tests use isolated PostgreSQL databases to exercise auth, products, orders, and payment flows.
Explore the source, API reference, and setup guide.