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/
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.
- Install or update npm (
sudo apt install npm
,npm install -g npm
) - Clone Puente-Node-Cloudcode repo
git clone https://github.com/hopetambala/puente-node-cloudcode.git
or fork this repo cd puente-node-cloudcode
- Run
npm install
After installation
- Open one terminal instance and do following:
sudo mongod
to start mongo instance.(Look at the below guide on how to setupmongod
on your machine - In another terminal, serve the application locally by running
npm run start
. - (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.
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 applicationnpm gh-prune
: Remove deleted remote branches on local machine.
To get ramped onto the project with Back4App these following steps must be taken:
- Setting up the b4a cli
- Connect your Parse/Back4app app to Back4app Web Service
cd <PROJECT_MAIN_DIRECTORY>
- Run
b4a add
and choose the project you've created in Back4app Web Service - Run
b4a develop
to see changes live with Back4app Web Service
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
.
Checkout our pre-setup JSBin to play with our sample server
Checkout the sample.html for configuration with our sample 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 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.
Make sure to keep your mongod
command running while pushing to origin.