Skip to content

Project structure

Sim edited this page Mar 16, 2024 · 10 revisions

FreeSO Launcher is a desktop application developed with Electron, made with Windows and macOS compatibility in mind. It has an automated build process leveraging GitHub Actions, which is free for open-source projects.

Key Facts

  • Monorepo Structure: The project adopts a monorepo approach, consolidating multiple related applications within a single repository. This setup facilitates easier management and integration of the applications. The primary application resides in the app directory, while auxiliary applications are located in extras. Each application requires building within its respective directory, typically generating binaries in a release folder.

  • Supported IDE: Development is primarily supported in Visual Studio Code, offering a consistent and optimized development environment for contributors. Project-specific configurations are provided to streamline setup and debugging processes.

  • NPM-Based Source Code: Each program, whether part of the app directory or an extras subdirectory, includes its package.json, package-lock.json, and node_modules, adhering to standard npm project structures. This approach ensures dependency management and script execution are handled efficiently.

  • Typing and Documentation: Although TypeScript is not utilized, the project mandates the use of JSDoc for typing. This requirement aims to enhance code clarity and maintainability, ensuring that contributors can easily understand and work with the codebase. The emphasis on JSDoc also supports better documentation practices, making the project more accessible to new developers and contributors.

Project Overview

The project organizes its files into six principal directories, each serving a distinct role in the application's development and deployment process:

Folder Description
.github Hosts GitHub Actions workflow configurations, automating the build and deployment processes.
.vscode Contains shared Visual Studio Code settings for consistent local development and debugging experiences.
app The core of the launcher application, structured as an npm project (including package.json, node_modules, etc.).
extras Comprises applications, tools, and services related to but not essential for the launcher's primary functionality.
release Serves as a staging area for compiled builds, prepared either manually by developers or through GitHub Actions CI.
vendor Includes forks of dependencies no longer supported, ensuring the launcher remains operational and secure.

The app Directory

The app directory is central to development efforts, containing the launcher's application logic and user interface. This directory is further subdivided into five key areas:

Folder Description
export Houses files designated for export from the launcher to the user's system, such as game language packs.
fsolauncher-ui Represents the launcher's frontend, corresponding to Electron's renderer process. This includes all user interface and interaction elements.
fsolauncher The backend portion of the launcher, aligning with Electron's main process. It handles application logic, file management, and integration with the operating system.
scripts Contains build scripts that are executed with npm run buildwin or npm run builddarwin, facilitating the creation of platform-specific builds.
tests Integration tests aimed at verifying the application's stability and functionality, ensuring a reliable user experience.