LogoRobo.js
Framework

Core Overview

Foundational concepts and APIs that power every Robo.js project.

The Core section covers the foundational concepts, APIs, and conventions that every Robo.js project relies on. Whether you are building a Discord bot, an activity, or a web server, these topics apply across all project types.

Project Foundations

Every Robo.js project follows a consistent file structure where directories like src/commands/ and src/events/ determine functionality automatically. Configuration lives in the config/ directory, and sensitive values are stored in .env files that Robo.js loads at startup.

Data and State

Robo.js provides two built-in systems for managing data. State offers fast, in-memory storage for session-scoped values that survive hot reloads but clear on shutdown. Flashcore provides persistent key-value storage that survives restarts, with support for external databases through Keyv adapters.

Developer Tools

The built-in logger provides structured output with log levels, child loggers, and custom drains. TypeScript works out of the box with zero configuration. Modes let you run different profiles (development, production, or custom) with distinct environment variables and code paths.

Architecture

For larger projects, modules group related commands and events into self-contained units. The Portal API provides runtime access to your project's registered commands, events, and modules. Understanding the internals helps when debugging or extending the framework.

On this page