How to use PostgreSQL in Nodejs

Author posted by Jitendra on Posted on under category Categories Node.js, Web Technology and tagged as Tags , , , , , with 8 Comments on How to use PostgreSQL in Nodejs

I have written many articles on Node.js and AngularJs. In this article, I will demonstrate how to use PostgreSQL with Node.js and deploy on Heroku. I think you already smelled that this is one of starting article which will finally merged with Salesforce to create some cool application.

Assuming you already have some background knowledge on Node.js and Heroku, If not please visit previous articles of this blog or my Slideshare account. Using Angularjs is totally optional and you can use library like JQuery or plain JavaScript.

To connect PostgreSQL, we need “pg” module.

PostgreSQL in Node.js
PostgreSQL in Node.js

Continue reading “How to use PostgreSQL in Nodejs”

Dreamforce 2014 Session – create web based IDE for Salesforce

In Dreamforce 2014, I got chance to present demo of creating online IDE for Salesforce using Tooling API. I used Node.js as a language to communicate with Salesforce API on Heroku Platform.

Demo

  1. Simple Editor

Complete source code (Github)

  1. Simple Editor
  2. Editor with Ace framework

Dont forget to share your feedback.

Below is the presentation slide I used

Creating Salesforce Query Builder in Node.js and AngularJs using Salesforce REST API and OAuth2 with Heroku Button

In this post, we will be creating a Salesforce Query (SOQL) Builder. It uses Google’s Angularjs MVC Javascript library and REST API provided by Salesforce. For Authentication, it uses OAuth2.

Node.js is used as a primary language and hosted on Heroku. If you want to directly deploy to your Heroku Account, You can use Heroku Button on this Git Repository.

We have many tools available online for Query builder, However none of them were satisfying me so though to create my own tool.

This Node.js application is used for building SOQL with following features :

  • Toggle between API name and Label Name
  • Search Objects or Fileds needs to build SOQL (In my case, it was primitive. I had more than 70 Objects and many of those objects has 300+ fields)
  • Checkboxes to select fields (No need to hold control button to select multiple fields)
  • Automatic Query Builder at Right side of page
  • Shows API count used by application
  • Search returned records
  • Sorting on Table Headers
  • Pagination

Note : You will need to create “Connected App” in Salesforce to allow OAuth as explained in this post.

Live Demo of application

Continue reading “Creating Salesforce Query Builder in Node.js and AngularJs using Salesforce REST API and OAuth2 with Heroku Button”

Create Node.js Application using Eclipse and deploy to Heroku – Video Tutorial

In Below video, I have explained how to create basic Node.js application in Eclipse with help of Egit and Heroku plugin and deploy to Heroku.

Please read below two articles, to get familiar of Plugins and how to setup :

  1. Salesforce + Git + Eclipse + EGIT = Better and Distributed Source Control
  2. Creating First Application in Heroku using Eclipse

Continue reading “Create Node.js Application using Eclipse and deploy to Heroku – Video Tutorial”

Resolve Error : Eclipse SSH key is not matching the SSH key(s) that is associated with your Heroku account

We have seen that how to create First Heroku application using Eclipse. However it is possible that after following all steps properly in above article you may receive error saying

the Eclipse SSH key is not matching the SSH key(s) that is associated with your Heroku account. To fix this error, you can: – Associate your SSH key to your Heroku account by going to “Preferences” OR – If the SSH Key is correct, restart Eclipse

Eclipse and Heroku SSH key is not matching
Eclipse and Heroku SSH key is not matching

However, if you will login to heroku, you will find that application is already created. Error is only at Eclipse end. Continue reading “Resolve Error : Eclipse SSH key is not matching the SSH key(s) that is associated with your Heroku account”

Step by step guide to Setup Federated Authentication (SAML) based SSO in Salesforce – Video Tutorial

In this post, We will be dicussing how to setup Federated SAML based Authentication in Salesforce.

SAML stands for “Security Assertion Markup Language” and it is Open standard for exchanging Authentication and Authorization between Systems. SAML based authentication is supported by all editions of Salesforce.

User Validation can be initiated by any one of below two types:

  1. Service Provider Initiated SSO
  2. Identity Provider (IDp) initioated SSO

We are going to use Identity Provider Initiated SSO in this article. Means User will Login from Outside(IDp) and will be redirected to Salesforce (Service Provider). Identity Provider must follow Federated Authentication (SAML) standard which should be deployed to DMZ (URL should be publicly accessible on Internet) layer of your Organization. As a Salesforce developer you should assume that you will always get IDp URL which implements SSO and implements valid SAML response. To Quickly start with this tutorial assume that your organization already deployed SAML based Authentication endpoint and for that we will be using great Heroku app available freely as open source named “AXIOM“.

AXIOM is java based heroku application which implements SAML and can be used for testing  purpose to check whether SSO is working properly or not.

IDp Initiated Single Sign On :

In IDp Initiated SSO, User Directly logins to Identity provider and IDp redirects user to proper Salesforce Instance with SAML assertion in request (Service Provider). If SAML assertion is valid then Salesforce validates that user successfuly. Continue reading “Step by step guide to Setup Federated Authentication (SAML) based SSO in Salesforce – Video Tutorial”

Creating First Application in Heroku using Eclipse

Hello Readers, in this article we will see step by step procedure to deploy your first (Hello World) program in Heroku. There are two ways, first going through series of Commands of “Heroku” and “GIT” and other simple and smart way is to use Eclipse Capability with Heroku. To make things easier we will go by second method.

!Deprecated!

This tool / blog post is deprecated. Please follow this guide to deploying applications to Heroku from Eclipse. If you still want to follow this post, then download Eclipse plugin for Heroku from here.

Prerequisites:

Installation and Set up:
First we will need to Install Heroku Plugin in Eclipse. To install it, Navigate to “Help | Install New Software” and click on “Add” button.

Give any name in website like “Heroku Plugin” and enter this URL in Location https://eclipse-plugin.herokuapp.com/install and click on “Ok” and Finish Installation. It will install the Heroku Plugin required to start your first Plugin.

Next step is setting up your Credentials for Heroku :

Navigate to “Window | Preferences | Heroku”, Here either enter your UserName and Password of Heroku Account and click on “Login” or enter you API key, which you can find by logging into your Heroku Account.

Setting up Credentials for Heroku in Eclipse
Setting up Credentials for Heroku in Eclipse

Continue reading “Creating First Application in Heroku using Eclipse”