Technical Information for Developers

Electron Framework

OpenHome is built with Electron to allow for compatibility with Linux, macOS, and Windows devices. Electron also provides the ability to prompt for updates, and to use a Node.js "backend" to interact with the operating system.

Electron apps have the downside of taking up more space than native apps, as they are complete web browsers under the hood. The benefits of full Linux/macOS/Windows support currently outweighs the downsides of Electron, as I don't want users to be restricted to a single platform, and native development for three operating systems would take more time than I have.

If the app gains enough users, I plan to migrate to React Native at some point in the future, which would not only provide a smaller app size and better performance, but would also make a mobile app version possible, all while keeping the TypeScript codebase.

TypeScript

TypeScript is a superset of JavaScript, adding static typing and a type checker. TypeScript code transpiles to JavaScript and is not run by itself (with rare exception). The reason I and many others use TypeScript instead of pure JavaScript is because static typing adds many desirable features to a codebase:

People much smarter than me have debated the merits of static typing since before I was born. Ultimately, I believe TypeScript saves more time down the line than it requires upfront by avoiding bugs that would have been caught with a static type system.

JavaScript/TypeScript Modules

Some parts of the code have been split into their own modules. This is to promote better code structure, with low coupling and a smaller codebase for the application itself. These modules are also available for developers of other Pokémon-related JavaScript and TypeScript projects who might want to interface with Pokémon files and data.

pokemon-resources

pokemon-resources provides data on resources like items, balls, met locations, etc. All data has been pulled from Bulbapedia, Serebii, and/or PKHeX.

pokemon-files

pokemon-files includes code for reading and writing pokemon data files (*.pkm, *.pk9, etc). All data structure information is from the research done by the developers of PKHeX.

pokemon-species-data

pokemon-species-data includes data on all Pokémon species and forms, including stats, typing, evolutions, gender ratios, abilities, etc. This module also includes information on Pokémon moves, including typing, power, accuracy, etc across all generations. All data is has been pulled from Bulbapedia, Serebii, and/or PKHeX.