{"id":16317049,"url":"https://github.com/leftmove/pinestreetlocal","last_synced_at":"2025-03-20T22:30:44.576Z","repository":{"id":218129888,"uuid":"745684004","full_name":"leftmove/pinestreetlocal","owner":"leftmove","description":"Free and open-source stock tracking website for America's biggest money managers. Democratizing SEC filings by making them more accessible and useful.","archived":false,"fork":false,"pushed_at":"2024-04-13T03:10:25.000Z","size":48345,"stargazers_count":31,"open_issues_count":3,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-13T16:36:11.039Z","etag":null,"topics":["13f","docker","fastapi","grafana","loki","meilisearch","mongodb","nginx-proxy-manager","opentelemetry","prometheus","python","redis","sec-api","tempo","uvicorn"],"latest_commit_sha":null,"homepage":"https://content.wallstreetlocal.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leftmove.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.MD","code_of_conduct":"CODE_OF_CONDUCT.MD","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-01-19T21:40:27.000Z","updated_at":"2024-04-25T03:30:54.923Z","dependencies_parsed_at":"2024-02-18T02:27:41.196Z","dependency_job_id":"84d1c9fd-0b23-42a3-8e73-eabaa0182e03","html_url":"https://github.com/leftmove/pinestreetlocal","commit_stats":null,"previous_names":["bruhbruhroblox/pinestreetlocal","leftmove/pinestreetlocal"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leftmove%2Fpinestreetlocal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leftmove%2Fpinestreetlocal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leftmove%2Fpinestreetlocal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leftmove%2Fpinestreetlocal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leftmove","download_url":"https://codeload.github.com/leftmove/pinestreetlocal/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244085005,"owners_count":20395523,"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":["13f","docker","fastapi","grafana","loki","meilisearch","mongodb","nginx-proxy-manager","opentelemetry","prometheus","python","redis","sec-api","tempo","uvicorn"],"created_at":"2024-10-10T22:06:28.162Z","updated_at":"2025-03-20T22:30:44.248Z","avatar_url":"https://github.com/leftmove.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\r\n  \u003ca href=\"https://wallstreetlocal.com\" target=\"_blank\"\u003e\r\n    \u003cpicture\u003e\r\n      \u003cimg alt=\"wallstreetlocal\" src=\"https://raw.githubusercontent.com/leftmove/pinestreetlocal/main/static/logo.png\" style=\"max-width: 100%;\"\u003e\r\n    \u003c/picture\u003e\r\n  \u003c/a\u003e\r\n\u003c/p\u003e\r\n\r\n\u003cp align=\"center\"\u003e\r\n  A website that allows you to view the investments of America's largest investors.\r\n\u003c/p\u003e\r\n\u003cp align=\"center\"\u003e\r\n  This repository holds the back-end code for wallstreetlocal, for the front-end, see \u003ca href=\"https://github.com/leftmove/walltreetlocal\" target=\"_blank\" \u003ehere\u003c/a\u003e.\r\n\u003c/p\u003e\r\n\r\n\u003ch2 align=\"center\"\u003e\r\n  This repository is deprecated. The code was merged into wallstreetlocal's \u003ca src=\"https://github.com/leftmove/wallstreetlocal\"\u003emain repository\u003c/a\u003e.\r\n\u003c/h2\u003e\r\n\r\n### Getting Started\r\n\r\nThis project uses Docker, to deploy, run the following command.\r\n\r\n```bash\r\ndocker compose up -f docker-compose.yaml up\r\n```\r\n\r\n#### Third Party APIs\r\n\r\nTo run both the development and production builds, you will need to have environment variables for third party APIs. Most of the environment variables in the provided compose files you can keep as is, but for the API keys you will need to visit the following services.\r\n\r\n- [Alpha Vantage](https://www.alphavantage.co/)\r\n- [OpenFIGI](https://www.openfigi.com/)\r\n- [Finnhub](https://finnhub.io/)\r\n\r\nThese three different services allow for the most up-to-date and accurate data, while also avoiding rate-limiting.\r\n\r\n#### Telemetry\r\n\r\nFor telemetry, wallstreetlocal uses [Sentry](https://sentry.io/). You can sign up [here](https://sentry.io/signup/).\r\n\r\n_Sentry is a paid service, although it has a free trial. If you are a student, there is also a free upgrade available._\r\n\r\n### Development\r\n\r\nThe development build is mainly made for testing, so it is ideal for self-hosting.\r\n\r\nA full list of this app's microservices.\r\n\r\n- FastAPI for the main application\r\n- MongoDB for the database\r\n- Redis for cache\r\n- Meilisearch for search\r\n- Sentry for telemetry\r\n\r\nTo run the full app, you need the microservices running through Docker, and the main application running seperately.\r\n\r\n1. Run the microservices by calling the development `docker-compose.yaml`.\r\n\r\n```bash\r\ndocker compose -f docker-compose.yaml up\r\n```\r\n\r\n2. Run the main application (with configured environment variables).\r\n\r\n```bash\r\npython main.py\r\n```\r\n\r\n`docker-compose.yaml` (Development)\r\n\r\n```yaml\r\nservices:\r\n  cache:\r\n    container_name: cache\r\n    build:\r\n      context: ./cache\r\n      dockerfile: Dockerfile\r\n    restart: always\r\n    networks:\r\n      - staging\r\n    ports:\r\n      - 6379:6379\r\n  database:\r\n    container_name: database\r\n    build:\r\n      context: ./database\r\n      dockerfile: Dockerfile\r\n    volumes:\r\n      - ./database/main_db:/data/db\r\n    restart: always\r\n    networks:\r\n      - staging\r\n    ports:\r\n      - 27017:27017\r\n  search:\r\n    container_name: search\r\n    build:\r\n      context: ./search\r\n      dockerfile: Dockerfile\r\n    volumes:\r\n      - ./search/search_db:/meili_data\r\n    restart: always\r\n    networks:\r\n      - staging\r\n    ports:\r\n      - 7700:7700\r\n\r\nnetworks:\r\n  staging:\r\n    driver: bridge\r\n```\r\n\r\nExample `.env` (Development)\r\n\r\n```env\r\nSERVER = \"127.0.0.1\"\r\nAPP_NAME = \"backend\"\r\nENVIRONMENT = \"development\"\r\nADMIN_PASSWORD = \"***********\"\r\nDEBUG_CIK = \"1067983\"\r\n\r\nWORKERS = 1\r\nHOST = \"0.0.0.0\"\r\nEXPOSE_PORT = 8000\r\nFORWARDED_ALLOW_IPS = \"*\"\r\n\r\nFINN_HUB_API_KEY =\"***********\"\r\nALPHA_VANTAGE_API_KEY =\"***********\"\r\nOPEN_FIGI_API_KEY = \"***********\"\r\n\r\nMONGO_SERVER_URL = \"mongodb://${SERVER}:27017\"\r\nMONGO_BACKUP_URL = \"1LT4xiFJkh6YlAPQDcov8YIKqcvevFlEE\"\r\n\r\nREDIS_SERVER_URL = \"${SERVER}\"\r\nREDIS_PORT = 6379\r\n\r\nMEILI_SERVER_URL = \"http://${SERVER}:7700\"\r\nMEILI_MASTER_KEY = \"***********\"\r\n\r\nSENTRY_DSN = \"\"\r\nTELEMETRY = False\r\n```\r\n\r\n### Production\r\n\r\nThe production build is made for running at scale, so you may want to do the following things:\r\n\r\n- Run on only one worker\r\n- Map all docker ports to `localhost`\r\n\r\nTo run the full application with all required microservices, you need just one command.\r\n\r\n```bash\r\ndocker compose -f docker-compose.yaml up\r\n```\r\n\r\n`docker-compose.yaml` (Production)\r\n\r\n```yaml\r\nversion: \"3.4\"\r\n\r\nservices:\r\n  backend:\r\n    container_name: backend\r\n    build:\r\n      dockerfile: Dockerfile.prod\r\n    restart: always\r\n    depends_on:\r\n      - database\r\n      - cache\r\n      - search\r\n    volumes:\r\n      - ./public:/app/public\r\n    networks:\r\n      - proxy-network\r\n    environment:\r\n      APP_NAME: \"backend\"\r\n      ENVIRONMENT: \"production\"\r\n      ADMIN_PASSWORD: \"***********\"\r\n\r\n      WORKERS: 9\r\n      HOST: \"0.0.0.0\"\r\n      EXPOSE_PORT: 8000\r\n      FORWARDED_ALLOW_IPS: \"*\"\r\n\r\n      FINN_HUB_API_KEY: \"***********\"\r\n      ALPHA_VANTAGE_API_KEY: \"***********\"\r\n      OPEN_FIGI_API_KEY: \"***********\"\r\n\r\n      MONGO_SERVER_URL: \"database\"\r\n      MONGO_BACKUP_URL: \"1LT4xiFJkh6YlAPQDcov8YIKqcvevFlEE\"\r\n      REDIS_SERVER_URL: \"cache\"\r\n      REDIS_PORT: 6379\r\n      MEILI_SERVER_URL: \"search\"\r\n      MEILI_MASTER_KEY: \"***********\"\r\n\r\n      TELEMETRY: False\r\n\r\n  cache:\r\n    container_name: cache\r\n    build:\r\n      context: ./cache\r\n      dockerfile: Dockerfile\r\n    networks:\r\n      - proxy-network\r\n    restart: always\r\n\r\n  database:\r\n    container_name: database\r\n    build:\r\n      context: ./database\r\n      dockerfile: Dockerfile\r\n    networks:\r\n      - proxy-network\r\n    volumes:\r\n      - ./database/main_db:/data/db\r\n    restart: always\r\n\r\n  search:\r\n    container_name: search\r\n    build:\r\n      context: ./search\r\n      dockerfile: Dockerfile\r\n    volumes:\r\n      - ./search/search_db:/meili_data\r\n    networks:\r\n      - proxy-network\r\n    restart: always\r\n\r\nnetworks:\r\n  proxy-network:\r\n    name: proxy-network\r\n```\r\n\r\n#### _If these configuration files do not work for you, they are likely outdated. To fix them, please write an issue._\r\n\r\n## License\r\n\r\n[MIT License](./LICENSE)\r\n\r\n[Community Code of Conduct](./CODE_OF_CONDUCT.MD)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleftmove%2Fpinestreetlocal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleftmove%2Fpinestreetlocal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleftmove%2Fpinestreetlocal/lists"}