DEV Community

Sumit Roy
Sumit Roy

Posted on

Improvements in my web app

What I got

I got any reviews and suggestion from peers and from friends. Some of them were

  • Homepage font is awesome
  • The app is nice but loading is slow.

After all these reviews now is the time for improvement. The first thing I must consider is the loading time of my web app which was very high due to the use of .gif file in background hence I compressed it manually though I was not satisfied with the loading time. So introduced a new package in my project compression

var compression = require('compression')
var express = require('express')
var app = express()
Enter fullscreen mode Exit fullscreen mode

One more idea came to my mind. What if the background will be chosen randomly?

Random background

I introduced 4 more gifs in my static/img folder and wrote a small script to chose them randomly.

var source = [
var randomNumber = Math.floor(Math.random()*source.length);
$('body').css('background-image', 'url(/img/'+source[randomNumber]+')');
Enter fullscreen mode Exit fullscreen mode

And voila everytime the user reloads he will get a new background(most of the time).

Homepage 1 Homepage 2 Homepage 3

Search optimization

One more tweak I would like to do in future is optimizing the search by including a separate column for tsvector and indexing that using GIN. Going through the documentation of PostgreSQL I ran into these three pages for optimizing full-text search and info about the functions.

Here is the index of all the post regarding this series of snipcode developemnt

Part I: App Idea
Part II: App prototype
Part III: Local Development
Part IV: G for Git
Part V: Data Modeling
Part VI: Data & Auth APIs
Part VII: Basic Functionalities
Part VIII: App Screen 1
Part IX: App Screen 2
Part X: App Screen 3
Part XI: User Reviews
Part X: Final Submission

Top comments (0)