Code Monkey home page Code Monkey logo

kashbase-test's Introduction

Kashbase Test

Written in Laravel ❤️

Tasks

Create 3 Microservices (Bank Transfer, SMS, Payment)

  • Transfer (Paystack)
  • Payment (Paystack Service)
  • SMS (my.sendchamp.com)
    • A user should be able to transfer fund and receive SMS
    • A user should be able to pay and receive SMS

How to setup

  • clone repo

git clone [email protected]:markowitz/kashbase-test.git

  • Change directory to the repository folder

cd kashbase-test

  • run composer update for all microservices

sh composer-update-all.sh

  • cd into api folder and update env with db credentials

cd api

  • run docker for all microservices

sh run.sh

  • cd into the microservices and update the necessary third party endpoints and secret keys

  • enter into the api microservice

docker exec -it kashbase.router bash

  • then run

php artisan migrate --seed

Routes

  • url POST {base_url}/api/v1/authenticate

    • params

    `{

    email:[email protected]
    
    password:password
    

    `}

  • url POST {base_url}/api/v1/transfer/initiate

    - params
    
    > `{ 
    >
    >     account_number:0000000000
    >
    >     bank_code:011
    >
    >    `}
    
  • url POST {base_url}/api/v1/transfer/send

    - params
    
    > `{ 
    >
    >     amount:100000
    >
    >     recipient:RCP_t2o5h99jc55q54n
    >
    >     reason:flex bro
    >
    >     currency:NGN
    >    `}
    
  • url POST {base_url}/api/v1/transfer/finalize

    - params
    
    > `{ 
    >
    >     otp:864970
    >
    >     transfer_code:TRF_ihoddl0d1rajkzf
    >    `}
    
  • url POST {base_url}/api/v1/payments/pay

    - params
    
    > `{ 
    >
    >     email:[email protected]
    >
    >     amount:100000
    >    `}
    

Notes

  • for the authentication i used laravel sanctum, for better authentication we can use laravel passport for better security and access level to endpoints.
  • There are serveral ways microservices can communicate with each other there's RPC, Events and rest. i opted to use Events
  • I also logged my response from the sms. There are other ways to monitor if the event failed.

kashbase-test's People

Contributors

markowitz avatar

Watchers

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