Skip to content

imfelipedev/rust-api-picpay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚩 Authentication API

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

Installation

  1. Download and install Rust on your machine: https://www.rust-lang.org/pt-BR/learn/get-started
  2. Clone repository.
  3. Configure the .env file.

Running in development.

Running migrate:

sqlx migrate run

Start server:

cargo run

Deploy

Build project:

cargo build --release

Start the executable file:

target/release/rust-api-picpay.exe

API Endpoints

Register a new user.

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

Create a new transaction between users.

POST /api/v1/transaction/create
Parâmetro Tipo Descrição
value integer Transaction value
payer integer Payer user ID
payee integer Payee user ID

Reference

Autores

About

Web aplicattion REST API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages