Refactoring NearBeach

In the last year and a half I finally took a web development job full time. In that time I have learned a lot of new technologies like Webpack, VueJS, D3 etc. I am now turning around and seeing that I can improve NearBeach tenfold by applying what I have learned.

The majority of the issues left with NearBeach revolve around the UI/UX, and code base that I can improve. For example I can structure NearBeach a lot better – so the code flows a lot nicer and it becomes easier to program for.

Here are good examples of this are;

  1. view.py file currently sits at being 10711 lines long. Finding sections within that code takes time.
  2. Some forms are overly complex, i.e. the quote line items, and are becoming harder to fix any bugs or issues associated with them. Without the server time taking too long to render the form.
  3. Code is being repeated over multiple spots – for example the following code
    project_results = project.objects.filter(…
  4. No structure for the JS/CSS files

The general fixes for these would be;

  1. Split the view file into separate files for each modules. This will make each file smaller and easier to find the class you need
  2. Move a lot of the complexity out of the back-end and place it into front-end. VueJS is a powerful library that can easily deal with complicated forms
  3. Move these repeated codes into their own python file, with their own functions
  4. Utilise webpack to bring together all the required files for each library. Structure the folders for any JavaScript or SASS I write

As I am not releasing any new functionality – I am planning on implementing these changes during beta.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.