The ServiceNow Nerd

The musings of a ServiceNow platform developer and enthusiast

The SN Nerd

From ServiceNow POC to Full Stack App

by snnerd
183 views

ServiceNow POC

In my blog post, “Getting Games from Steam using Flow Designer and REST Actions,”Ā I explored how you can use Flow Designer and REST to get games from your Steam library. Later,Ā Carlos Comacho Junior hosted me,Ā where I demonstrated my entire application for rating my Steam games head-to-head.

Ranking game made in my ServiceNow PDI

Unfortunately, a few weeks later, I lost access to my PDI. Although my code was backed up in GIT, I lost all my rating data.

As a ServiceNow Architect, armed with ChatGPT 4, I ventured from the safety of the NowPlatform into full stack dev. I challenged myself to step away from ServiceNow (for a change) and rebuild it as a full-stack app from the ground up. Armed with a ChatGPT4 subscription, I could dive into the full-stack world.

steamgames.whichisthe.best

Fast-forward to today, and I can share that I’ve deployed a stable re-platformed version of my app, rebranded as “WhichIsThe.Best,” on a new platform I developed called the FaceOff Ranking System.

The first iteration of my app is for ranking Steam games, with an integrated login with Steam. I could never get this going in ServiceNow, as they have long since deprecated OpenID 2.0 in favour of OpenID Connect.

steamgames.whichisthe.best

Check it out for yourself at steamgames.whichisthe.best

The TechStack

I ended up using what is known as the MERN stack (with MySQL), which comprises the following:

  • MySQL (Database)
  • Express (Client-Server)
  • ReactJS (Client)
  • NodeJS (Server)

I used MySQL because it was all I knew.

ReactJS was the only choice as it seemed popular, and I had heard stories of people trying to hack it into the Service Portal. I can see the advantages over AngularJS used in Service Portal (a technology decision I am sure ServiceNow regrets).

Express was used, as that is what everyone seemed to be using and what GenAI suggested.

I picked NodeJS because it is similar to Rhino (ServiceNow server-side JavaScript). While similar, they are slightly different. GenAI was very fluent. ServiceNow Script includes could not simply be copy-pasted; not just because of syntax differences, but API too.

Rhino

FaceOffUtils.prototype = {
    initialize: function() {

        this.algoGr = this.getDefaultOpponentSelectionAlogGr();
        this.judgeGr = new GlideRecord('x_43553_faceoff_judge');
        this.judgeGr.get(FaceOffUtils.GetCurrentJudgeSysId());
		this.judgeSysId = this.judgeGr.getValue('sys_id');
		this.filterRelevantOnly = false;
    },

NodeJS

class FaceOffMatchUpManager {
    constructor(profileId) {
        this.profileId = profileId || "76561197961776837"; // Default profile ID
        this.bestSelection = null;
        this.bestSelectionIndex = -1;
    }

IDE

I’m just using boring old VSCode. I was also recommended an IDE called Cursor, which has embedded GenAI capabilities.

Deployment

The site is hosted onĀ https://cloud.digitalocean.com/, which hosts my entire stack, including MySQL. Code is deployed automatically when I commit to my main GIT branch.

GenAI?

I leaned on ChatGPT4 a lot to get me through the project.

I didn’t plan on integrating with OpenAI to generate category colours, emojis, descriptions, and images using my own GenAiPI. More on that another time…

Using GenAI to fill pages

Conclusions

Despite having GenAI, building a platform from scratch was a lot more challenging than I thought. I missed having a fantastic platform (like the NowPlatform) with an abstracted database API, load balancing, and low-code tools. Many hours were spent deciphering MySQL errors and navigating foreign keys and cascade deletes – not to mention hitting database connection limits due to poor coding architecture. GlideRecord is amazing!

From this project, I have a stronger appreciation for the ServiceNow platform, and I hope to apply the design lessons learned to the architecture of future ServiceNow solutions!

I also found my PDI again! It is not connected to my developer account; it is floating around in the ether like a museum piece or a relic. PDI – I thank you for your service (no pun intended).

Related Posts

Leave a Comment

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More