{"id":19761756,"url":"https://github.com/sunami09/viewtrading","last_synced_at":"2025-04-30T14:30:34.363Z","repository":{"id":187794008,"uuid":"677584735","full_name":"sunami09/viewtrading","owner":"sunami09","description":"A user-friendly web application designed for financial enthusiasts and professionals. This platform offers a seamless search functionality for various financial instruments, presenting detailed insights such as company profiles, industry specifics, and more. ","archived":false,"fork":false,"pushed_at":"2024-02-28T08:25:01.000Z","size":191,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T02:22:07.614Z","etag":null,"topics":["chartjs","react","rest-api","trading"],"latest_commit_sha":null,"homepage":"https://viewtrading.netlify.app/","language":"JavaScript","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/sunami09.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}},"created_at":"2023-08-12T01:15:28.000Z","updated_at":"2025-02-20T05:51:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"4b915468-e334-4499-a509-a7900b64e2ad","html_url":"https://github.com/sunami09/viewtrading","commit_stats":null,"previous_names":["sunami09/viewtrading"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunami09%2Fviewtrading","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunami09%2Fviewtrading/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunami09%2Fviewtrading/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunami09%2Fviewtrading/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunami09","download_url":"https://codeload.github.com/sunami09/viewtrading/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251721381,"owners_count":21632827,"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":["chartjs","react","rest-api","trading"],"created_at":"2024-11-12T03:42:13.394Z","updated_at":"2025-04-30T14:30:33.822Z","avatar_url":"https://github.com/sunami09.png","language":"JavaScript","readme":"# Trading View Project\n\nThis project provides a comprehensive trading view dashboard, allowing users to search for and view detailed information about stocks, cryptocurrencies, and other financial instruments.\n\n🌐 [**Live Site**](https://viewtrading.netlify.app/)\n\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Code Snippets](#code-snippets)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Features\n\n- **Search Functionality**: Allows users to search for financial instruments using ticker symbols.\n- **Detailed Views**: Displays comprehensive information about the selected instrument, including CEO, headquarters, industry, description, and more.\n- **Error Handling**: Gracefully handles errors and provides user-friendly error messages.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/sunami09/viewtrading/assets/66564001/53b2b463-aac3-4a1b-8dc3-f639cb3b7c3f\" \u003e\n\u003c/p\u003e\n\n\n\n## Installation\n\n```bash\ngit clone https://github.com/yourusername/trading-view.git\ncd trading-view\nnpm install\nnpm start\n```\n\n## Usage\n\n1. Open the application in your browser.\n2. Use the search bar to enter the ticker symbol of the financial instrument you're interested in.\n3. View detailed information about the instrument.\n\n\n## Code Snippets\n\n### Handling API Keys\n\nTo keep API keys secure, we use environment variables:\n\n```javascript\nconst API_KEY = process.env.REACT_APP_API_KEY;\n```\n\nThis ensures that the API key is not exposed in the code and can be securely managed.\n\n### Formatting Market Cap\n\nTo present large numbers in a user-friendly format:\n\n```javascript\nfunction formatMarketCap(value) {\n  if (value \u003e= 1e12) return `$${(value / 1e12).toFixed(2)}T`;\n  if (value \u003e= 1e9) return `$${(value / 1e9).toFixed(2)}B`;\n  if (value \u003e= 1e6) return `$${(value / 1e6).toFixed(2)}M`;\n  if (value \u003e= 1e3) return `$${(value / 1e3).toFixed(2)}K`;\n  return `$${value}`;\n}\n```\n\n### Error Handling\n\nTo handle errors gracefully:\n\n```javascript\ntry {\n  // API call or other operations\n} catch (error) {\n  console.error(\"An error occurred:\", error.message);\n}\n```\n\n### Truncating Descriptions\n\nTo ensure descriptions are concise and user-friendly:\n\n```javascript\nfunction truncateDescription(desc) {\n  const words = desc.split(' ');\n  if (words.length \u003e 70) {\n    return words.slice(0, 70).join(' ') + '...';\n  }\n  return desc;\n}\n```\n\n### Searching for a Ticker Symbol\n\nTo search for a financial instrument using its ticker symbol:\n\n```javascript\nfunction searchTicker(symbol) {\n  fetch(`https://api.example.com/search?symbol=${symbol}\u0026apikey=${API_KEY}`)\n    .then(response =\u003e response.json())\n    .then(data =\u003e {\n      // Handle the data\n    })\n    .catch(error =\u003e {\n      console.error(\"Error fetching data:\", error);\n    });\n}\n```\n\n## API Explanation\n\nOur project relies on the Financial Modeling Prep API to fetch financial data. This API provides a wealth of information about stocks, cryptocurrencies, and other financial instruments.\n\n### Requesting Stock Data\n\nTo fetch data for a specific stock, we make a GET request to the API's `quote` endpoint:\n\n```javascript\nconst symbol = \"AAPL\"; // Example for Apple Inc.\nfetch(`https://api.financialmodelingprep.com/api/v3/quote/${symbol}?apikey=${API_KEY}`)\n  .then(response =\u003e response.json())\n  .then(data =\u003e {\n    // Handle the data\n  })\n  .catch(error =\u003e {\n    console.error(\"Error fetching stock data:\", error);\n  });\n```\n\n### Sample JSON Response\n\nHere's an example of the JSON response when querying for Apple Inc.:\n\n```json\n[\n  {\n    \"symbol\": \"AAPL\",\n    \"name\": \"Apple Inc.\",\n    \"price\": 150.12,\n    \"changesPercentage\": 0.58,\n    \"change\": 0.87,\n    \"marketCap\": 2485170000000,\n    \"exchange\": \"NASDAQ\",\n    \"industry\": \"Computer Hardware\",\n    \"description\": \"Apple Inc. designs, manufactures, and markets smartphones, personal computers, tablets, wearables, and accessories worldwide. It also sells various related services.\",\n    \"ceo\": \"Tim Cook\",\n    ...\n  }\n]\n```\n\nThis response provides a wealth of information about the stock, including its current price, market capitalization, and a brief description.\n\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunami09%2Fviewtrading","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunami09%2Fviewtrading","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunami09%2Fviewtrading/lists"}