Coder Social home page Coder Social logo

cute-bank's Introduction

Cute Bank

Getting Started

  1. Clone and Install
    • Clone the repository and install the required dependencies.
git clone [email protected]:hnrbs/cute-bank.git
mix deps.get
  1. Build Containers
    • Set up your database configuration and any environment-specific settings.
docker-compose up -d
  1. Database Migration
    • Run database migrations to create the necessary tables.
mix ecto.create
mix ecto.migrate
  1. Running the Application
    • Start the application and ensure it's accessible.
mix phx.server

Authentication

Authentication is required for some of the endpoints. Make sure to include appropriate authentication tokens in your requests when accessing protected routes.

API Endpoints

Health Check

  • GET /api/health_check
    • Endpoint for checking the health status of the system.

User Management

  • POST /api/user/create
    • Create a new user account.
{
  "user": {
    "first_name": "John",
    "last_name": "Doe",
    "cpf": "000.000.000-00",
    "password": "s3cure_pa$sword",
  }
}
  • POST /api/user/login
    • Log in an existing user.
{
  "cpf": "000.000.000-00",
  "password": "s3cure_pa$sword"
}

Transaction Management

  • POST /api/transaction/search
    • Search for transactions between a date range.
{
   "start_date": "2023-10-26T12:23:19Z"
   "end_date": "2023-10-27T15:29:19Z"
}
  • POST /api/transaction/create
    • Create a new transaction.
{
  "transaction": {
    "amount": 5000,
    "receiver_cpf": "000.000.000-00",
  }
}
  • POST /api/transaction/refund
    • Initiate a refund for a transaction.
{
  "transaction_id": "01ec23e3-6a91-4a0a-9b01-291b27f6ee3f"
}
  • GET /api/transaction
    • Retrieve a list of transactions.

Balance Management

  • POST /api/balance/withdraw
    • Withdraw funds from a user's balance.
{
  "amount": 5000
}
  • POST /api/balance/deposit
    • Deposit funds into a user's balance.
{
  "amount": 5000
}
  • GET /api/balance

    • The logged user's balance is displayed.
  • GET /api/balance/check

    • Check if the user's balance is valid based on the sum of the user transactions.

cute-bank's People

Contributors

nothenrin avatar

Stargazers

Juliano Firme avatar Brenno Rodrigues avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.