Modern App Development on Salesforce and Heroku
Jason Sun
Posted on November 25, 2020
Heroku and Salesforce – From Idea to App
As someone who became a Salesforce developer “by accident” 10 years ago and parlayed that into a career and business, I’m fully aware of the dividends that investing in continuous learning and brushing up on the latest in my industry can yield. Even after years of working in the Salesforce ecosystem, earning 11 certifications, and going through several hundred different projects, I’ve found it’s difficult to make the time to keep up with all the new tools and features of modern development (and usually I have the TrailheaDX and Dreamforce conferences each year to get caught up!).
Due to the Covid19 travel restrictions, in-person conferences are cancelled. However, a new video series piqued my interest. In particular, two Salesforce Developer Advocates, Mohith Shrivastava and Julián Duque, are doing a series on “Modern App Development on Heroku/Salesforce.”
So in an effort to get caught up on the latest in modern app development and cement the information as a personal goal, I’ll be attending the series. I thought I would capture all the technical details in a series of articles both to help me learn the tech, and so that others could learn some of the latest trends in Javascript, Postgres, messaging, microservices, PWA, and more, and how these technologies can be integrated into a cloud platform.
Hopefully, those of you who are web developers looking to expand your skills horizontally into the Salesforce platform, administrators transitioning to development, or experienced Salesforce developer like myself who needs an update on the latest trends in modern app development, will find some gems in this series that will help you along in your career and personal development.
If anything, this will be a pretty cool hands-on experience. I’ll walk you through building an “eCars” app that is a sales and service application for a fictitious electric car company (“Pulsar”). It will allow users to customize and buy cars, service techs to view live diagnostic info from the car, and more. Best of all, we’ll build it using a variety of modern technologies, including:
- Salesforce
- Heroku
- Postgres
- MQTT for pub/sub messaging
- Microservices
- Progressive Web Apps (PWA)
- node.js
- Lightning Web Components (LWC)
If you want to learn more about Mohith and Julián (the creators of this app), I’ve already done the hard part of LinkedIn stalking them for you. You’re welcome.
The First Steps
After the proverbial and mandatory “safe harbor” statement, we’re off to the races (you can find the session here: https://trailhead.salesforce.com/live). There’s going to be a decent amount of focus on javascript and node.js in these articles. These are technologies that I need to personally invest time in learning about, especially for someone who has mostly lived in APEX and Visualforce. Everything seems to be trending away from Visualforce and towards aura components and ultimately lightning web components (LWC). It’s a trend that will be advantageous for existing javascript developers interested in the Salesforce ecosystem, which has consistently seen a shortage of talented developers.
The Salesforce Platform
Although reviewing the Salesforce platform is a bit of review for me (and likely many others experienced with the platform), there are several things to call out here that I’m frequently guilty of taking for granted:
- Salesforce isn’t just a CRM but a cloud platform.
- There are many features that come “out-of-the-box” already taken care of.
- How fast you can start building things out of the gate and for free
Has anyone ever actually set up all these things from scratch?
Aside from the out-of-the-box platform features, I think the biggest reason I got hooked into the Salesforce platform early on was the amount of stuff I could accomplish without having to write any code. Of course I had to move on to the harder stuff like APEX triggers and Visualforce pages - but I was totally hooked once I felt empowered (and a bit big-headed) by all my co-workers coming up to me asking for new features on this “Salesforce thing” I was building for them and rescuing them from an endless maze of Excel spreadsheets.
I had been dabbling in PHP and web development at that time as well, and the fact that some pretty ubiquitous things you need for almost every business application... like
- list views/filters
- UI/navigation
- page layouts
- reports and business logic
just simply gets generated as you create your data model and custom fields was a night-and-day chasm for me. I probably spent anywhere from 5-10x the time creating some report in PHP that pulled data from a mySQL database and displayed it to a user vs. doing the same thing in Salesforce. I don’t do as much web development these days, but reflecting on that experience every now and then certainly helps me appreciate how much faster I can get things done on Salesforce.
Definitely a major time saver when I can get to prototyping my app right away
The Heroku Platform
I actually heard of Heroku before I heard of Salesforce when someone was talking about deploying their Ruby on Rails app and scaling it easily. I only found out years later that Heroku was actually owned by Salesforce! It’s clear that the two platforms share some of the same DNA when it comes to taking care of certain features out-of-the-box for their developers.
The key takeaway is that Heroku is a great partner technology to Salesforce - it takes care of all of the tedious platform and environment prerequisites for you so that someone developing in any number of application languages can deploy and host their app on the platform and focus on their app instead of the infrastructure.
Again, like Salesforce, the platform itself is turn-key in the right places
Activities and Conclusion
Now we need to focus on setting up your environment for the eCars application. I already had most of this installed from previous training sessions, and once they’ve installed, this step can typically be skipped the next time.
- Getting a free Salesforce dev org: https://developer.salesforce.com/signup
- Installing the Salesforce CLI: https://developer.salesforce.com/tools/sfdxcli
- Installing Git (required for Heroku CLI): https://git-scm.com/book/en/v2/Getting-Started-Installing-Git (I also personally have Github Desktop)
- Installing the Heroku CLI: https://devcenter.heroku.com/articles/heroku-cli
- Installing VSCode: https://code.visualstudio.com/ (Definitely also get the Salesforce Extension Pack after VSCode is installed)
- Cloning the eCars GitHub repo: https://github.com/trailheadapps/ecars
One of the last steps is to create a directory on the local machine for the project. You should be able to just run the following command in the project directory to clone the repo.
git clone https://github.com/trailheadapps/ecars.git
At about the 38-minute mark of the presentation, Mohith walks through this step and also how to enable the Dev Hub in the new developer org, create a scratch org, and push the initial project code into the scratch org.
Now we’re setup - so let’s get started building! The next article will cover diving into Heroku - dynos, deploying, Lightning Web Components, and more.
Conclusion
Something I’m certainly looking forward to in this series is exploring the interplay between Salesforce and Heroku with Salesforce as the primary application and Heroku hosting microservices that the Salesforce app will consume. I know from experience working with many clients and projects that cross-platform integrations with external applications and services are one of the most requested features when we’re talking about a build, and I’m excited to see how Heroku and Salesforce work together in the context of the eCars app.
Finally, it looks like there is an official Chatter group for this series which I joined and certainly recommend to anyone interested in getting the full value of the series to also join. Oftentimes there are valuable discussions and additional references that come out of the group.
About me: If you’re curious about my backstory on accidentally turning into a developer and even competing on stage on a quiz show at one of the Salesforce conventions, you can read this article I wrote for the Salesforce blog a few years ago.
Link to the on-demand session recording:
https://trailhead.salesforce.com/live/videos/a2r3k000001n2Ig/modern-app-development-on-salesforce/
Posted on November 25, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.