Project Structure - Incomplete-Infinity/eve-companion GitHub Wiki

๐Ÿ—‚ Project Structure

This page explains the folder layout and architectural conventions used in the EVE Companion App. The structure is optimized for clarity, modularity, and long-term scalability.


๐Ÿ“ Root-Level Layout

/
โ”œโ”€โ”€ docs/             # Auto-generated documentation (JSDoc)
โ”œโ”€โ”€ img/              # Images and visual references
โ”œโ”€โ”€ src/              # All application source code
โ”œโ”€โ”€ style-guide/      # Design assets, theme drafts, and references
โ”œโ”€โ”€ package.json      # Scripts and dependencies
โ”œโ”€โ”€ jsdoc.json        # Configuration for documentation
โ”œโ”€โ”€ esi.json          # (Optional) local ESI Swagger schema

๐Ÿ“ฆ Source Code (/src)

src/
โ”œโ”€โ”€ api/              # Generated Swagger client (ESI)
โ”‚   โ””โ”€โ”€ esi/
โ”œโ”€โ”€ components/       # (Planned) Reusable UI templates
โ”œโ”€โ”€ js/
โ”‚   โ””โ”€โ”€ main/         # App logic classes (1 per file)
โ”œโ”€โ”€ index.js          # Electron main process entry
โ”œโ”€โ”€ renderer.js       # Renderer process entry (browser UI)

๐Ÿง  Class-per-File Pattern

All core classes reside in src/js/main/ and follow this convention:

File Class Responsibility
InventoryType.js InventoryType Manages item type data from ESI
Character.js Character Encapsulates character data & actions
Corporation.js Corporation Handles corp-specific ESI endpoints
System.js System Represents solar systems from universe

Each file:

  • Exports a single class as default
  • Includes a load() method to fetch from ESI
  • Uses class properties to expose enriched data
  • May cache results locally using Dexie or memory

๐Ÿงพ Naming Conventions

  • Files are camelCase or PascalCase matching class names
  • All class files are suffixed with .js even if later converted to .ts
  • Folder names use kebab-case
  • Class names follow PascalCase
  • All imports are relative to /src using alias support in Webpack (e.g. @/js/main/Character)

๐Ÿงฐ Project Evolution Notes

  • components/ will grow into reusable, isolated UI modules (e.g. window frames, tool panels)
  • Preload scripts (e.g. preload.js) will bridge renderer/main securely (coming soon)
  • Style guide is temporary but useful for empire theme development

๐Ÿ“Œ Summary

  • Source files are organized by purpose and domain
  • Classes are structured around ESI models
  • Clear, readable folder layout keeps the project maintainable