An open API service indexing awesome lists of open source software.

https://github.com/jvegar/ts-dropbox-folder-sync

Folder Sync app for Dropbox
https://github.com/jvegar/ts-dropbox-folder-sync

dropbox-api mongodb prisma-orm

Last synced: 11 months ago
JSON representation

Folder Sync app for Dropbox

Awesome Lists containing this project

README

          

# dropbox-folder-sync

Console app for syncing a local folder with a dropbox folder

## Steps to run app

1. Install packages

```
npm install
```

2. Create .env file from .env.local and replace the required values

```
cp .env.local .env
```

3. Run app:

```
npm run dev
```

## Architecture

- 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

- 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

- 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