First, the background of open source

It’s going to be a little wordy, so please skip. Not at all.

In the past two years, the unit I worked for was a relatively backward one with backward technology, and the salary calculation was based on Excel. Their boss wanted to change it later, so he bought a salary management system on Taobao, which seemed to cost 3,000 yuan. He asked me to help him check whether it was appropriate. At that time, I combined their needs and carefully understood the system, and found that it could not meet the needs. Some complicated needs could not be realized by the system, because the template was very fixed, and the calculation method was only addition, subtraction, multiplication and division, not even formula calculation.

So, after some consideration, they asked me to develop the system, but I was still too young to be married, so I said yes. But since we said yes, we have to open the bar.

Finally a person, day and night to open bar for 3 months, bar out. Also put into trial operation. Running effect is good, corrects many haven’t found the problem, for example, employees with hook, a job coefficient, the coefficient of correlation coefficient of wages, their wages were calculated based on excel, often will an employee will be adjusted to other positions, but not the corresponding coefficient of post adjustment, resulting in salary calculation error.

When the system was put on line for trial operation, many such problems were found, and even more, an employee was found to have lost his post salary for one or two years because the post coefficient was not adjusted.

In the end, I was actually happy because the system was approved by them.

But then came the tragedy, the head of the personnel department changed, the new head, shut down the system. I thought the system was a legacy of the previous leader, so the new leader didn’t want to use it. Later I heard that their department was afraid that one day I would quit and no one could take over the management of the system. Oh my God, that makes sense.

Then I made it clear that if you wanted me to continue development, there was no way. No name brings no profit.

Fortunately, I retained ownership of the code in the first place. It’s a shame to think that this system has been running for so long without anyone using it. In that case, let’s open source and see if we can do something about it.

Second, because open source, so refactoring

The early code was also written while learning. With more and more apis and more and more complex functions, in addition, the newly developed project: Domain English APP is based on GraphQL. After realizing the advantages of GraphQL, my heart became more and more eager to reconstruct. But I was afraid I would give up halfway, so I recorded it in my blog and pushed myself to finish refactoring.

Three, technology selection

Open source address of original project

hr-server : https://github.com/yeelone/hr-server

hr-admin : https://github.com/yeelone/hr-admin
Copy the code

Technical selection of the original project:

Backend: Go + Gin+ PostgreSQL Front-end: AngularCopy the code

Original project system screenshots, front-end Angular.

Docker deployment Experience:

3, pull githubroot @ HRGDRC: ~ / project# git pull at https://github.com.cnpmjs.org/yeelone/salary-docker-compose.git docker-composeroot@hrgdrc:~/project# docker-compose build root@hrgdrc:~/project# docker-compose up http://localhost:8010 Test account :admin Password :123456Copy the code

New technology selection:

Front-end: For the time being, maybe flutter Web will be adoptedCopy the code

You may wonder why you should adopt the Flutter Web, because I have been writing about Flutter for more than a year, gradually getting familiar with flutter, and want to unify my technology stack. Also, I think the Platform compatibility of Flutter is good, and I might be able to package it as a Desktop application in the future, which would be much easier to use.

But for now, the main focus is on refactoring the back-end API.

This is the mind brain map.

In the next article, I will hurry up.

directory

Chapter 1: GraphQL and GQLGen