How ratbo99/node-acc-backup works
Project Type and Purpose
• This project is a simple Node.js script designed to back up Autodesk Construction Cloud projects.
• Its purpose is to connect via a server-to-server application (using CLIENT_ID and CLIENT_SECRET) to Autodesk Construction Cloud and Data Management APIs in order to retrieve project data and download files.
• It has a “command line” or single-entry point interface given that you start the application by running server.js, which takes user inputs for authentication and backup destination.
File Structure
• The project is very lightweight with just a few files:
• .gitignore and LICENSE for project management.
• README.md holds the project’s purpose, instructions, and acknowledgments.
• package.json describes the Node.js dependencies and scripts.
• server.js is the main file that contains the application logic.
• There are no explicit directories, so all main logic is consolidated into server.js with external interactions.
Main Components
a. User Input / Startup:
• This is the starting point where the user launches server.js and inputs the CLIENT_ID, CLIENT_SECRET, and Backup Destination.
b. Node.js Runtime Environment:
• This is where the server.js code executes and interacts with other components.
c. Autodesk Construction Cloud API Integration:
• This component represents the connection to Autodesk’s APIs (both the Construction Cloud API and Data Management API).
d. Configuration and Speedtest Component:
• Config file (config.json) that holds parameters (like SPEEDTEST). If enabled, a speedtest (bandwidth measurement) module is invoked to calculate the appropriate expiration times for download links.
e. Local Backup Storage:
• A component that represents the backup destination (local file system or external storage destination) where the projects will be stored after the download.
Relationships and Interactions
• A clear data flow:
• From there, illustrate the process that forms an API call to Autodesk Cloud APIs.
• That the application receives authenticated responses (download links that are time-sensitive).
1. Startup/Input → 2. Configuration Loading/Optional Speed Test → 3. API Integration/Authentication → 4. Data Download → 5. Backup Storage.
Architectural Patterns and Design Principles
• Given the simplicity of the application, the architecture is essentially a monolithic, single-process script.
• Proper dependency and error-handling paths when dealing with short-lived download links.