Skip to content

Package System

saedevz edited this page Oct 26, 2026 · 1 revision

Package System

FCDex uses a modular package architecture designed to keep features organized and easier to maintain.

Each package handles a specific area of functionality. This allows features to be developed separately and enabled as the project grows.

Note

The package system is under development. Some packages listed below may not be implemented yet.

Planned packages

Package Purpose
clubs Club collecting and catch interactions
players Player-related features
trade Trading between users
battle Battles and competitive features
economy Economy and progression
admin Administrative commands and controls
specials Special collectibles and events
guilds Server-specific functionality
groups Group-related features
fcscript FCDex scripting system

Package names and responsibilities may change during development.

Directory structure

Packages live inside src/packages/.

The intended structure looks like this:

src/
└── packages/
    ├── loader.ts
    ├── clubs/
    │   └── index.ts
    ├── battle/
    │   └── index.ts
    ├── trade/
    │   └── index.ts
    └── economy/
        └── index.ts

This is an illustrative example. Only directories that actually exist in your version are available.

Package loader

The package loader is responsible for discovering packages and registering enabled features with the Discord client.

A dedicated loader.ts keeps package-loading logic separate from the main application entry point.

The intended loading process is:

  1. Discover available package directories.
  2. Check which packages are enabled in the configuration.
  3. Load each enabled package.
  4. Register its commands, event handlers, or other functionality.
  5. Report loading errors.

The exact behavior depends on the implemented loader.

Enabling packages

Package settings are managed through the local configuration file.

Before enabling a package, verify that:

  • Its directory and entry point exist.
  • Its dependencies are installed.
  • Its configuration requirements are satisfied.
  • It is compatible with the current FCDex version.

Enabling a package in the configuration does not mean its functionality is already implemented.

Developing a package

When adding a new package:

  1. Create its directory under src/packages/.
  2. Add the package entry point.
  3. Follow the package interface used by the project.
  4. Register the required commands and event handlers.
  5. Add configuration options where necessary.
  6. Handle errors and clean up resources appropriately.
  7. Update the documentation when the feature is ready.

Follow the conventions of existing packages to keep the architecture consistent.

Future development

The package architecture will expand as more FCDex features are implemented.

FCScript and BallsDex migration tooling are planned for a later development phase, after the core bot and administration panel are developed.

Their interfaces and documentation will be added when those systems are ready.

Related pages

Clone this wiki locally