Console app for syncing a local folder with a dropbox folder
- Install packages
npm install
- Create .env file from .env.local and replace the required values
cp .env.local .env
- Run app:
npm run dev
-
Source of Truth: Dropbox folder
-
Client:
-
Initialize:
-
If local folder is empty:
- Download remote files to local
- Regenerate local database (clean->populate)
-
Else:
-
Get remote files and iterate:
- If file exists on local:
- If local file is newer:
- Leave local file intact
- Update content remote file
- If local file exists on local database:
- Update local file metadata (modified)
- Else:
- Insert local metadata file Else:
- Overwrite local file
- If local file exists on local database:
- Update local file metadata (modified)
- Else: - Insert local metadata file Else:
- Download remote file to local
- If local file is newer:
- If file exists on local:
-
Get local files and iterate:
- If local file doesn't exist:
- Upload local file to remote
- If local file exists on local database:
- Update local file metadata (modified)
- Else:
- Insert local metadata file
- If local file doesn't exist:
-
-
-
Online/Offline:
- Update local database
- Generate update remote folder task
- Process task (Pending | Running | Error | Completed)
-
-
File:
- ID: remote ID generated by DropBox
- Path: file path
- Modified: modified datetime
- Created: created datetime
- Status: file status