Hello. I have been working for quite some time (a couple years actually) in a niche web app. It controls PPE (Personal Protective Equipment) as requested by Brazilian regulations and do other things related to my field of work, [b]Safety Engineering[/b]. I managed even to embed fingerprint identification into it! Unfortunately a desktop C# app is needed for that, communicating back to the Xojo web app through http socket. Eventually I intend to change it to a Xojo desktop app with UDP or TCP connecting them. I'll have to learn how to do it though...
I was proud and happy with the results until more serious real-world situations arises. This new client, a construction company in the south of Brazil with very poor internet connection on their field offices, complained about the lack of speed of the app. It was true. The app took an embarrassing long time to retrieve data from a MySQL database and present it on weblistboxes. The situation repeated itself when I was presenting it to a potential new client in Rio de Janeiro. I was devastated by it.
Once I returned to my office, I looked into the issue and tried every trick I knew in order to speed it up:
- All webpages are explicitly declared;
- Eliminated unnecessary webpages, webdialogs and webcontrols (It was especially difficult to get rid of some webcontainers I was emotionally attached);
- Reduced the use of events, especially the mouse and key ones;
- Replaced the webimageviews loaded with pictures form URL and mousedown events by simple webbuttons and their action events everywhere in the app;
- Removed the styling features from the weblistbox subclass used in my projects;
- Introduced fontawesome elements to give visual feedback to the user instead of animations and images;
- Developed a helper app to retrieve data from the database and deliver it to the main app using JSON through some file exchanges in the server (it is used to feed the weblistboxes: I intend to extend its use everywhere in the app if it proves beneficial. Im also thinking about changing the data exchange between the apps to IPCSocket, although I have not yet got my hands dirty with it);
- Compiled the resulting app with the Aggressive Optimization Level
- There are 5 copies of the app running behind a Simple Load Balancer as shown by @Christian Schmitz, in order to make it run smoother.
The result seems good enough to me. But I would really, really, REALLY, LOVE to hear honest opinions about it:
- Is it good enough in terms of speed and visuals?
- How does it compare to other successful Xojo web apps?
- Are there any areas it can be improved?
There are some options up my sleeves I have not implemented yet:
- All database interactions are made using MySQLCommunityServer. It can be replaced by MBS SQL Plugin for speed;
- As my client base is in Brazil, I could use a local server (the server is in the US East Coast as of now) to reduce latency;
- The server is a very cost effective three core, 4.8 Ghz, 2Gb RAM 40Gb Disk Space, 2000Gb Bandwidth VPS Ubuntu 16.04 LTS Linux Box from Weblink (a Hostinger subsidiary). I Could have it changed to another Linux flavor with a more powerful configuration on another supplier, such as AWS, Azure or any other. (That would have an undesired effect on cost, I guess);
- The web app is compiled as cgi. It can be compiled as Stand Alone (with some extra effort to get SSL working);
What are the most impacting options from the above?
I have also some other improvements to be made, more of a cosmetic and incremental improvement nature:
- Put a breadcrumb indicator to show users where they are;
- Improve the pagination method to work properly with the JSON Helper app;
- Remove all hardcoded SQL phrases and put them in an accessory file, just as I have already done with other information such as database credentials, using options, icons, fontawesome bits and weblistbox properties (columncount, columnwidth and titles).
- Use a pool of database connections attached to the App object, as opposed to the current practice of having these connections on a per Session basis.
I would also love to hear your opinions about it.
With all that lengthy preamble, I invite you to test my app. As it is in Portuguese with no available foreign language versions, I prepared this little testing script:
1 Log into the system: https://teste.zepiweb.com.br/cgi-bin/inst_5/index.cgi with these credentials:
Usuário (user): xojotest
Senha (password): xojotest
2 Check the employee list: Menu Operações/Cadastros/Funcionarios/Listagem
3 View an employee record: click the edit icon on the right
4 Add a new Setor (area) to the database:
Menu Definições/Organização/Setor
Click on the green Novo button on the right bottom of the page
Name it as you wish (Setor field) and put some comments on the Descrição field
Attach this new record to LBM DATA As Empresa, by selecting it from the dropbox and clicking OK. While in the dropbox, test the textchanged and F2 search features if you wish.
Save the record by clicking on the green Confirma button.
5 Navigate the app anyway you want. If it breaks, please tell me what you were doing.
6 Logout: Menu Usuário (User) (righmost), option Sair, confirm on Sim (Yes).
If you feel like it, please check the older version with my beloved webcontainers on:
https://teste.zepiweb.com.br/cgi-bin/inst_4/index.cgi
Same credentials apply.
ANY comments are welcome!
This is a one-off request to this group, as it can feel abusive to use you guys to test an app.
If you find some feature you like, Ill be happy to share.
As a side note, what I have learned in this development journey, is that coding is challenging and fun. Developing an application that people are willing to pay for, is one of the hardest things I have ever done in my life…
Thanks a lot!