diff options
author | sotech117 <michael_foiani@brown.edu> | 2025-08-26 23:37:53 -0400 |
---|---|---|
committer | sotech117 <michael_foiani@brown.edu> | 2025-08-26 23:37:53 -0400 |
commit | a89d60f5886426f12e5d614285fbb51d788c2e75 (patch) | |
tree | 8caa063805c7b81d1f6e33c1efabb4bf819dd207 /README.md | |
parent | 92bd0f599de615667ffea46daeb4ed00d4a27a5c (diff) |
added server code and readme
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..84f97e7 --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +# S&P 500 Stock Screener + +A simple Node.js application for screening stocks and uploading that data to a google spreadsheet, without any external dependencies. + +## Setup + +1. **Clone the repository:** + ```bash + git clone https://www.git.mfoi.dev/stock-screener.git/ + cd stock-screener + ``` + +2. **Configure environment variables:** + - Create a `.env` file in the root directory following the template. + - Example `.env`: + ``` + PORT=3000 + STOCK_SCREENER_AUTH_TOKEN=1234567 + ``` + +## Running the Server + +First, [install Node.js](https://nodejs.org/en/download/) if you haven't already. + +Start the server with: +```bash +node server.js +``` + +The server will run on the port specified in your `.env` file. + +## Usage + +The server has two purposes: +1. Update the stock metrics to the spreadsheet weekly. +2. Provide a REST API for updating the spreadsheet on demand. +The only endpoint is `http://localhost:{env.PORT}/api/update-stock-screener?token=${env.STOCK_SCREENER_AUTH_TOKEN}`. + +This is meant to be run in the background but still allows for manual triggering via the API. Obviously, you should secure this endpoint in a production environment. |