{"id":29617141,"url":"https://github.com/apostolispat/stockwatchlist","last_synced_at":"2026-04-18T09:32:23.414Z","repository":{"id":300921564,"uuid":"1003691684","full_name":"ApostolisPat/StockWatchlist","owner":"ApostolisPat","description":"A sample app for playing around the FastApi framework and yFinance API","archived":false,"fork":false,"pushed_at":"2025-06-24T08:40:10.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-24T09:44:09.150Z","etag":null,"topics":["fastapi","python","yfinance"],"latest_commit_sha":null,"homepage":"","language":"Python","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/ApostolisPat.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-06-17T14:20:01.000Z","updated_at":"2025-06-24T08:41:33.000Z","dependencies_parsed_at":"2025-06-24T09:44:15.508Z","dependency_job_id":"6471b9c3-8703-4000-8c6d-d8a29797008d","html_url":"https://github.com/ApostolisPat/StockWatchlist","commit_stats":null,"previous_names":["apostolispat/stockwatchlist"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ApostolisPat/StockWatchlist","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApostolisPat%2FStockWatchlist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApostolisPat%2FStockWatchlist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApostolisPat%2FStockWatchlist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApostolisPat%2FStockWatchlist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ApostolisPat","download_url":"https://codeload.github.com/ApostolisPat/StockWatchlist/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApostolisPat%2FStockWatchlist/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266226352,"owners_count":23895692,"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","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":["fastapi","python","yfinance"],"created_at":"2025-07-21T01:34:05.871Z","updated_at":"2026-04-18T09:32:18.367Z","avatar_url":"https://github.com/ApostolisPat.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StockWatchlist\n\nA FastAPI application that allows users to register, log in, and manage a personalized stock watchlist. Stock data is fetched live using [yfinance](https://github.com/ranaroussi/yfinance).\n\n## Features\n\n- User registration and authentication (JWT-based)\n- Add/remove stocks to/from your watchlist\n- Fetch real-time stock data for your watchlist\n- Secure endpoints (only authenticated users can manage their watchlist)\n- SQLite database with SQLAlchemy ORM\n\n## Requirements\n\n- Python 3.10+\n- [FastAPI](https://fastapi.tiangolo.com/)\n- [SQLAlchemy](https://www.sqlalchemy.org/)\n- [yfinance](https://github.com/ranaroussi/yfinance)\n- [bcrypt](https://pypi.org/project/bcrypt/)\n- [python-dotenv](https://pypi.org/project/python-dotenv/)\n- [python-jose](https://python-jose.readthedocs.io/en/latest/)\n\nInstall dependencies:\n```sh\npip install fastapi uvicorn sqlalchemy yfinance bcrypt python-dotenv python-jose\n```\n\n## Setup\n\n1. **Clone the repository** and navigate to the project folder.\n\n2. **Create a `.env` file** in the project root with the following content:\n    ```\n    SECRET_KEY=your_secret_key\n    ALGORITHM=HS256\n    ACCESS_TOKEN_EXPIRE_MINUTES=30\n    ```\n\n3. **Run the application:**\n    ```sh\n    uvicorn main:app --reload\n    ```\n\n4. **Access the API docs:**  \n   Open [http://localhost:8000/docs](http://localhost:8000/docs) in your browser.\n\n## API Endpoints\n\n### User\n\n- `POST /users/register`  \n  Register a new user.\n\n- `POST /users/login`  \n  Obtain a JWT token (use `username` and `password` as form fields).\n\n- `GET /users/profile`  \n  Get the current user's profile (requires authentication).\n\n### Watchlist\n\n- `POST /watchlist?symbol=SYMBOL`  \n  Add a stock symbol to your watchlist.\n\n- `GET /watchlist`  \n  Get all stocks in your watchlist with live data.\n\n- `DELETE /watchlist?symbol=SYMBOL`  \n  Remove a stock symbol from your watchlist.\n\n## Example Usage\n\n1. **Register:**\n    ```json\n    POST /users/register\n    {\n      \"username\": \"alice\",\n      \"email\": \"alice@example.com\",\n      \"password\": \"yourpassword\"\n    }\n    ```\n\n2. **Login:**\n    ```json\n    POST /users/login\n    {\n      \"username\": \"alice\",\n      \"password\": \"yourpassword\"\n    }\n    ```\n    Response:\n    ```json\n    {\n      \"access_token\": \"your.jwt.token\",\n      \"token_type\": \"bearer\"\n    }\n    ```\n\n3. **Add to Watchlist:**\n    ```\n    POST /watchlist?symbol=AAPL\n    Authorization: Bearer \u003caccess_token\u003e\n    ```\n\n4. **Get Watchlist:**\n    ```\n    GET /watchlist\n    Authorization: Bearer \u003caccess_token\u003e\n    ```\n\n5. **Remove from Watchlist:**\n    ```\n    DELETE /watchlist?symbol=AAPL\n    Authorization: Bearer \u003caccess_token\u003e\n    ```\n\n## Project Structure\n\n```\nStockWatchlist/\n│\n├── main.py\n├── models.py\n├── schemas.py\n├── database.py\n├── auth.py\n├── routers/\n│   ├── users.py\n│   └── watchlist.py\n├── utils/\n│   └── stock_validator.py\n├── .env\n└── README.md\n```\n\n## Notes\n\n- All watchlist endpoints require authentication via JWT.\n- Stock data is fetched live from Yahoo Finance using `yfinance`.\n- Passwords are securely hashed using `bcrypt`.\n\n---\n\n**Enjoy managing your stock watchlist!**","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapostolispat%2Fstockwatchlist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapostolispat%2Fstockwatchlist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapostolispat%2Fstockwatchlist/lists"}