Home / Blog

Refactoring php laravel web site based on golang gin

Posted on:2023-04-12 Views:1565 Words:419

This idea came about two months ago when I implemented a Chinese-English bilingual product introduction website with golang gin. Based on that code structure, some blogging functions were also completed, but the progress has been put on hold when I was busy with other urgent projects later. During the eleventh period of this year, I was not too busy, so I developed a few functions intermittently, but there is still a long way to go online. The main reason is that the existing blog implements many and complicated functions, and rewriting is not as easy as imagined.

Core target

  • Familiarize yourself with go & gin for writing websites. After all, this blog was developed bit by bit during the process of self-learning php and laravel. During this period, I also struggled with whether to switch to ASP.NET implementation. After going back and forth, I decided to forget it and continue to implement it with go. After all, the advantages of go are still too obvious.
  • Multi-language support: originally only supported Chinese, this time with English support. Domestic public opinion supervision is the biggest risk, and sooner or later they may also move abroad.
  • Golang replaces php: The performance of php laravel is too stretched, and the version upgrade is extremely cumbersome for the server side. And go can perfectly solve these two problems.
  • Interface modernization tailwind css / material design: using the flowbite component library, it’s a little fun to write. No longer limited to bootstrap components.
  • Cull tool. Convenient open source
  • AMP redirects to the original site, which is a waste of effort because it cannot be maintained. The point is I don’t have to
  • Enjoy the development process, not the moment after the final release
  • Discover new requirements during the development process and convert them into general-purpose gadgets. For example, the English blog title needs to capitalize the first letter of the word, so an online English word letter case conversion tool was born

Rapid iteration strategy

  • One version is released within a week. At present, it is a bit difficult to realize. It is not very realistic to realize all function reconstruction in one or two hours at night. It can only be realized by cutting functions. For example, remove comments, RSS and other functions.
  • Use the English version of the website as a test field. Anyway, few people visit it. After the function is stable, it will be synchronized to the Chinese version.