Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/donrestarone/react_rails_stock_ticker
a stock ticker demo app using the polygon API along with React and Rails
https://github.com/donrestarone/react_rails_stock_ticker
Last synced: about 2 months ago
JSON representation
a stock ticker demo app using the polygon API along with React and Rails
- Host: GitHub
- URL: https://github.com/donrestarone/react_rails_stock_ticker
- Owner: donrestarone
- Created: 2024-06-07T18:28:51.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-07T19:00:50.000Z (7 months ago)
- Last Synced: 2024-10-16T04:12:23.548Z (3 months ago)
- Language: Ruby
- Size: 78.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Server setup
set Polygon API key in local environment (depending on your shell, you can set it in `.bashrc` or `.zshrc`)
``` txt
export POLYGON_API_KEY="YOUR-API-KEY-HERE"
```
please reload your shell after, replace .zshrc with the entrypoint to your shell environment
``` bash
source ~/.zshrc
```install dependencies and start server
``` bash
cd server
bundle install
rails s
```## Client setup
``` bash
cd client
npm install
npm run dev
```
## The appvisit http://localhost:5173/ to see the app in action
https://github.com/donrestarone/react_rails_stock_ticker/assets/35935196/ead54c00-8329-40cd-88f5-21a69b0dfe2f
## Notes
1. the local variable `stubbing_for_performance` allows the server to stub its polygon API response to avoid hitting polygon API rate limits (in an attempt to accelerate frontend development)
2. The server will raise a REST API error if `POLYGON_API_KEY` is not set, the message will bubble up to the frontend and be presented to the user via a Javascript alert (API rate limits are bubbled up the same way)
3. The client will cache ticker data in redux to make the UI performant and avoid sending unnecessary requests to the server