Buy and Sell stocks throughout the past year. With time travel! Use this project live on Heroku.
The Historic Stock Portfolio is a React/Redux single page application (SPA) that uses React Router and is served from an Express.js server running in a Node.js environment. Historic stock data is gathered from the Quandl API.
You can buy and sell stocks from the trade page. Adjust the slider to change the current date. Feel free to buy stocks at their low point, then time travel and sell at their highest! Your Portfolio will keep track of your investments as you move forward and backwards, as well as your cost basis and current profit/loss. If a stock price is marked with an "x" it means that stock price data is not available for that day (probably because it falls on a weekend or holiday).
To look back on your amazingly farsighted decisions, click the link or selector to view your previous Transactions. Stock prices are shown along with their performance over the past day, past 7 days, and past 30 days. Just don't refresh the page or navigate away. None of your data will be saved and all your time traveling will be for nought.
To run this project locally, you'll need to have Node.js and Node Package Manager installed. You'll also need an API key from Quandl. Save a .env file in the server directory with the text "api_key=" followed by your API key.
Once your setup is complete, run "npm install" in the directory's server terminal to install server dependencies. Then run "npm run start" to boot up your server. While the server is running, open up the client directory in your terminal. Run "npm install". When that's complete, run "npm start". If you've made it this far, congratulations! You're done with the setup. Just navigate to "http://localhost:3000" in your browser to enjoy this amazing time traveling stock portfolio simulator!