Coder Social home page Coder Social logo

bloom-parse-server's Introduction

bloom-parse-server

This is the database backend for bloom-library.org, using the parse-server module.

Here is the full Parse Server guide.

Set Up For Local Development

  1. Make sure you have at least Node 4.3.

    node --version

  2. Clone this repo and go into its directory, and install or update the dependencies:

    npm install

  3. Install mongodb server

  4. Give mongodb a blank directory to work with, and run it:

    mongod.exe --dbpath c:\temp\mongodata

  5. Start up this server:

    npm start

    Or, to debug, open bloom-parse-server in vscode, F5 (Debug: Launch via NPM). Note that this sets the masterid to "123", via an environment variable.

  6. Setup or update the mongodb Schema

    curl -X POST -H "X-Parse-Application-Id: myAppId" -H "X-Parse-Master-Key: 123" -d "{}" http://localhost:1337/parse/functions/setupTables
    

    You should get

    {"result":"SetupTables ran to completion."}

    and see the tables in the dashboard.

  7. Run Parse Dashboard:

    Go to http://localhost:1337/dashboard

    You will be required to log in. The username is the appId ('myAppId'), and the password is the masterKey ('123').

Dashboard

See above for setting up the dashboard locally.

Public dashboards:

You will be required to log in. The username is the appId, and the password is the masterKey.

Sample Queries

curl -X POST \
  -H "X-Parse-Application-Id: myAppId" \
  -H "Content-Type: application/json" \
  -d '{}' \
  http://localhost:1337/parse/functions/hello

Azure Setup

We are running three different services:

  • bloom-parse-server-unittest
  • bloom-parse-server-develop
  • bloom-parse-server-production

Each is backed by a single mongodb at mlab.com. This is how they were made:

  1. Create the mongodb on mlab.com, making sure to select Azure and the same datacenter. Failing to do this increases response times by 3x.

  2. In Azure, create a new "Web App" App Service

  3. In Azure:App Service:Application Settings:App Settings, create these settings:

    DATABASE_URI mongodb://account:[email protected]:port/database

    APP_ID you make this up.

    MASTER_KEY you make this up

    SERVER_URL http://[azure app service name].azurewebsites.net/parse

    Note: Don't leave off that /parse in the SERVER_URL!

    REST API: parse.com used this (not clear what the actual environment variable would be) but as far as I can tell, the open source Parse-Server does not.

  4. In Azure:App Service:Deployment Options, point it at this github repository, with the appropriate branch. A few minutes later, parse-server will be running. Note that Azure apparently does the npm install automatically, as needed. Not also that it automatically redepoys when github notifies it of a checkin on the branch it is watching.

    TODO: Set up Deployment "Slots".

  5. We never touch the schema using the Parse Dashboard or letting queries automagically add clases or fields. Instead, we set up the schema using a Cloud Code function setupTables. If you haven't set up the database already, follow instructions shown above under "Setup or update the mongodb Schema". Use Azure:App Service:Log stream to monitor progress. Note: During one setup, I found this can be flaky, perhaps becuase I jumped the gun. So instead I did the curl post for functions/testDB, which worked. Then I tried functions/setupTables again, and this time it worked.

  6. TODO: Backup, Logging setup.

bloom-parse-server's People

Contributors

abhilash1in avatar andrew-polk avatar bdevore17 avatar drew-gross avatar fabiocav avatar gfosco avatar hatton avatar hramos avatar jeancarlozapata avatar justinbeckwith avatar lovishdogra avatar marcusgadbem avatar moflo avatar nathanmpark avatar peterdotjs avatar rjaviervega avatar rogerhu avatar rorz avatar ryanlelek avatar talkaboutdesign avatar theabstractdev avatar tsanthosh avatar whollacsek 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.