Git Product home page Git Product logo

stock-price-predictor's Introduction

Stock Price Predictor

A project to start learning about machine learning in Javascript. Utilizing the Brain.js library and the stock prices API provided by Alphavantage.

The aim of the server will take a stock symbol, pull the last 100 days of stock data from Alphavantage then make a prediction on what the stock price will be today! We also save each prediction in a database to make checking if the predictions came true.

I also wanted to use this project as an opportunity to work with Server Side Rendering of a client app. I chose Pug as a template engine and run all the basic functionality of the client though vanilla Javascript. All the client side files can be found in the public and views folders.

Prerequisites

  • A MongoDB instance running

Getting Started

  • Clone the repo
  • Run npm i
  • Add a .env file and add:
JWT_SECRET=<anything you want>
ALPHA_VANTAGE_KEY=<API key from Alphavantage>
  • npm run start in the terminal to get the project running on port:8080

  • Then visit http://localhost:8080/ in your browser to access the app.

Calling the API

Currently the only route that can be called on the api is:

http://localhost:8080/api/stocks/get-stock-prediction/:stock

params:
stock - needs to be a valid stock symbol e.g AAPL or MSFT

You will then get a response back that looks like this:

{
    "success": true,
    "message": "Prediction made successfully!",
    "data": [
        {
            "open": 196.95269326686858,
            "high": 200.28645069122314,
            "low": 195.04503690719602,
            "close": 195.04503690719602
        }
    ]
}

stock-price-predictor's People

Contributors

benakehurst avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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