/banking_api

A 💸banking api made with 💧Elixir and 🦅 Phoenix.

Primary LanguageElixirApache License 2.0Apache-2.0

BankingApi

Elixir CI

About the project 📜

This project is a challenge of an company 👀💚

The challenge is make a Banking Api, and can

  • Create Users
  • Deposit money in your Account
  • Make withdraws and more

And is builded with:

  • Elixir
  • Phoenix
  • Ecto
  • Docker-Compose

Installing the project 📦

Prerequisites:

  • Elixir
  • Erlang
  • Docker-Compose

The first step is clone the repository to your local machine:

With Https:

git clone https://github.com/jpbrab0/banking_api.git

With SSH:

git clone git@github.com:jpbrab0/banking_api.git

With Github CLI:

gh repo clone jpbrab0/banking_api

Running the project 🏃

  1. Install all dependencies of the project with mix:
  • mix deps.get
  1. Setting up the database:
  • docker-compose up -d
  1. Initialize the phoenix server:
  • iex -S mix phx.server

Run tests 🧪

To run tests, run the following command

mix test

Endpoints

Url: https://localhost:4000/api

Returns the balance of a user.

GET /users/user/:id
Parameter Type
id uuid

Create a user with an account.

POST /users/user
Parameter Type
name string
email string
age integer
cpf string
nickname string
password string

Deposit an quantity in a account.

POST /users/user/deposit 
Parameter Type
id uuid
quantity decimal

Withdraw an quantity in a account.

POST /users/user/withdraw
Parameter Type
id uuid
quantity decimal

Makes a transaction for another account

POST /users/user/transaction 
Parameter Type
sender uuid
receiver uuid
quantity decimal

In sender and receiver the value is the uuid of account sender and account receiver

Todo List 📝

  • Get balance of an account
  • Create User
  • Make deposits
  • Make withdraws
  • Make transfer to anouther account
  • Make User Controllers
  • Make User Views
  • Make Account Controllers
  • Make Account Views
  • Configure Github Actions
  • Deploy the aplication

Made by João Pedro Resende