Back

GooseUpdate v3 Codebase Design

Small post about my thoughts when designing the organisation GooseUpdate v3's code.

GooseUpdate Intro

GooseUpdate is an alternative Discord update endpoint which gives users both normal Discord updates with mods (of the user’s choice) patched into them automatically. You can find it on GitHub, and also look at the online dashboard.

v3

I started making v3 as the code for GooseUpdate was becoming more complicated and cluttered; since all the code was in one JS file. The idea for v3 was to split it up to be more manageable, plus more easy to maintain and improve in the future.

Eventual Structure

VSCode screenshot of the directory structure

  • Individual request handlers go in requests/; with the host updates being in requests/host/ for further organisation. Module downloading is also a directory, as it is much more complicated than the other handlers (due to the procedural patching of the desktop_core module).

  • Generic utility functions for the request handlers go in generic/ - redirect and proxy being the two types / modes. Redirect simply redirects the original request to Discord, whilst proxy actually proxies (asks Discord for the normal response then allows the individual handler to edit the response to relay it to the client).

  • Dashboard things (this dashboard) go in dashboard/; with the template HTML and the request handler in it.

  • The temporary migration from GooseUpdate v1 to v2 is included as well in simply v2Migration.js. This is required as the old endpoint was simply <host>, but in v2 I added branches which allow choosing with specific mods you want. New endpoints look like <host>/<branches> (for example: <host>/goosemod or <host>/betterdiscord+goosemod).