Skip to content

AaronAWB/SimStocks

Repository files navigation

SimStocks - A Stock Trading Simulator

Try it here.

SimStocks gives users a risk-free way to learn about the stock market and practice investing. Users receive $100,000 in fake cash and can manage their portfolio by buying and selling stocks, informed by current and historic stock data supplied by Finnhub.

stock-portfolio trade_modal

How to use

  1. You will need to create an account. You can do that by clicking on the Sign In or Create an Account button, followed by the Sign Up button on the next page, and selecting a username and password.

  2. If you would prefer to try out the app without creating an account, you can sign in as a guest by clicking the 'GUEST' button on the home page. Guests will be able to view and interact with a pre-populated portfolio, but will not be able to buy or sell stocks.

  3. New accounts will receive $100,000 in fake cash. Once you are signed in, you can search for and purchase your first stock. To do that, click the Trade button in the top navigation bar or the highlighted 'Trade' text on the Home screen. You can search for a stock by its ticker symbol or by its name. Click on a stock to view more information about it. If you would like to purchase shares of the stock, enter the number of shares you would like to purchase and click on the Purchase Share(s) button to complete the transaction.

  4. Navigate to the Portfolio page to view your current holdings. You can click on a stock to view more information about it. If you would like to sell shares of the stock, enter the number of shares you would like to sell and click on the Sell Share(s) button to complete the transaction.

  5. Check back in on your portfolio periodically to see how your stocks are performing!

Technologies and Tools

Client

  • Written with HTML, CSS, and TypeScript, using the React framework.
  • Setup was done using Vite as an alternative to Create React App, allowing aliases for cleaner imports and faster build times.
  • Styling relies primarily on React Bootstrap.
  • Pages are routed using React Router.
  • HTTP calls to the server's REST API are made using the Axios library.
  • Webtokens are stored in localStorage for user authentication.

Server

  • Written in Python using the Flask framework.
  • Webtokens are generated using the PyJWT library.
  • Current and historical stock data is retrieved using the Finnhub API.
  • REST API is built using Flask-RESTX.
  • Database queries are handled using the SQLAlchemy ORM.
  • The app is served using Gunicorn and hosted on AWS Elastic Beanstalk.
  • Data is stored in a PostgreSQL database hosted on elephantsql.com.

Local Setup

  1. Clone this repository to your local machine.
  2. Sign up for free API keys from Finnhub and Financial Modeling Prep.
  3. Run the setup script by typing 'sh setup.sh' in your terminal. This will automatically install the necessary dependencies, create the PostgreSQL database, and start the server.
  4. Navigate to localhost:5000 in your browser to view the app.

Author

Aaron Brinckerhoff - Full Stack Software Developer | LinkedIn | Website

About

Web app drawing on real performance data to give users a risk-free way to learn about the stock market and practice investing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors