{"id":42482606,"url":"https://github.com/cloudspannerecosystem/omegatrade","last_synced_at":"2026-01-28T11:15:45.951Z","repository":{"id":51205204,"uuid":"355013934","full_name":"cloudspannerecosystem/omegatrade","owner":"cloudspannerecosystem","description":"Sample application for Spanner written in Node.js.","archived":false,"fork":false,"pushed_at":"2024-10-30T17:28:12.000Z","size":1978,"stargazers_count":6,"open_issues_count":17,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-03T08:12:56.004Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudspannerecosystem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":"docs/code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-06T00:53:08.000Z","updated_at":"2022-12-09T00:02:37.000Z","dependencies_parsed_at":"2022-09-03T15:01:22.434Z","dependency_job_id":null,"html_url":"https://github.com/cloudspannerecosystem/omegatrade","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cloudspannerecosystem/omegatrade","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudspannerecosystem%2Fomegatrade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudspannerecosystem%2Fomegatrade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudspannerecosystem%2Fomegatrade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudspannerecosystem%2Fomegatrade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudspannerecosystem","download_url":"https://codeload.github.com/cloudspannerecosystem/omegatrade/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudspannerecosystem%2Fomegatrade/sbom","scorecard":{"id":293284,"data":{"date":"2025-08-11","repo":{"name":"github.com/cloudspannerecosystem/omegatrade","commit":"a5ebfb1e8eaced3b70482b0aeba7bdbf99e602aa"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.6,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: backend/dockerfile.local.emulator:1: pin your Docker image by updating google/cloud-sdk:slim to google/cloud-sdk:slim@sha256:7f729a5f78e980d226cb4bf57944fe669c4b2b226cf7209a4e6814fac8e0309f","Warn: containerImage not pinned by hash: backend/dockerfile.prod:1: pin your Docker image by updating node:10.16.3 to node:10.16.3@sha256:f4b6f471cdd4b66b27eef899e7f8423ecd9fbfc863b2cb7a59978a7f64c8e0c3","Warn: containerImage not pinned by hash: backend/dockerfile.standalone.emulator:1: pin your Docker image by updating google/cloud-sdk:slim to google/cloud-sdk:slim@sha256:7f729a5f78e980d226cb4bf57944fe669c4b2b226cf7209a4e6814fac8e0309f","Warn: containerImage not pinned by hash: frontend/dockerfile:1: pin your Docker image by updating node:10.16.3 to node:10.16.3@sha256:f4b6f471cdd4b66b27eef899e7f8423ecd9fbfc863b2cb7a59978a7f64c8e0c3","Warn: downloadThenRun not pinned by hash: backend/dockerfile.local.emulator:4","Warn: npmCommand not pinned by hash: backend/dockerfile.local.emulator:20","Warn: npmCommand not pinned by hash: backend/dockerfile.prod:5","Warn: downloadThenRun not pinned by hash: backend/dockerfile.standalone.emulator:4","Warn: npmCommand not pinned by hash: backend/dockerfile.standalone.emulator:18","Warn: npmCommand not pinned by hash: frontend/dockerfile:4","Warn: npmCommand not pinned by hash: frontend/dockerfile:5","Info:   0 out of   4 containerImage dependencies pinned","Info:   0 out of   2 downloadThenRun dependencies pinned","Info:   0 out of   5 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"122 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-7v5v-9h63-cj86","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-8cf7-32gw-wr33","Warn: Project is vulnerable to: GHSA-hjrf-2m68-5959","Warn: Project is vulnerable to: GHSA-qwph-4952-7xr6","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-8hfj-j24r-96c4","Warn: Project is vulnerable to: GHSA-wc69-rhjr-hc9g","Warn: Project is vulnerable to: GHSA-56x4-j7p9-fcf9","Warn: Project is vulnerable to: GHSA-v78c-4p63-2j6c","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5","Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp","Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq","Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr","Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765","Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g","Warn: Project is vulnerable to: GHSA-px4h-xg32-q955","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-g954-5hwp-pp24","Warn: Project is vulnerable to: GHSA-h755-8qp9-cq85","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-c75v-2vq8-878f","Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-whgm-jr23-g3j9","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-3wcq-x3mq-6r9p","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-j4f2-536g-r55m","Warn: Project is vulnerable to: GHSA-r7qp-cfhv-p84w","Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h","Warn: Project is vulnerable to: GHSA-6h5x-7c5m-7cr7","Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q","Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-7r28-3m3f-r2pr","Warn: Project is vulnerable to: GHSA-r8j5-h5cx-65gg","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-jg8v-48h5-wgxg","Warn: Project is vulnerable to: GHSA-36fh-84j7-cv5h","Warn: Project is vulnerable to: GHSA-7x7c-qm48-pq9c","Warn: Project is vulnerable to: GHSA-rc3x-jf5g-xvc5","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-82v2-mx6x-wq7q","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-6fx8-h7jm-663j","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-566m-qj78-rww5","Warn: Project is vulnerable to: GHSA-hwj9-h5mp-3pm3","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-25hc-qcg6-38wj","Warn: Project is vulnerable to: GHSA-qm95-pgcg-qqfq","Warn: Project is vulnerable to: GHSA-cqmj-92xf-r6r9","Warn: Project is vulnerable to: GHSA-vx3p-948g-6vhq","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-662x-fhqg-9p8v","Warn: Project is vulnerable to: GHSA-394c-5j6w-4xmx","Warn: Project is vulnerable to: GHSA-78cj-fxph-m83p","Warn: Project is vulnerable to: GHSA-fhg7-m89q-25r3","Warn: Project is vulnerable to: GHSA-hh27-ffr2-f2jc","Warn: Project is vulnerable to: GHSA-rqff-837h-mm52","Warn: Project is vulnerable to: GHSA-8v38-pw62-9cw2","Warn: Project is vulnerable to: GHSA-hgjh-723h-mx2j","Warn: Project is vulnerable to: GHSA-jf5r-8hm2-f872","Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6","Warn: Project is vulnerable to: GHSA-4v9v-hfq4-rm2v","Warn: Project is vulnerable to: GHSA-9jgg-88mc-972h","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-776f-qx25-q3cc","Warn: Project is vulnerable to: GHSA-72mh-269x-7mh5","Warn: Project is vulnerable to: GHSA-h4j5-c7cj-74xg"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T18:51:34.246Z","repository_id":51205204,"created_at":"2025-08-17T18:51:34.246Z","updated_at":"2025-08-17T18:51:34.246Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28844862,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T10:53:21.605Z","status":"ssl_error","status_checked_at":"2026-01-28T10:53:20.789Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-01-28T11:15:40.887Z","updated_at":"2026-01-28T11:15:45.945Z","avatar_url":"https://github.com/cloudspannerecosystem.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OmegaTrade App\n\nOmega Trade is a Sample application for [Spanner Terraform Example](https://github.com/cloudspannerecosystem/spanner-terraform-example).  \nThis project was built using [Angular CLI](https://github.com/angular/angular-cli) version 11.0.0 and [Express](https://github.com/expressjs/express/blob/master/Readme.md) (Node.js web application framework) version 4.17.0.\n\n## Dependencies\n* Install [Node](https://nodejs.org/en/download/) version \u003e= 10.16 and [NPM](https://nodejs.org/en/download/) version \u003e= 6.9\n* Cloud Spanner - [emulator](https://cloud.google.com/spanner/docs/emulator)\n  * The emulator is included in the [Google Cloud SDK](https://cloud.google.com/sdk)\nand can be invoked via the [gcloud emulators spanner](https://cloud.google.com/sdk/gcloud/reference/emulators/spanner) commands. \n  * Please [install](https://cloud.google.com/sdk/docs/install) Cloud SDK before proceeding further, if you haven't already. \n* Cloud Spanner - [Node.js Client](https://www.npmjs.com/package/@google-cloud/spanner)\n  * This package would be installed through `npm install` command while setting up backend services as a part of [Step 2](https://github.com/cloudspannerecosystem/omegatrade#2-setup-backend).\n\n## Quickstart\n\nThe following steps will guide you to run the OmegaTrade application locally.\n\n1. Set up the Cloud Spanner emulator and create the instance, database and schema in the emulator.\n2. Set up the Backend service and connect it to the emulator. \n3. Seed sample data in the OmegaTrade app.\n4. Set up the Frontend service and configure the API base URL.\n5. Run the OmegaTrade app.\n6. (Optional) Configure Google OAuth in frontend to enable sign-in with your Google account.\n\n## 1. Emulator Setup\n\nThere are various options to start the emulator locally. Here we will cover the gcloud instructions. All other methods can be found within the Cloud Spanner Emulator [GitHub repository](https://github.com/GoogleCloudPlatform/cloud-spanner-emulator/blob/master/README.md#quickstart). \n\nVia gcloud commands\n\n```\ngcloud components update \ngcloud emulators spanner start \n```\nThe following commands will create a configuration for the emulator. This is a one-time setup and can be reused subsequently.\nOpen a new terminal and run the following commands\n\n```\ngcloud config configurations create emulator\ngcloud config set auth/disable_credentials true\ngcloud config set project test-project\ngcloud config set api_endpoint_overrides/spanner http://localhost:9020/\n```\n\nUpon running above commands successfully, activate the emulator configuration\n\n```\ngcloud config configurations activate emulator\n```\n\nValidate your emulator is configured correctly\n\n```\ngcloud config list\n```\n\nLet’s create an instance, database and tables on the local emulator. \n\n#### Create an instance in the emulator \n\n```\ngcloud spanner instances create omegatrade-instance --config=emulator-config --description=\"OmegaTrade Instance - Cloud Spanner Emulator\" --nodes=3\n```\n\n#### Create a database\n\n```\ngcloud spanner databases create omegatrade-db --instance omegatrade-instance\n```\n\n#### Create tables \n\n```\ngcloud spanner databases ddl update omegatrade-db --instance omegatrade-instance --ddl \"CREATE TABLE users (userId STRING(36) NOT NULL, businessEmail STRING(50), fullName STRING(36), password STRING(100), photoUrl STRING(250), provider STRING(20), forceChangePassword BOOL) PRIMARY KEY(userId); CREATE UNIQUE NULL_FILTERED INDEX usersByBusinessEmail ON users (businessEmail);\"\n```\n```\ngcloud spanner databases ddl update omegatrade-db --instance omegatrade-instance --ddl \"CREATE TABLE companies (companyId STRING(36) NOT NULL, companyName STRING(30), companyShortCode STRING(15), created_at TIMESTAMP NOT NULL OPTIONS (allow_commit_timestamp=true)) PRIMARY KEY(companyId);\"\n```\n```\ngcloud spanner databases ddl update omegatrade-db --instance omegatrade-instance --ddl \"CREATE UNIQUE NULL_FILTERED INDEX companiesByCompanyName ON companies (companyName); CREATE UNIQUE NULL_FILTERED INDEX companiesByShortCode ON companies (companyShortCode);\"\n```\n```\ngcloud spanner databases ddl update omegatrade-db --instance omegatrade-instance --ddl \"CREATE TABLE companyStocks (companyStockId STRING(36) NOT NULL, companyId STRING(36) NOT NULL, open NUMERIC, volume NUMERIC, currentValue NUMERIC, date FLOAT64, close NUMERIC, dayHigh NUMERIC, dayLow NUMERIC, timestamp TIMESTAMP NOT NULL OPTIONS (allow_commit_timestamp=true), CONSTRAINT FK_CompanyStocks FOREIGN KEY (companyId) REFERENCES companies (companyId)) PRIMARY KEY(companyStockId);\"\n```\n```\ngcloud spanner databases ddl update omegatrade-db --instance omegatrade-instance --ddl \"CREATE TABLE simulations (sId STRING(36) NOT NULL, companyId STRING(36) NOT NULL, status STRING(36), createdAt TIMESTAMP NOT NULL OPTIONS (allow_commit_timestamp=true), CONSTRAINT FK_CompanySimulation FOREIGN KEY (companyId) REFERENCES companies (companyId)) PRIMARY KEY(sId);\"\n```\n\nRun the following command on emulator instance to check the table creation.\n\n```\ngcloud spanner databases execute-sql omegatrade-db  --instance=omegatrade-instance  --sql='SELECT * FROM information_schema.tables WHERE table_schema \u003c\u003e \"INFORMATION_SCHEMA\"'\n```\n\n## 2. Set up the Backend\n\nNow, the emulator is up and running. Let’s clone this repo and run the backend service of OmegaTrade with the emulator. \n\n```\ngit clone https://github.com/cloudspannerecosystem/omegatrade.git\ncd omegatrade/backend\n```\n\nInstall dependencies in the `backend` folder\n\n```\nnpm install \n```\n\nCreate .env file in the `backend` folder (if not already exists) and ensure the **Project ID**, **Instance** and **Database** name match the ones we created above. \n\n```\nPROJECTID = test-project\nINSTANCE = omegatrade-instance\nDATABASE = omegatrade-db\nJWT_KEY = w54p3Y?4dj%8Xqa2jjVC84narhe5Pk\nEXPIRE_IN = 2d\n```\n\n```\nexport SPANNER_EMULATOR_HOST=\"localhost:9010\"\nnode server.js\n```\n\nThe above command will run the Backend service in `http://localhost:3000`\n\n## 3. Seed Sample Data\n\nOpen a new terminal and go back to the `backend` folder. Run the below commands:\n\n```\nexport SPANNER_EMULATOR_HOST=\"localhost:9010\"\nnode seed-data.js \n```\nThe above command will migrate sample data into the connected database.\nIf the seeding was successful, you will get a `Data Loaded successfully` message.\n\nNote: You may run this migration only on an empty database, to avoid duplication.\n\n## 4. Set up the Frontend\n\nNow let's run the frontend service of OmegaTrade.\n\n```\ncd .. \u0026\u0026 cd frontend\n\n#Install Dependencies\nnpm install \n```\n\nNow let's configure the client ID and backend API url.\n\n```\ncd src/environments\nvi environment.ts\n```\n\nChange the **base URL** according to the **backend URL** (ensure you append the /api/v1/ as below)\n\n```\nexport const environment = {\n  production: false,\n  name: \"dev\",\n  // change baseUrl according to backend URL\n  baseUrl: \"http://localhost:3000/api/v1/\", \n  clientId: \"\"\n};\n```\n\n## 5. Run the Application\n\nGo back to the frontend folder.\n\nRun `npm start` in the `frontend` folder. This command will serve the whole application and it will start running in the URL `http://localhost:4200`. \n\n## 6. (Optional) Configure Google OAuth in Frontend\n\nGoogle OAuth enables you to sign in with your Google account directly from the application. Here are the steps you need to follow in order to use this service.\n\n#### Creating Omega Trade application in the OAuth Consent screen for the first time.\n\n1. Go to the [OAuth consent screen](https://console.cloud.google.com/apis/credentials/consent).\n2. Choose the user type as either Internal or External and click create.\n3. Add your application name (i.e OmegaTrade) in the App name field.\n4. Choose your email in the User support email section.\n5. Add your email in developer contact information.  \n6. Add your organization's app domain and authorized domain, if you do not have both you can skip this step.\n7. Click save and continue.\n8. Add Scopes if you want and continue with next steps.\n9. Save your changes.\n\n#### Modifying OAuth Consent Screen application.\n\nThe following steps are required only if you want to modify the name of existing application to OmegaTrade.\n\n1. Go to the [OAuth consent screen](https://console.cloud.google.com/apis/credentials/consent).\n2. Click on the Edit App button. \n3. Replace the existing application name with \"OmegaTrade\" in the App name field.\n4. Choose your email in the User support email section.\n5. Add your email in developer contact information.\n6. Add your organization's app domain and authorized domain, if you do not have both you can skip this step.\n7. Click save and continue. \n8. Add Scopes if you want and continue with the following steps.\n9. Save your changes.\n\n#### Creating Google OAuth credentials\n\nThe following steps will guide you to create OAuth Credentials for the registered application.\n\n1. Go to the [Google API Console Credentials](https://console.developers.google.com/apis/credentials). Click on Create Credentials and choose OAuth client ID. \n\n2. Choose Web Application in the application type and enter the name of your choice.    \n\n3. Add frontend URL i.e. `http://localhost:4200` (from step 5) in Authorized JavaScript origins **ADD URI** section and click on create button. Copy your client id from the popup window.\n\n4. Now we need to update the Client ID in the `environment.ts` file of frontend folder.\n\n```\ncd src/environments\nvi environment.ts\n```\n\nUpdate the **clientId** as below.\n\n```\nexport const environment = {\n  production: false,\n  name: \"dev\",\n  // change baseUrl according to backend URL\n  baseUrl: \"http://localhost:3000/api/v1/\", \n  // change clientId to actual value you have received from Oauth console \n  clientId: \"142706365772-ol2a8hcqs1d3rrgjgvxxxxxxxxdqpog8.apps.googleusercontent.com\"\n};\n```\n\nNOTE: Please ensure that cookies are enabled in your browser to avoid being blocked from running the app. The official OAuth setup guide can also be found [here](https://support.google.com/cloud/answer/6158849?hl=en#zippy=).\n\n\nNow Angular will automatically detect your changes and serve the app in `http://localhost:4200` URL.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudspannerecosystem%2Fomegatrade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudspannerecosystem%2Fomegatrade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudspannerecosystem%2Fomegatrade/lists"}