Skip to content

SanikaVT/trading_simulation_backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dtrade

A stock trade simulation program. With this applciaton the user can gain knowledge and practice trading stock on Dtrade before starting an investment with real money. It allows the user to buy and sell stocks on credit rather than money on real prices. This application will give a chance to learn how stocks work and the risks involved in investment. The purpose of the application is to serve the users who are new to stock investment and looking for a platform to gain some experience without the risk of losing any real money. The application gives a chance to the user to start investment and practice trading with real-time stock prices and makes sure that the users know what they are doing before they start investing.

Authors

Getting Started

Get frontend source code to local
git clone https://git.cs.dal.ca/qsun/csci5709-group23.git
get backend source code to local
git clone https://git.cs.dal.ca/ugandhi/dtradeapi.git

Prerequisites

To have a local copy of this project up and running on your local machine, you will first need to install the following software / libraries / plug-ins

Back end libraries

    "compression": "^1.7.4",
    "concurrently": "^7.2.2",
    "cors": "^2.8.5",
    "dotenv": "^16.0.1",
    "envalid": "^7.3.1",
    "express": "^4.18.1",
    "googleapis": "^105.0.0",
    "helmet": "^5.1.0",
    "joi": "^17.6.0",
    "module-alias": "^2.2.2",
    "mongodb": "^4.7.0",
    "mongoose": "^6.4.1",
    "mongoose-unique-validator": "^3.1.0",
    "morgan": "^1.10.0",
    "nodemailer": "^6.7.7",
    "nodemon": "^2.0.18",
    "random-number": "^0.0.9"
    "@types/compression": "^1.7.2",
    "@types/express": "^4.17.13",
    "@types/morgan": "^1.9.3",
    "@types/node": "^18.0.0",
    "@typescript-eslint/eslint-plugin": "^5.30.0",
    "@typescript-eslint/parser": "^5.30.0",
    "eslint": "^8.18.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-plugin-prettier": "^4.2.1",
    "prettier": "^2.7.1",
    "tsc-watch": "^5.0.3",
    "typescript": "^4.7.4"

Frontend

    "@date-io/date-fns": "^2.14.0",
    "@emotion/react": "^11.9.0",
    "@emotion/styled": "^11.8.1",
    "@material-ui/core": "^4.12.4",
    "@mui/icons-material": "^5.8.3",
    "@mui/lab": "^5.0.0-alpha.85",
    "@mui/material": "^5.8.1",
    "@mui/styled-engine-sc": "^5.8.0",
    "@mui/system": "^5.8.1",
    "@mui/x-data-grid": "^5.11.1",
    "@mui/x-date-pickers": "^5.0.0-alpha.6",
    "@splidejs/react-splide": "^0.7.7",
    "@types/date-fns": "^2.6.0",
    "@types/node": "^16.11.36",
    "@types/react-dom": "^18.0.5",
    "@types/styled-components": "^5.1.25",
    "axios": "^0.27.2",
    "bcryptjs": "^2.4.3",
    "bootstrap": "^5.1.3",
    "chart.js": "^3.8.0",
    "d3": "^7.4.4",
    "date-fns": "^2.28.0",
    "express": "^4.18.1",
    "framer-motion": "^6.3.5",
    "json-2-csv": "^3.17.1",
    "npm": "^8.11.0",
    "react": "^18.1.0",
    "react-bootstrap": "^2.4.0",
    "react-chartjs-2": "^4.2.0",
    "react-csv": "^2.2.2",
    "react-dom": "^18.1.0",
    "react-fast-marquee": "^1.3.2",
    "react-grid-system": "^8.1.5",
    "react-modal": "^3.15.1",
    "react-redux": "^8.0.2",
    "react-router-dom": "^6.3.0",
    "react-scripts": "5.0.1",
    "react-simple-chatbot": "^0.6.1",
    "react-toastify": "^9.0.4",
    "react-tooltip": "^4.2.21",
    "reactjs-popup": "^2.0.5",
    "styled-components": "^5.3.5",
    "typescript": "^4.6.4"


See the following section for detailed step-by-step instructions on how to install this software / libraries / plug-ins

Installing

A step by step series of examples that tell you how to get a development env running

1. Install node js
2. Verify installation by running node -v and npm -v on the terminal.
3. npm install
4. npm start

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode. Open [http://localhost:3100] to view it in your browser.

The page will reload when you make changes. You may also see any lint errors in the console.

npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

npm run build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

###Code Integration Buying and selling a stock is dependedent on the user profile module. If a user has credits then only he can buy stocks. Also, when the user buys a stock, credits gets deducted from the user. If the user credits are not enough, he/she wont be able to buy a stock. When the user sells a stock, the amount at that time for that stock gets credited to the user account.

Deployment

We have hosted our application on the Heroku Platform. We have first build our react application using the npm run build command. Then on the backend express server we have served the link to our static application that we have built using the npm run build command. Once we have successfully tested our application locally we have finally hosted the application on Heroku platform.

1. Create a heroku account and create a empty applciaton
2. In terminal run "heroku login"
3. Enter local project folder run following command to initialize git
    $ cd my-project/
    $ git init
    $ heroku git:remote -a test-qiwei
4. commite your changes and deploy to heroku
    $ git add .
    $ git commit -am "make it better"
    $ git push heroku master

Sources used

Built With

Acknowledgments

References

About

Stock market trading application backend using node JS

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published