This application was developed to solve a PicPay Backend Challenge using Rust and DDD architecture.
Main libraries used:
- Tokio;
- Axum;
- SQLx;
- Serde;
- Reqwest;
Project structure:
.
βββ cargo.toml
βββ src
βββ controllers
β βββ transaction_controller.rs
β βββ user_controller.rs
βββ domain
β βββ appstate
β β βββ appstate.rs
β βββ authorizer
β β βββ authorizer.rs
β βββ notification
β β βββ notification.rs
β βββ transaction
β β βββ transaction.rs
β βββ user
β βββ user.rs
β βββ user_query.rs
βββ infrastructure
β βββ database.rs
β βββ router.rs
βββ repositories
β βββ user_repository.rs
βββ services
β βββ authorizer_service.rs
β βββ notification_service.rs
β βββ transaction_service.rs
β βββ user_service.rs
βββ lib.rs
βββ main.rs
- Download and install Rust on your machine: https://www.rust-lang.org/pt-BR/learn/get-started
- Clone repository.
- Configure the
.envfile.
Running migrate:
sqlx migrate runStart server:
cargo runBuild project:
cargo build --releaseStart the executable file:
target/release/rust-api-picpay.exe
POST /api/v1/user/register| ParΓ’metro | Tipo | DescriΓ§Γ£o |
|---|---|---|
name |
string |
User's full name |
identification |
string |
User CPF/CNPJ |
email |
string |
User email |
password |
string |
User password |
user_type |
string |
Customer or Merchant |
POST /api/v1/transaction/create| ParΓ’metro | Tipo | DescriΓ§Γ£o |
|---|---|---|
value |
integer |
Transaction value |
payer |
integer |
Payer user ID |
payee |
integer |
Payee user ID |