Web application that allows you to simulate trades in the stock market without using any real money.
Sign Up:
SignUp.mov
Stock Search:
StockSearch.mov
Held Positions:
Positions.mov
Watchlist:
Watchlist.mov
Portfolio Reset:
Reset.mov
- Next.js -
npm install next
- React.js -
npm install react
- react-dom -
npm install react-dom
Run all these commands at once with npm install next react react-dom
- MongoDB either through the cloud with Atlas or locally (preferably along with Compass)
- A TD Ameritrade developer account
- After signing up, you need to get your User Principal Details manually (everyday).
I plan to make this a process that can be done programmatically, but for now:
- Enter
streamerSubscriptionKeys,streamerConnectionInfo
into the fields parameter - Click on the OAuth 2.0 Button and authenticate with your TD Ameritrade account.
- Click Send, and copy the JSON from the Response section, making sure that
streamerSubscriptionKeys
is part of the response. - Paste this json in a file named
userprincipal.json
in the pages/api folder inside the client directory.
- Enter
- After signing up, you need to get your User Principal Details manually (everyday).
I plan to make this a process that can be done programmatically, but for now:
- A RapidAPI account
- Create an app by clicking My Apps then Add New App
- Enter a name of your choosing then click Save.
- Under the My Apps section, click on the name of your app.
- Click Security then the eye icon to reveal your Application key
- Copy that key into a .env file in the server folder, with the key name RAPID_API_YAHOO_KEY
- Subscribe to the YFINANCE API
.env
file for serverFRONTEND_BASE_URL="http://localhost:3000"
or whatever port your frontend is running on.RAPID_API_YAHOO_KEY=[insert your api key here]
.env.local
for clientNEXT_PUBLIC_API_BASE_URL="http://localhost:3011"
or whatever port your backend is running on.
Once everything is set up open two terminals, one each for both the client and server programs.
Assuming you start at the root of the project:
cd server
npm install
npm run start
- The server will be used to respond to various requests in the client-side
- You can see the various endpoints set up by accessing the index at http://localhost:3011
In the other terminal instance,
cd client
npm install
npm run dev
ORnpm run deploy
for a production build.- Open a browser and head to http://localhost:3000