Coder Social home page Coder Social logo

cubbyhole_dev's Introduction

cubbyhole_dev

Install

  1. Download & install Python 2.7.6 (NOT THE 3.3!) http://www.python.org/getit/

  2. Open a bash:

    npm install -g node-gyp

  3. For Windows: Download & install OpenSSL for Windows (NOT THE LIGHT VERSION!) (Ex: Win64 OpenSSL v1.0.1f) http://slproweb.com/products/Win32OpenSSL.html

  4. Install MongoDB. For CentOS (http://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat-centos-or-fedora-linux/) :

Create a /etc/yum.repos.d/mongodb.repo file to hold the following configuration information for the MongoDB repository:

[mongodb]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
gpgcheck=0
enabled=1

Install mongodb:

sudo yum install mongodb-org

sudo chkconfig mongod on

sudo service mongod restart
  1. Install NodeJS. For CentOS:

    yum install nodejs

  2. Git bash on the projet folder

    npm install

Getting started

Open the mongod console and let it open and running

Git bash on the projet folder

node app.js

Adding Fixtures

Open app.js and uncomment lines 47 to 52:

/** Uncomment to populate db with new Plans & Bws */
	/*
Utils.insertPlanAndBw(function (err) {
	if (err) throw err;
});
*/

Launch the API (see Getting Started above)

Stop the API.

Re-open app.js and comment lines 47 to 52

Re-launch the API. Fixtures are added.

Changing IP Addresses

Open config.js & replace line 3, 16, 19

address: "mongodb://localhost/Cubbyhole"

api: {
    	address: "http://localhost:3000"
	}

webclient: {
    	address: "http://localhost:8000"
	}

with

address: "mongodb://localhost/Cubbyhole"

api: {
    	address: "http://10.0.0.25:3000"
	}

webclient: {
    	address: "http://10.0.0.20:8000"
	}

cubbyhole_dev's People

Contributors

klacabane avatar elodiebatista avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

cubbyhole_dev's Issues

Update GET /user/:id route

We need:

  • the user's 'currentPlan' filled (not just its id)
  • the quantity of storage used by the user
  • the shared Quota used by the user
  • the bandwidth consumed by the user

On the user's profile page, we will display progress bars for storage, shared quota and bandwidth to enable the user to quickly see where he is in his consumption.

Add Sign Up route

REQUEST:

type: 'POST',
url: '/auth/signup',
data: {
   email: email, // string
   pass: pass, // string
   plan: plan // number
}

RESPONSE:

data: {
   sessionKey
   profile: {
     email
     plan
   }
}
OR
error: {
   msg // Possible msg: email already exists
   status (?)
}

Add Sign In route

REQUEST:

type: 'POST',
url: '/auth/signin',
data: {
   email: email, // string
   pass: pass // string
}

RESPONSE:

data: {
   sessionKey
   profile: {
      email
      plan
   }
}
OR
error: {
   msg
   status (?)
}

Add route to get all shared folders

 [{
   _id,
    name,
   type // not very necessary
   size // if possible
   lastModified,
   path: 'My Cubbyhole,folder1',
   owner: {
       _id
       email
   },
   members: [{
       _id,
       email,
       status (joined or still waiting)
       permission: 0 (r-o) or 1 (r-w)
   }]
 }];

Add Logout route

/auth DELETE

sessionKey will be in the X-Cub-AuthToken header

Add all files route

/files GET

API should return all the files that belong to the connected user (check X-Cub-AuthToken to know the user) like the example below.

/!\ All the user's files should be wrapped in a parent node named 'My Cubbyhole', with an id equal to -1 and 'folder' as type.

ALSO, EACH NODE (file or folder) SHOULD HAVE AN UNIQUE ID! In the example below, ids are missing.

Example:
var json_from_api = [
{
id: -1,
type: 'folder',
name: 'My Cubbyhole',
children: [
{
type: 'folder',
name: 'America',
children: [
{
type: 'folder',
name: 'United States of America',
children: [
{
type: 'file',
name: 'California'
},
{
type: 'folder',
name: 'Washington',
children: [
{
type: 'folder',
name: 'Orange County',
children: [
{
type: 'folder',
name: 'Kirkland',
children: [
{
type: 'folder',
name: 'Orange County',
children: [
{
type: 'folder',
name: 'Kirkland',
children: [
{
type: 'folder',
name: 'Orange County',
children: [
{
type: 'folder',
name: 'Kirkland',
children: [
{
type: 'folder',
name: 'Orange County',
children: [
{
type: 'folder',
name: 'Kirkland',
children: [
{
type: 'folder',
name: 'Orange County',
children: [
{
type: 'folder',
name: 'Kirkland',
children: [
{
type: 'folder',
name: 'Orange County',
children: [
{
type: 'folder',
name: 'Kirkland',
children: [
{
type: 'folder',
name: 'Orange County',
children: [
{
type: 'folder',
name: 'Kirkland',
children: [

                                                                                                                                                    ]
                                                                                                                                                }
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ]
                        },
                        {
                            type: 'folder',
                            name: 'Canada'
                        }
                    ]
                },
                {
                    type: 'folder',
                    name: 'Europe',
                    children: [
                        {
                            type: 'folder',
                            name: 'France',
                            children: [
                                {
                                    type: 'folder',
                                    name: 'Midi-Pyrénéessssssssssssssssssssssssssssssssssssssssss',
                                    children: [
                                        {
                                            type: 'folder',
                                            name: 'Haute-Garonne',
                                            children: [
                                                {
                                                    type: 'file',
                                                    name: 'Toulouse'
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ]
                        },
                        {
                            type: 'folder',
                            name: 'Portugal'
                        },
                        {
                            type: 'folder',
                            name: 'Spain'
                        }
                    ]
                },
                {
                    type: 'folder',
                    name: 'Oceania',
                    children: [
                        {
                            type: 'folder',
                            name: 'Australia'
                        },
                        {
                            type: 'file',
                            name: 'Tasmania'
                        }
                    ]
                },
                {
                    type: 'folder',
                    name: 'Asia'
                }
            ]
        }
    ];

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.