{"id":27028028,"url":"https://github.com/johnmachado11/cloud-python-to-cpp","last_synced_at":"2025-04-05T00:19:48.377Z","repository":{"id":118554361,"uuid":"600150928","full_name":"JohnMachado11/Cloud-Python-to-Cpp","owner":"JohnMachado11","description":"Python backend built utilizing several Google Cloud Platform services. In addition, C++ connectivity, a robust cloud authentication system, Cloud Build CI/CD pipelines, process automation, and more.","archived":false,"fork":false,"pushed_at":"2024-11-15T18:40:06.000Z","size":71,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-15T19:33:29.364Z","etag":null,"topics":["api","authentication","backend","cloudfunctions","cpp","gcp","google-cloud-platform","microservices","microservices-architecture","python"],"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/JohnMachado11.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-02-10T17:43:17.000Z","updated_at":"2024-11-15T18:40:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"175e8b11-7f24-4b9a-bea6-c3044db906e9","html_url":"https://github.com/JohnMachado11/Cloud-Python-to-Cpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnMachado11%2FCloud-Python-to-Cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnMachado11%2FCloud-Python-to-Cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnMachado11%2FCloud-Python-to-Cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnMachado11%2FCloud-Python-to-Cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JohnMachado11","download_url":"https://codeload.github.com/JohnMachado11/Cloud-Python-to-Cpp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247267155,"owners_count":20910929,"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":["api","authentication","backend","cloudfunctions","cpp","gcp","google-cloud-platform","microservices","microservices-architecture","python"],"created_at":"2025-04-05T00:19:47.837Z","updated_at":"2025-04-05T00:19:48.371Z","avatar_url":"https://github.com/JohnMachado11.png","language":"Python","readme":"## Cloud-Python-to-Cpp\n\n### Cloud System Architecture\n![System Architecture](https://i.imgur.com/DQSJuTB.png)\n\n\nThis project was designed to leverage **several** `Google Cloud Platform` cloud services to create a robust and automated system which can be interacted with via `C++` code. \n\nWhy `C++`? The use case of that programming language specifically in the context of this project would be, for example, to have a physical device which runs on `C++` pull from the cloud the latest `firmware` it needs. Or any kind of data.\n\nUltimately, a secure API to pull data from a `BigQuery` database table was designed and it can actually be called by **any** programming language as long as the correct credentials get sent in `json` format to the `Auth_Func`. \n\nThe programming language `Python` is utilized to create the entire backend component on `Google Cloud Platform`. \n\n`Firebase` is also utilized as part of the authentication system. \n\n`Looker Studio` data visualization dashboard for viewing data from the `BigQuery` table located [here](https://lookerstudio.google.com/u/2/reporting/6a9eaf10-58c9-4d75-8690-9a2759b7a256/page/VibFD). \n\nFor testing of the API, if there is interest reach out directly via email [here](mailto:cpp.cloud.project@gmail.com). \n\n\n\n\n------\n\n`Google Cloud Platform` technologies:\n\n- `Artifact Registry` - Stores the latest Docker image builds for `Cloud Run`\n\n- `BigQuery` - Data warehouse which stores the table of data we interact with\n\n- `Cloud Build` - Monitors GitHub repo and automates the process of deploying new code into the cloud\n\n- `Cloud Functions (Gen 2)` - The backend for the project. Within each Cloud Function is the `Python` code. \n\n- `Cloud Run` - Generation 2 of `Cloud Functions` is actually `Cloud Run` behind the scenes. Therefore `Python` code executes here. \n\n- `Cloud Scheduler` - Cron job scheduler for any job in the cloud\n\n- `Cloud Storage` - Stores the latest `Python` code for the `Cloud Functions`\n\n- `Looker Studio` - Data visualization tool\n\n- `Secret Manager` - Secure storage system for sensitive data\n\n`Firebase` technologies:\n\n- `Authentication` - Stores the user account data\n\n-----\n\n### System Flow\n\n`C++` --\u003e `Auth_Func` --\u003e `Compute_Func` --\u003e `BigQuery`\n\nValues of the 5 most recent records from the BigQuery table get returned to the `C++` code in the end. \n\n----\n### Cloud Functions\n\n1. `Auth_Func` - Publically Accessible (could be private as well)\n2. `Compute_Func` - Private\n3. `Insert_Int_Func` - Private\n\nLet's talk about each:\n\n1. `Auth_Func` The authentication system.   \n\n- Everything starts here. Way before any data can be extracted from the `BigQuery` database table, a `request` from the user has to pass multiple tests before the code can proceed. \n\n- 1. The `request` cannot be empty and the `json` must have the correct keys, `email` and `password`.\n- 2. The value of the `email` key of the `json` must be a string.\n- 3. The format of the value of the `email` key of the `json` must be in the correct format e.g. `\"name@domain.com\"`.\n- 4. The value of the `password` key of the `json` must be a string.\n- 5. The `email` and `password` must correlate to an existing user within `Firebase Authentication`.\n  \n- If everything checks out, then the `Compute_Func` `Cloud Function` gets called directly from the `Auth_Func`.\n\n2. `Compute_Func` The computation system. Computation in the sense of enumerating, listing out. \n\n- The job of the `Compute_Func` is to simply extract the values of the 5 most recent records from a `BigQuery` table. \n- Those values are then placed into a list. \n- That list is converted to a string and then the string is returned to the `Auth_Func`. \n\n3. `Insert_Int_Func` The data insertion system. \n\n- The `Insert_Int_Func` operates independently from the `Auth_Func` and `Compute_Func` and its automated. \n- `Insert_Int_Func` is triggered every **6 hours** by `Cloud Scheduler`\n- A randomized integer between the ranges of 0-75 is inserted into a `BigQuery` table\n\n---\n\n`Python` Programming Language\n\nBackend was designed with `Python` version `3.9`.\n\nLibraries:\n\n`google-cloud-secret-manager==2.12.6` - [PyPi url](https://pypi.org/project/google-cloud-secret-manager/)\n\n`google-cloud-bigquery==3.5.0` - [PyPi url](https://pypi.org/project/google-cloud-bigquery/)\n\n`python-dotenv==0.21.0`- [PyPi url](https://pypi.org/project/python-dotenv/)\n\n`Pyrebase4==4.5.0` - [PyPi url](https://pypi.org/project/Pyrebase4/)\n\n`pyarrow==11.0.0` - [PyPi url](https://pypi.org/project/pyarrow/)\n\n`pandas==1.5.3` - [PyPi url](https://pypi.org/project/pandas/)\n\n---\n\n`C++` Programming Language\n\nCode tested and compiled on MacOS Ventura. \n\n- Compiler: `g++` \n- `C++` Standard: `17`\n\nHow to run `C++` code:\n\nBe aware that preset credentials will be required to access the API.\n\n- Open terminal\n- Navigate to `C++/Cloud_Caller/src` folder\n- Type `g++ -o main main.cpp -lcurl` in terminal\n- Type `./main` in terminal\n\nLibraries:\n\n`libcurl` - https://curl.se/libcurl/\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnmachado11%2Fcloud-python-to-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnmachado11%2Fcloud-python-to-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnmachado11%2Fcloud-python-to-cpp/lists"}