Giter Site home page Giter Site logo

c1-floatr-backend's Introduction

Floatr Backend

dependencies

node 6.3.x or later and mongodb

getting started

install brew if on mac (why don't you have brew yet?)

brew install mongodb

install nvm

nvm install 6 nvm alias default 6

developing

run mongod on a separated terminal instance:

mongod

first time, install npm:

npm install

run the app:

npm run dev

the app runs on localhost:8080

production

you'll likely be consuming mongodb as a service, so make sure you set the env var to connect to it.

npm start


c1-floatr-backend's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

c1-floatr-backend's Issues

Confirm offer endpoint

  • Create /loan-offer/:id/confirm
  • Create custom controller function
    • Create Loan on backend
    • Transfer principle amount

Payment endpoint

  • Get account for payment
  • Transfer payment
  • Recalculate remaining balance

Return actual user info in place of user id

Current response of loan_offer GET:

[
    {
    "_id": "593847408f888e4460b4a686",
    "loaner": "59383be88684033f23545b9e",
    "min_offer": 400,
    "max_offer": 500,
    "interest_rate": 0.5,
    "period": 3,
    "period_unit": "month",
    "__v": 0
  }
]

What the response should look like after completing this task:

[
  {
    "_id": "593847408f888e4460b4a686",
    "loaner": {
        "_id": "59383be88684033f23545b9e",
        "username": "jason",
        "first_name": "Jason",
        "last_name": "Jason",
        "rating": 5,
        "avatar_url": "http://someurl.com/somepicture.jpg"
      },
    "min_offer": 400,
    "max_offer": 500,
    "interest_rate": 0.5,
    "period": 3,
    "period_unit": "month",
    "__v": 0
  }
]

This should happen anywhere a User ID is currently being returned by itself (loan offer, loan request, loan, payment).

Resources:
https://alexanderzeitler.com/articles/mongoose-referencing-schema-in-properties-and-arrays/

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.