Skip to content

Project Layout & Architecture

Pan, Kevin Zhu edited this page Mar 28, 2022 · 1 revision

Local and Cloud Files

There are two 'file watchers', if you will, one involves webhooks and the other involves the chokidar node module. These watchers will send notifications every time there is a relevant event triggered (i.e. file added, modified, deleted) and we handle those responses accordingly.

For local files, these events are handled in localhook.ts, where chokidar is configured as well. For Autodesk Fusion 360 files, these events are handled in server.ts which also uses functions in the forge-webhooks.ts file to set up and configure webhooks to send events to the server.

Basically, when a file is added/modified in a local directory, we upload it to the corresponding folder in Fusion 360, and when a file is added/modified in Fusion 360, it is downloaded to the corresponding local directory. File deletions don't yet work both ways because there is currently no way of deleting a Fusion 360 file through their API, so deleting a local file will not be followed by the corresponding Fusion 360 file being deleted. However, if a Fusion file is deleted, then the corresponding local file will be deleted.

Database

The database is necessary for tracking all the files being manipulated by the app, and is necessary to make sure we are performing the correct file operations.

Clone this wiki locally