Upload files to an AWS S3 bucket and automatically sync them to a dropbox account using a an AWS Lambda function.
- Node.js http://www.nodejs.org/
- Express http://expressjs.com/
- AngularJS http://angularjs.org/
- Grunt - Download and Install http://gruntjs.com
- AWS Developer Key
- Dropbox Developer key - https://www.dropbox.com/developers/core
$ npm install -g bower
$ npm install -g nodemon
Client - Angular.js ,Bootstrap, Sass
Server - Node.js, Express server
DropBox File Sync - AWS Lambda function (written in node.js)
- Create the file server/config/env/development.js & specify the following value
'use strict';
module.exports = {
dropbox: {appKey: "YOUR DROPBOX APP KEY",
appSecret: "YOUR DROPBOX APP SECRET"},
aws: { accessKey: "YOUR AWS ACCESS KEY",
secretKey: "YOUR AWS SECRET KEY",
tokenBucket: "NAME OF A PRIVATE S3 BUCKET TO STORE DROPBOX BEARER TOKEN",
fileUploadBucket: "NAME OF AN S3 BUCKET TO UPLOAD FILES"
}
};
- Create the file AWS lambda functions/dropbox-s3-sync/config/env/development.js & specify the following value
'use strict';
module.exports = {
dropbox: {appKey: "YOUR DROPBOX APP KEY",
appSecret: "YOUR DROPBOX APP SECRET"},
aws: { accessKey: "YOUR AWS ACCESS KEY",
secretKey: "YOUR AWS SECRET KEY",
tokenBucket: "NAME OF A PRIVATE S3 BUCKET TO STORE DROPBOX BEARER TOKEN",
fileUploadBucket: "NAME OF AN S3 BUCKET TO UPLOAD FILES"
}
};
$ cd /client
$ grunt serve
$ cd /server
$ npm test
open a browser and navigate to http://localhost:3000 & off you go!
$ cd "/AWS lambda functions/dropbox-s3-sync"
$ grunt lambda_package lambda_deploy
- To the very nifty grunt aws lambda task.
- Good Blog post on streaming files to S3 from node.js