Giter VIP home page Giter VIP logo

meteor-files-demo's Introduction

Deploy Become a patron

Demo app

Links:

Functionality:

  • Upload / Download Files
  • Stream Audio / Video Files
  • Images, PDFs, Texts preview
  • Drag'n'drop support (files only, folders is not supported yet)
  • Image processing (thumbnails, preview)
  • DropBox as storage (note: you can use only one of DropBox or S3 at the same app)
  • AWS:S3 as storage (note: you can use only one of DropBox or S3 at the same app)
  • Login via social networks (allows to make uploaded files unlisted and/or private)
  • Heroku support (including one-click-deploy)

Quick start:

Activate AWS:S3

  1. Read this article
  2. After creating S3 bucket, create CloudFront Distribution and attach it to S3 bucket
  3. Set S3 credentials into METEOR_SETTINGS env.var or pass as the file, read here for more info, alternatively (if something not working) set S3 env.var
  4. You can pass S3 credentials as JSON-string when using "Heroku's one click install-button"

S3 credentials format (region is required):

{
  "s3": {
    "key": "xxx",
    "secret": "xxx",
    "bucket": "xxx",
    "region": "xxx"
  }
}

Activate DropBox

  1. Read this article
  2. Set DropBox credentials into METEOR_SETTINGS env.var or pass as file, read here for more info, alternatively (if something not working) set DROPBOX env.var
  3. You can pass DropBox credentials as JSON-string when using "Heroku's one click install-button"

DropBox credentials format:

{
  "dropbox": {
    "key": "xxx",
    "secret": "xxx",
    "token": "xxx"
  }
}

Activate login via Social Networks

All credentials is set via env.var(s), if you're using "Heroku's one click install-button" - you will be able to pass all of them.

  • Facebook - Create an App:
    • secret: ACCOUNTS_FACEBOOK_SEC
    • appId: ACCOUNTS_FACEBOOK_ID
  • Twitter - Create an App:
    • secret: ACCOUNTS_TWITTER_SEC
    • consumerKey: ACCOUNTS_TWITTER_ID
  • GitHub - Create OAuth App:
    • secret: ACCOUNTS_GITHUB_SEC
    • clientId: ACCOUNTS_GITHUB_ID
  • Meteor Developer - Create an App:
    • secret: ACCOUNTS_METEOR_SEC
    • clientId: ACCOUNTS_METEOR_ID

Deploy to Heroku

# Build an app ypourself, or use pre-build version: https://github.com/VeliovGroup/Meteor-Files-Demo
# Available architectures:
# os.osx.x86_64
# os.linux.x86_64
# os.linux.x86_32
# os.windows.x86_32
meteor build ../build-<your-app-name> --architecture os.linux.x86_64
cd ../build-<your-app-name>
tar xzf <name-of-archive> -C ./
cd bundle/
cp -Rf * ../
cd ../
rm -Rf bundle/
rm -Rf <name-of-archive>
touch Procfile
echo "web: node main.js" > Procfile

heroku create <your-app-name> --buildpack https://github.com/heroku/heroku-buildpack-nodejs
# This command will output something like:
# - https://<your-app-name>.herokuapp.com/
# - https://git.heroku.com/<your-app-name>.git

# ONLY FOR CEDAR <= 14 - Add GraphicsMagick buildpack - for image manipulations
heroku buildpacks:add --index 1 https://github.com/mcollina/heroku-buildpack-graphicsmagick.git

# FOR CEDAR >= 16 - Add APT buildpack - to install graphicksmagick
heroku buildpacks:add --index 1 https://github.com/heroku/heroku-buildpack-apt

git init
heroku git:remote -a <your-app-name>

# Copy this: `https://<your-app-name>.herokuapp.com`, note `http(s)://` protocol
heroku config:set ROOT_URL=https://<your-app-name>.herokuapp.com
# To have a MongoDB, you can create one at https://mlab.com/
# After creating MongoDB instance create user, then copy URL to your MongoDB
# Should be something like: mongodb://<dbuser>:<dbpassword>@dt754268.mlab.com:19470/mydb
heroku config:set MONGO_URL=mongodb://<dbuser>:<dbpassword>@dt754268.mlab.com:19470/mydb

# For DropBox:
# heroku config:set DROPBOX='{"dropbox":{"key": "xxx", "secret": "xxx", "token": "xxx"}}'

# For AWS:S3:
# heroku config:set S3='{"s3":{"key": "xxx", "secret": "xxx", "bucket": "xxx", "region": "xxx"}}'

# For Facebook:
# heroku config:set ACCOUNTS_FACEBOOK_ID=xxx ACCOUNTS_FACEBOOK_SEC=yyy

# For Twitter:
# heroku config:set ACCOUNTS_TWITTER_ID=xxx ACCOUNTS_TWITTER_SEC=yyy

# For GitHub:
# heroku config:set ACCOUNTS_GITHUB_ID=xxx ACCOUNTS_GITHUB_SEC=yyy

# For Meteor Developer:
# heroku config:set ACCOUNTS_METEOR_ID=xxx ACCOUNTS_METEOR_SEC=yyy

# Enable sticky sessions, to support HTTP upload:
heroku features:enable http-session-affinity

git add .
git commit -m "initial"
git push heroku master
  • Go to https://<your-app-name>.herokuapp.com
  • If your app has errors:
    • Check logs: heroku logs --tail
    • Try to run locally and debug: heroku run node

Support this project:

meteor-files-demo's People

Contributors

dr-dimitru avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.