Coder Social home page Coder Social logo

kittonn / bank4all-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bankforall/api

0.0 0.0 0.0 114 KB

Bangkok Open Source Hackathon 2023 Project.

License: MIT License

JavaScript 93.96% Solidity 5.56% Dockerfile 0.48%
open-source express mongodb

bank4all-api's Introduction

backend

diagram db: https://dbdiagram.io/d/6404ccf2296d97641d8589c7
source api: https://docs.google.com/document/d/1CPJrx3pA0Jv5GVAcEpaOK1QWkTm8xNUX-t-2zn_s8hI/edit


api docs

docs.http file for test API (use REST client vscode extension)


ยังไม่ได้ login

Note set cookies after success
Set-Cookie ใน response headers ใช้สำหรับ auth

POST /signIn
Parameters
name type data type description
username required string email / phoneNumber
password required string N/A
Responses
http code content-type response
200 application/json {"message":"Authentication successful"}
400 application/json {"message":"Invalid password"}
500 application/json {"message":"error"}
POST /signUp
Parameters
name type data type description
fullName required string N/A
email required string N/A
password required string N/A
phoneNumber required string N/A
Responses
http code content-type response
200 application/json {"message": "Registration successful"}
400 application/json {"msg": "something wrong"}

login แล้ว (ยืนยันตัวตนด้วย cookie)

Note จำเป็นต้องมี Cookie ใน headers ตอนส่ง

GET /balanceSummary (BusinessLogic)
Details
totalNumber: totalDeposit + microFinancePotentaiLending + peerSharePotentaiLending
microFinancePotentiaLending: get all peerSharingDetail by userId then sumup potential amount
peerSharePotentaiLending: get all microFinanceDetail by userId then sumup potential amount
Parameters

NONE

Responses
http code content-type response
200 application/json {totalBalance: Number, microFinance: Number, peerShare: Number }
400 application/json {"msg": "something wrong"}
POST /addMoney
Details
  • Front Back Thrid-party API
  • Button addMoney /addMoney–-> username, amount —-> omise/opn
  • OK/NOT OK←—
Parameters
name type data type description
amount required number N/A
Responses
http code content-type response
200 application/json {}
400 application/json {"msg": "something wrong"}
POST /withdrawn
Parameters
name type data type description
amount required number N/A
Responses
http code content-type response
200 application/json {}
400 application/json {"msg": "something wrong"}
GET /peerShareSummary
Parameters

NONE

Responses
http code content-type response
200 application/json {"peerShareTotal":number, "currentDE":string, "creditScore":string}
400 application/json {"msg": "something wrong"}
GET /getAllpeerShareDetail
Details

Member, payment, credit : query from db Joinable: query user credit then check with peerShareDetail credit

Parameters

NONE

peerShareDetail
name data type description
member number N/A
payment number N/A
credit string N/A
joinable boolean N/A
Responses
http code content-type response
200 application/json {"peerShareList": peerShareDetail[]}
400 application/json {"msg": "something wrong"}

bank4all-api's People

Contributors

1tpp avatar kittonn avatar mmenuu avatar pleaseworkibegyou avatar semiangel 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.