{"id":29865723,"url":"https://github.com/joshbaneycs/stock-tracker","last_synced_at":"2025-07-30T11:39:03.767Z","repository":{"id":304181056,"uuid":"1018022709","full_name":"JoshBaneyCS/stock-tracker","owner":"JoshBaneyCS","description":"My first attempt at making a Dockerized stock platform with Golang backend and ReackJS frontend","archived":false,"fork":false,"pushed_at":"2025-07-11T14:36:42.000Z","size":68,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-11T15:49:44.592Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JoshBaneyCS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-11T13:27:49.000Z","updated_at":"2025-07-11T14:36:45.000Z","dependencies_parsed_at":"2025-07-11T15:59:56.224Z","dependency_job_id":null,"html_url":"https://github.com/JoshBaneyCS/stock-tracker","commit_stats":null,"previous_names":["joshbaneycs/stock-tracker"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/JoshBaneyCS/stock-tracker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshBaneyCS%2Fstock-tracker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshBaneyCS%2Fstock-tracker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshBaneyCS%2Fstock-tracker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshBaneyCS%2Fstock-tracker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JoshBaneyCS","download_url":"https://codeload.github.com/JoshBaneyCS/stock-tracker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshBaneyCS%2Fstock-tracker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267858886,"owners_count":24155983,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-30T11:39:03.112Z","updated_at":"2025-07-30T11:39:03.750Z","avatar_url":"https://github.com/JoshBaneyCS.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📈 Stock Tracker\n\nA full-stack, real-time stock tracking and alerting web application built with **React**, **Go**, **Python**, and **MySQL** — fully containerized with **Docker**. Users can register, select up to 50 stocks, view live graphing and history, set alerts, and customize their settings.\n\n---\n\n## 📁 Project Directory Structure\n\nstock-tracker/\n├── backend/\n│   ├── main.go\n│   ├── handlers/\n│   ├── models/\n│   ├── middleware/\n│   ├── utils/\n│   ├── stock_fetcher.py\n│   ├── requirements.txt\n│   └── go.mod\n│\n├── frontend/\n│   ├── public/\n│   ├── src/\n│   │   ├── pages/\n│   │   ├── components/\n│   │   └── index.js\n│   ├── Dockerfile\n│   └── package.json\n│\n├── db/\n│   └── schema.sql\n├── .env\n├── docker-compose.yml\n└── README.md\n\n---\n\n\u003cdetails\u003e\n\u003csummary\u003e🧠 Backend Stack\u003c/summary\u003e\n\n- **Language:** Go (Golang)\n- **Framework:** `gin-gonic`\n- **Authentication:** JWT (stored in client storage)\n- **Email Alerts:** SMTP via `net/smtp`\n- **Data Fetching:** Calls a Python script (`stock_fetcher.py`) using `os/exec`\n- **Python Dependencies:** `yfinance`, `pandas`, `numpy`\n- **Database:** MySQL 8.x via GORM ORM\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e🎨 Frontend Stack\u003c/summary\u003e\n\n- **Library:** React (with React Router v6)\n- **Graphing:** Chart.js via `react-chartjs-2`\n- **API:** Axios for HTTP requests\n- **Styling:** CSS modules + responsive layout\n- **Background:** [particles.js](https://vincentgarreau.com/particles.js/)\n- **Session:** JWT stored in `localStorage`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e⚙️ Technology Stack\u003c/summary\u003e\n\n- **Frontend:** React + Chart.js\n- **Backend:** Go + Python\n- **Database:** MySQL\n- **Containerization:** Docker\n- **Email + Alerts:** SMTP\n- **Currency Conversion:** exchangerate.host\n- **Reverse Proxy (optional):** Nginx\n\n\u003c/details\u003e\n\n---\n\n## 🛠️ Installation Guide\n\n### Prerequisites\n\n- [Docker](https://www.docker.com/products/docker-desktop)\n- [Docker Compose](https://docs.docker.com/compose/)\n- (Optional) Python installed locally for testing `stock_fetcher.py`\n\n---\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/JoshBaneyCS/stock-tracker.git\ncd stock-tracker\n```\n### 2. Setup Environment Variables\nCreate a .env file in the project root:\n\n```.env\nPORT=8080\nDB_HOST=db\nDB_PORT=3306\nDB_USER=root\nDB_PASS=password\nDB_NAME=stocktracker\n\nJWT_SECRET=supersecretjwtkey\nEMAIL_USER=your_email@gmail.com\nEMAIL_PASS=your_email_password\n```\n### 3. Build and Run!\n```bash\ndocker-compose up --build\n```\nThis will:\n\nBuild and run the Go backend + Python inside 1 container\n\nServe the React frontend via Nginx on port 3000\n\nSet up a MySQL database and schema\n\n### 4. Open in Browser\nFrontend: http://localhost:3000 (Or whatever you have your port mapped to)\n\nBackend API: http://localhost:8080 (Or whatever you have your port mapped to)\n\n## 🔐 Default Routes\n\nMethod\tEndpoint\tDescription\nPOST\t/register\tRegister a new user\nPOST\t/login\tLogin and get JWT\nGET\t/api/favorites\tGet user’s saved stocks\nPOST\t/api/favorites\tSave user’s selected stocks\nGET\t/api/stocks\tFetch live stock data\nGET\t/api/settings\tGet user profile/settings\nPOST\t/api/settings\tUpdate name, email, etc.\nPOST\t/api/alerts\tCreate price alert\nGET\t/api/alerts\tView all alerts\nDELETE\t/api/alerts/:id\tDelete alert\n\nJWT must be sent as a Bearer token in Authorization headers for protected endpoints.\n\n\n## 📧 Features\n\n- ✅ User authentication (JWT-based login/register)\n- ✅ Select up to 50 favorite stocks\n- ✅ Market index toggle support (e.g., S\u0026P 500)\n- ✅ Real-time stock graphing (using Chart.js)\n- ✅ Custom color-coded lines per stock\n- ✅ Search bar to quickly find stocks\n- ✅ Historical data box (market cap, high/low, etc.)\n- ✅ Auto-refresh every 5 minutes\n- ✅ Email alerts when price reaches or falls below threshold\n- ✅ Currency conversion via exchangerate.host\n- ✅ Customizable account settings (name, email, password, currency)\n- ✅ IP address is logged on login and registration\n- ✅ Dockerized with flexible port management via `.env`\n- ✅ Front page includes `particles.js` animated background and logo\n\n## 🔐 Security Notes\n\n- Passwords are hashed securely using **bcrypt**\n- JWTs are used for stateless authentication\n- Frontend stores JWT in `localStorage`\n- CSRF is avoided by using token-only auth\n- SMTP email alerts use secure environment variables\n\n## 🧪 Development Notes\n\nTo test the Python stock data script locally:\n```bash\ncd backend\npip install -r requirements.txt\npython3 stock_fetcher.py AAPL TSLA\n```\n\nThis will return a JSON response for the given stock tickers.\n\n\n## 📜 License\n\nThis project is licensed under the MIT License. You may use, modify, and distribute it freely, with proper attribution.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshbaneycs%2Fstock-tracker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshbaneycs%2Fstock-tracker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshbaneycs%2Fstock-tracker/lists"}