{"id":22870011,"url":"https://github.com/autodesk-platform-services/aps-db-sample","last_synced_at":"2025-08-23T15:38:03.297Z","repository":{"id":80611533,"uuid":"572612848","full_name":"autodesk-platform-services/aps-db-sample","owner":"autodesk-platform-services","description":"Connected Database:Sample to demonstrate how to connect with an external DB on demand","archived":false,"fork":false,"pushed_at":"2024-05-21T03:44:40.000Z","size":755,"stargazers_count":14,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-05T22:12:24.658Z","etag":null,"topics":["autodesk-bim360","autodesk-construction-cloud","autodesk-viewer","database","dotnet","sample"],"latest_commit_sha":null,"homepage":"https://aps-db-sample.autodesk.io","language":"C#","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/autodesk-platform-services.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-11-30T16:42:14.000Z","updated_at":"2025-05-02T11:24:47.000Z","dependencies_parsed_at":"2025-05-05T22:12:20.849Z","dependency_job_id":"6c02f11d-7e24-46e4-9b22-5b190201dab1","html_url":"https://github.com/autodesk-platform-services/aps-db-sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/autodesk-platform-services/aps-db-sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autodesk-platform-services%2Faps-db-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autodesk-platform-services%2Faps-db-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autodesk-platform-services%2Faps-db-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autodesk-platform-services%2Faps-db-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/autodesk-platform-services","download_url":"https://codeload.github.com/autodesk-platform-services/aps-db-sample/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autodesk-platform-services%2Faps-db-sample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271754934,"owners_count":24815322,"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-08-23T02:00:09.327Z","response_time":69,"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":["autodesk-bim360","autodesk-construction-cloud","autodesk-viewer","database","dotnet","sample"],"created_at":"2024-12-13T13:13:22.006Z","updated_at":"2025-08-23T15:38:03.272Z","avatar_url":"https://github.com/autodesk-platform-services.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# aps-db-sample\n\n![.NET](https://img.shields.io/badge/.NET-6-blue.svg)\n[![MIT](https://img.shields.io/badge/License-MIT-blue.svg)](http://opensource.org/licenses/MIT)\n[![Level](https://img.shields.io/badge/Level-Intermediate-blue.svg)](http://developer.autodesk.com/)\n\n[![oAuth2](https://img.shields.io/badge/oAuth2-v1-green.svg)](http://developer.autodesk.com/)\n[![Data-Management](https://img.shields.io/badge/Data%20Management-v2-green.svg)](http://developer.autodesk.com/)\n[![BIM360](https://img.shields.io/badge/BIM360-v1-green.svg)](http://developer.autodesk.com/)\n[![ACC](https://img.shields.io/badge/ACC-v1-green.svg)](http://developer.autodesk.com/)\n\n## Thumbnail\n\n![Thumbnail](thumbnail.png)\n\n## Description\n\nThis sample demonstrates how to connect with an external DB on demand, adding custom properties to Viewer property panel.\nIt uses Websocket to notify different users when the parameters they might be seeing changes.\nWe can understand how it works dividing the connection to DB in two sections.\n\nFirst, Reading the Data from DB and aggregating into property Panel.\n\n![](README/READFROMDB.png)\n\n1 - User select an element from the scene, which triggers a job to retrieve associated properties (specific to this element) from an external DB (MongoDB in this case)\n\n2 - A task retrieves the associated properties from the external DB.\n\n3 - If those properties exists they are returned and aggregated to the properties panel inside an input element, so the user can change them. If not, the properties are aggregated on properties panel as blank inputs, so user can write values to those, creating new values in the external DB.\n\nThen, updating the properties from Viewer.\n\n![](README/UPDATEDBDATA.png)\n\n1 - User update a custom parameter on viewer’s property panel inputs, which triggers a job to update this parameters value in the external DB (MongoDB in this case).\n\n2 - A task updates the property value (or create it, if it doesn’t exists).\n\n3 - The client that triggered the task (A) get notified about the result, while other clients (B and C) receives a notification with the changed/created value.\n\n# Setup\n\n## Prerequisites\n\n1. **APS Account**: Learn how to create a APS Account, activate subscription and create an app at [this tutorial](http://learnforge.autodesk.io/#/account/).\n2. **Visual Studio**: Either Community (Windows) or Code (Windows, MacOS).\n3. **.NET 6**: basic knowledge of C#.\n4. **MongoDB Atlas**: Cloud-hosted MongoDB [refer here](https://www.mongodb.com/cloud/atlas/).\n\nUse of this sample requires Autodesk developer credentials.\nVisit the [APS Developer Portal](https://developer.autodesk.com), sign up for an account\nand [create an app](https://developer.autodesk.com/myapps/create) that uses Data Management and Model Derivative APIs.\nFor this new app, use `http://localhost:3000/api/aps/callback/oauth` as Callback URL, although is not used in a 2-legged flow.\nFinally, make a note of the **Client ID** and **Client Secret**.\n\n## Running locally\n\nClone this project or download it.\nWe recommend installing [GitHub desktop](https://desktop.github.com/).\nTo clone it via command line, use the following (**Terminal** on MacOSX/Linux, **Git Shell** on Windows):\n\n    git clone https://github.com/autodesk-platform-services/aps-db-sample\n\n**Environment variables**\n\nAt the `.appsettings.Development.json`, find the env vars and add your APS Client ID, Secret and callback URL. The end result should be as shown below:\n\n```json\n  \"APS_CLIENT_ID\": \"your APS app client id\",\n  \"APS_CLIENT_SECRET\": \"your APS app client secret\",\n  \"APS_CALLBACK_URL\": \"http://localhost:8080/api/auth/callback\",\n  \"APS_BUCKET\": \"your bucket name\",\n  \"MONGODB_CON_STRING\": \"your MongoDB connection string\",\n  \"MONGODB_DBNAME\": \"your MongoDB DB name\",\n  \"MONGODB_COLLECTION\": \"your MongoDB collection name\",\n  \"DB_PROPERTIES_NAMES\": \"your comma separated properties\"\n```\n\n## License\n\nThis sample is licensed under the terms of the [MIT License](http://opensource.org/licenses/MIT). Please see the [LICENSE](LICENSE) file for full details.\n\n## Written by\n\nJoao Martins [@JooPaulodeOrne2](https://twitter.com/JooPaulodeOrne2), [Developer Advocate](http://aps.autodesk.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautodesk-platform-services%2Faps-db-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fautodesk-platform-services%2Faps-db-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautodesk-platform-services%2Faps-db-sample/lists"}