This basic stock tracker app was inspired by my experience helping my grandfather check the latest share prices. Utilizing Progressive Web App (PWA) technology allows the app to be easily installed on his phone. The advantages include the ability to zoom in for better visibility, easy to refresh for the latest prices, and a reduced risk of misclicks. The project is developed using Next.js and using edge functions to fetch data from Google Finance.
For instance, the Google Finance URL takes the following format:
https://www.google.com/finance/quote/AMZN:NASDAQ
The application extracts the stock ticket name from this URL (e.g. AMZN:NASDAQ) and uses an edge function to fetch data from the HTML, extracting information based on the specified classes, and rendering it in a simple table.
Clone the repository:
git clone https://github.com/JiaLe0709/finance.git
cd finance
You can install dependencies using npm or bun and start the development server:
npm install && npm run dev
or
bun install && bun dev
Environment Variables:
TICKET=
URL=
Note:
- The TICKET variable can contain multiple values, with both uppercase and lowercase letters allowed. For example:
TICKET=GOOGL:NASDAQ,AMZN:NASDAQ
Ensure these environment variables are set for the app to function correctly:
TICKET=
URL=
-
Deploy the app to Vercel or any other provider that supports hosting Next.js applications.
-
Deploy with Docker:
docker pull jiale0709/finance@latest
This project is licensed under the MIT License.