Skip to content

[Backend] Cloud Application for Data Visualization and Management using Parse Server, Node.js, GraphQL, and Back4App

License

Notifications You must be signed in to change notification settings

hopetambala/puente-node-cloudcode

Repository files navigation

Puente Backend Application

Build Status Codacy Badge codecov

Puente Node Cloud Code is a repo that demonstrates how Puente uses parse (now parse-server) to create a real-time querying system for consumption on multiple front-ends. Puente moved most of its code to run in Parse Server Cloud Code rather than running on the user’s mobile device so that we can avoid making updates to Google Play or Itunes Connect. When we update and deploy our Cloud Code, it becomes available to all mobile environments instantly and allows us to be agile with fixes.

For a resource guide: https://docs.parseplatform.org/cloudcode/guide/

Table of Contents

Build and run

Dependencies

You will need a .env.staging and a .env.dev file at the root of the project repo with all the necessary environment variables to run the project with all of its dependencies. The dev file here is for the local Node.js/Express server running Parse. The staging variable provided here is for a demo server running on Back4App. For production work, make sure to ask the project lead developer for an .env.production file as it contains the production project credentials.

Build

  1. Install or update npm (sudo apt install npm, npm install -g npm)
  2. Clone Puente-Node-Cloudcode repo git clone https://github.com/hopetambala/puente-node-cloudcode.git or fork this repo
  3. cd puente-node-cloudcode
  4. Run npm install

Run in Two Terminals

After installation

  1. Open one terminal instance and do following: sudo mongod to start mongo instance.(Look at the below guide on how to setup mongod on your machine
  2. In another terminal, serve the application locally by running npm run start.
  3. (Optionally), if you want to start the application with the dashboard, run npm run start-with-dash

Changes made in your code will be automatically reloaded on http://localhost:4040/dashboard.

Development

Node and Parse

This application is built with Parse Server and Back4App. Support for GraphQL will be added soon.

Here are some quick commands to get started in Node:

  • npm install: Install Node dependencies.
  • npm run start: Start the development server.
  • npm run start-with-dash: Start the server with Parse Dashboard.
  • npm run test: Run the test suit on Puente's Staging Parse Server.
  • npm run test-local: Run the test suit using your local Parse Server.
  • npm run lint: Run the ESLinter.
  • npm run lint-fix: Run the ESLinter

Here are some custom commands for this specific project (after you install):

  • npm release: Create a release of this web application
  • npm gh-prune: Remove deleted remote branches on local machine.

Back4app

To get ramped onto the project with Back4App these following steps must be taken:

Testing

Jest

You need two terminals to do testing in Jest. One terminal should be running npm run start or npm run start-with-dash to have the application running. The other terminal will use npm run test.

JSBin

Checkout our pre-setup JSBin to play with our sample server

Locally testing queries

Checkout the sample.html for configuration with our sample server

Guide

Parse Server

Parse Server is an open source version of the Parse backend that can be deployed to any infrastructure that can run Node.js. It works with the Express web application framework and can be added to existing web applications, or run by itself. Its repository is on Github.

Parse offer a backend to store data, push notifications, social media integration for our app etc. The features provided tend to be helpful in prototyping quickly.

  • General Purpose: Open Source
  • Hosting: Self-hosting or Parse Server Hosting providers. Supports local testing and development
  • Custom Code: Supported via Cloud Code
  • Database: Mongo DB
  • Push: Support push notifications for Android, iOS. Also users can manage Push Notifications campaigns
  • Storage: No restricted time limits and no file storage restrictions. Control over backup, restore and database indexes
  • Ideal for: General purpose applications

MongoDB Installations

MongoDB is a document database designed for ease of development and scaling. Its repository is on Github.

This application requires the use of Mongo, here's an explanation of how to install it on Mac OS.

Troubleshooting

Not able to push to Github

Make sure to keep your mongod command running while pushing to origin.

About

[Backend] Cloud Application for Data Visualization and Management using Parse Server, Node.js, GraphQL, and Back4App

Resources

License

Stars

Watchers

Forks

Packages

No packages published