Journey of building a Saas product – Cloud And On Premise

To start with head to Guard-QIS. This is my current demo site.

In summary, what this does is basically assisting manufacture to manage and control their Quality Assurance through inspections. By using this, we help to stored those information and present it in a way that helps upper management to see the production health, as well as assisting engineers to drill down defects and identify root cause.

Let’s get down and dirty.

What I have build here is basically trying to build as a SaaS product. At the same time, to meet the requirement, it has to be on premise. Therefore, I try to keep it simple, which is to run it on a single node.

Doing so, is easy for me to package it into a single executable installation file for distribution as well.

How do I build this?

Simple, write everything in NodeJS for the back-end, and serve the SPA from it as well.

For the back-end, split the file into multiple modules with an endpoint grouping. This is somewhat similar to what you’ll do if you’re going to build micro-services for it. Who know, if anything does happen, and I need to switch to micro-services, it will be much simpler.

On the front-end, I have switch from gulp to ParcelJS for the conveniences of managing the script to compile, build and uglify the code. Personally, it ease so much random stuff and infrastructure that I need to manage.

Finally, wrapping them up into a single distribution folder for deployment.

By leveraging on Sequelize, I can easily switch SQLite or PostgreSQL, vice versa. With this setup, for convenience, opting for SQLite is much easier to install and setup. Which is what I used for development.

module.exports = {
  development: {
    dialect: 'sqlite',
    storage: './dist/guardqis.sqlite',
    logging: false,
  },
  production: {
    dialect: 'postgres',
    use_env_variable: 'DATABASE_URL',
    logging: false,
  },
};

I have run couple of test on transaction and performance as well. PostgreSQL is more stable and faster when in concurrency. With that, on production there is not much choice, ain’t it.