MIT Fullstack Banking Application

Requirements

  • User can create an account with an email address and password input field
  • User receives a success message after creating an account
  • After creating an account, email address or username appears in the top right corner
  • User can log in to an account with an email address/password or OAuth
  • User can log out of an account
  • User can deposit money
  • Total balance updates according to deposit amount
  • User can withdraw money
  • Total balance updates according to withdrawal amount
  • The total balance amount and any other user input persists through different user sessions
  • Logging out of the application does not reset the user data
  • A screenshot showing a data representation of user information and account balance is uploaded

Data Representation

Data Representation

Contributing

Prerequisites

  1. Install homebrew on macOS

  2. Install mongodb with homebrew

    brew tap mongodb/brew
    brew install mongodb-community
    brew services start mongodb-community
    ## Use the following command to stop it
    #brew services stop mongodb-community
  3. Install Heroku CLI with homebrew

    brew install heroku/brew/heroku
  4. Install NVM

    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
  5. Install Node.js with NVM

    nvm install lts/fermium
    nvm use lts/fermium
  6. Upgrade npm to npm 8

    npm install --global npm@8
  7. Install Docker Desktop Personal

Run

  • To run locally, execute:

    nvm use
    npm install
    npm run dev

    Then, open http://localhost:3000 with your browser to see the result

  • To run inside docker, execute:

    nvm use
    npm install
    npm run docker:start

    Then, open http://localhost:3000 with your browser to see the result

Deploy

  1. Create a MongoDB Atlas account (See https://www.mongodb.com/developer/products/atlas/use-atlas-on-heroku/)

  2. Create a new project

  3. Create a shared cluster

  4. Create a user, make sure to take note of the password

  5. Set the conection from the cloud

  6. Add IP 0.0.0.0 to the permitted IPs

  7. Copy the connection string for the application

  8. Replace the <password> placeholder in the connection string and take note of it

  9. Create your heroku app

    heroku login
    heroku container:login
    heroku create mit-fullstack-banking-app
    heroku config:set MONGODB_URI=<URI_FROM_STEP_8>
    heroku container:push web
    heroku container:release web
    heroku open
    heroku logs --tail
    heroku logout

Print data representation in the terminal

mongo myproject --eval 'db.users.find().pretty()'

Resources