rails-bank-account

  • This is a simple bank account app to test Omniauth framework and Oauth2.0

Stack

  • Ruby 3.1.1
  • Rails 7.0.4.3
  • Sqlite
  • Tailwind

Setup

  • bin/setup
  • docker-compose up (build image and create postgresql database container)
  • gem install foreman (run rails s with tailwind)

Problems with setup

  • Error when installing PG gem
gem install pg -- --with-pg-config=/usr/local/Cellar/libpq/15.3/bin/pg_config -v 1.4.6
  • Error related to postgres with rails console
brew install libpq postgresql@14

Heroku

  • deploy -> git push heroku main
  • migrate -> heroku run rake db:migrate

Run application

  • bin/dev

App endpoints (POST)

{
    "email": "banana@bol.com"
}

{
    "user_id": 3,
    "bank_number": "123",
    "agency_number": "123",
    "account_number": "123"
}

{
    "bank_number": "123",
    "agency_number": "123",
    "account_number": "123",
    "amount_cents": "1000"
}

{
    "bank_number": "123",
    "agency_number": "123",
    "account_number": "123",
    "amount_cents": "1000"
}