{"id":29840561,"url":"https://github.com/graphform/sim-stock-demo","last_synced_at":"2025-07-29T14:16:59.532Z","repository":{"id":225256314,"uuid":"763782626","full_name":"graphform/sim-stock-demo","owner":"graphform","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-12T02:28:16.000Z","size":179,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-06-23T03:54:31.176Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/graphform.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":"2024-02-26T22:57:48.000Z","updated_at":"2025-06-20T22:37:14.000Z","dependencies_parsed_at":"2024-03-01T03:31:38.374Z","dependency_job_id":"c4f596a9-17a6-4dfb-925e-3cf9ac5842b7","html_url":"https://github.com/graphform/sim-stock-demo","commit_stats":null,"previous_names":["nstreamio/sim-stock-demo","graphform/sim-stock-demo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/graphform/sim-stock-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphform%2Fsim-stock-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphform%2Fsim-stock-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphform%2Fsim-stock-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphform%2Fsim-stock-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphform","download_url":"https://codeload.github.com/graphform/sim-stock-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphform%2Fsim-stock-demo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267701663,"owners_count":24130458,"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-29T02:00:12.549Z","response_time":2574,"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-29T14:16:40.203Z","updated_at":"2025-07-29T14:16:59.526Z","avatar_url":"https://github.com/graphform.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction \n\nThis application is a real-time simulation of a stock ticker. It displays a real-time table of a simulated collection of stocks that one might find listed on an exchange. Their key properties such as current price and daily movement are simulated in the Java Swim application located in the `/server` directory of this repository. A single MapDownlink is opened by the UI to the `stocks` lane of the backend application's `SymbolsAgent`. This downlink syncs with the lane's state containing pricing for all entries and then receives follow-on price updates until the downlink is closed. With each update received, UI local state and table content is updated.\n\nSee a hosted version of this app running at [https://stocks-simulated.nstream-demo.io](https://stocks-simulated.nstream-demo.io/).\n# Running the example\nThis default implementation simulates 20K stocks by default. \n```bash\ncd server\nmvn clean compile exec:java\n```\n\nYou may change the number of stocks by setting the `NUM_STOCKS` environment variable. To run the application with 50K simulated stocks, use the following commands.\n```bash\ncd server\nNUM_STOCKS=50000\nmvn clean compile exec:java\n```\n\n\n# Viewing the UI\n\nThe UI is built using React bootstrapped with Vite and AG Grid for the table component.\n\n\n```bash\ncd ui\nnpm install\nnpm run dev\n```\n\nThen head to `localhost:5173` to see it in action.\n\n## Streaming APIs\n\nThe [swim-cli](https://www.swimos.org/backend/cli/) is the simplest way to fetch or stream data from  the web agents in this application\n\n### \"swim-cli\" installation\n**swim-cli** installation details available here: https://www.swimos.org/backend/cli/\n\n### Application APIs\n**Note:**\n* Below **swim-cli** commands for introspection are for streaming locally running application.\n* There is a hosted version of this application running here: https://stocks-simulated.nstream-demo.io/\n* To stream APIs for the hosted version, replace `warp://localhost:9001` in below commands with `warps://stocks-simulated.nstream-demo.io`\n\n(Below, Stock ticker symbol \"AAAA\" is used as an example)\n\n1. **SYMBOLS**:\n\n* List of various stocks' current price, trading volume, bid/ask if any, and the price movement in the stock price.\n```sh\nswim-cli sync -h warp://localhost:9001 -n /symbols -l stocks\n```\n\n2. **STOCK**:\n\n* A particular stock's current status details (current price, trading volume, bid/ask if any, and the price movement in the stock price)\n```sh\nswim-cli sync -h warp://localhost:9001 -n /stock/AAAA -l status\n```\n\n* A particular stock's previous close price details\n```sh\nswim-cli sync -h warp://localhost:9001 -n /stock/AAAA -l previousClose\n```\n\n### Introspection APIs\nThe Swim runtime exposes its internal subsystems as a set of meta web agents.\n\nUse the `swim:meta:host` agent to introspect a running host. Use the `pulse`\nlane to stream high level stats:\n\n```sh\nswim-cli sync -h warp://localhost:9001 -n swim:meta:host -l pulse\n```\n\nThe `nodes` lane enumerates all agents running on a host:\n\n```sh\nswim-cli sync -h warp://localhost:9001 -n swim:meta:host -l nodes\n```\n\nThe fragment part of the `nodes` lane URI can contain a URI subpath filter:\n\n```sh\nswim-cli sync -h warp://localhost:9001 -n swim:meta:host -l nodes#/\n```\n\n#### Node Introspection\n\nYou can stream the utilization of an individual web agent:\n\n```sh\nswim-cli sync -h warp://localhost:9001 -n swim:meta:node/%2fsymbols -l pulse\n\nswim-cli sync -h warp://localhost:9001 -n swim:meta:node/%2fstock%2fAAAA -l pulse\n```\n\nAnd discover its lanes:\n\n```sh\nswim-cli sync -h warp://localhost:9001 -n swim:meta:node/%2fsymbols -l lanes\n\nswim-cli sync -h warp://localhost:9001 -n swim:meta:node/%2fstock%2fAAAA -l lanes\n```\n\n#### Mesh introspectiong\n\n```sh\nswim-cli sync -h warp://localhost:9001 -n swim:meta:edge -l meshes\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphform%2Fsim-stock-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphform%2Fsim-stock-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphform%2Fsim-stock-demo/lists"}