Skip to main content

File to Cloud Syncher App

Updated over a month ago

This app is designed to "suck" files from a certain directory and upload it into cloud.

At the moment, it works only for ORDER IMPORT. In the near future, we will expand this functionality and enable the syncher app to call any of the custom actions that can be created in administration-actions.

Create a sync service, give it a name. It will generate a service key.

Next step, download the Sync Service.

There are 2 files containing the settings:

  • .env.sample (needs to be renamed in .env)

  • components.json

.env is self explanatory. Change the settings according to your instance.


# Points to the sync service endpoint on Cloud.
CLOUD_SYNC_SERVICE_ENDPOINT=https://unique_id.freshtrack.com/api/sync

# The Service Key for this service as defined on Cloud.
SYNC_SERVICE_KEY=SERVICE_KEY_FROM_CLOUD

# The number of seconds to wait after all components have been processed.
COMPONENT_PROCESS_COMPLETION_DELAY=5

# The number of seconds to wait after a single component has been processed.
COMPONENT_PROCESS_THROTTLE_DELAY=1

components.json: folders needs to be updated accordingly.

the Type identifies the "action" will call, for order sync, leave it like that. In future more type will be added, most likely the name of the custom actions.

[
{
"type": "order-sync",
"name": "Order Sync",
"config": {
"queueDir": "C:\\Users\\rabvm\\Desktop\\freshtrack-cloud-sync-service\\scratch_dir\\orders\\queue",
"successDir": "C:\\Users\\rabvm\\Desktop\\freshtrack-cloud-sync-service\\scratch_dir\\orders\\success",
"errorDir": "C:\\Users\\rabvm\\Desktop\\freshtrack-cloud-sync-service\\scratch_dir\\orders\\error"
}
}
]

Open command prompt, navigate to the folder and try to run CloudSyncService.exe

Most likely is going to ask you to install a .net component. Install it from the link it provides, and try again.

If it starts, your syncer is operational.

To turn the syncer into a windows service, nnsm.exe can be used. https://nssm.cc/

Did this answer your question?