GithubHelp home page GithubHelp logo

vickyprahastra / wallet_api Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 48 KB

Test: Internal wallet transactional system (API)

Dockerfile 0.54% Ruby 93.73% Procfile 0.19% JavaScript 0.18% Slim 3.34% Shell 0.57% HTML 1.47%

wallet_api's Introduction

README

Requirement

  • docker
  • docker-compose
  • rails ^6.0.3
  • ruby 3.0.3

How to setup

Setup server

  1. Install git
  2. Install rbenv https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-ubuntu-20-04
  3. rbenv install 3.0.3
  4. Install docker https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04
  5. Install docker-compose https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-compose-on-ubuntu-20-04

Install project

  1. Git Clone
  2. copy .env file from .env.example
  3. docker-compose build
  4. copy master.key from master-example.key
  5. docker-compose up --detach
  6. docker-compose exec web rails db:setup
  7. docker-compose exec web rails db:seed

Documentation

User login

localhost:3000/login

User logout

localhost:3000/logout

User details

localhost:3000

API user login

[POST] localhost:3000/api/session
Keys Values
user[username] user1
user[password] password

API user logout

[DELETE] localhost:3000/api/session

API user transfer

[POST] localhost:3000/api/transfer
Keys Values
transaction[receiver_id] user_id
transaction[amount] amount

API user withdraw

[POST] localhost:3000/api/withdraw
Keys Values
transaction[amount] amount

Custom library "Latest Stock Price"

  1. run rails console or docker-compose exec web rails console

  2. run load "#{Rails.root}/lib/latest_stock_price/client.rb"

  3. run LatestStockPrice::Client.new.price("NIFTY%2050")

    • indices values "NIFTY%2050", "NIFTY%20NEXT%2050", "NIFTY%20100", "NIFTY%20500"
  4. run LatestStockPrice::Client.new.price_all

wallet_api's People

Contributors

vickyprahastra 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.