Prerequisites
Before you begin, ensure you have the following installed:Required Software
Node.js >= 24.13.0
Node.js >= 24.13.0
Fire requires Node.js version 24.13.0 or higher.Install Node.js:Verify installation:
pnpm Package Manager
pnpm Package Manager
Fire uses pnpm for dependency management.Install pnpm:Verify installation:
PostgreSQL Database
PostgreSQL Database
Fire uses PostgreSQL for data persistence.Install PostgreSQL:Start PostgreSQL:
Git
Git
Version control for the codebase.
Initial Setup
Install Dependencies
Install all required npm packages:This will install:
- TypeScript and type definitions
- Discord.js (Fire’s custom fork)
- Discord Akairo framework
- Database drivers
- All other dependencies from package.json:29-58
Set Up Environment Variables
Create a
.env file in the project root:.env
Get your Discord bot token from the Discord Developer Portal
Create Discord Bot Application
Go to Discord Developer Portal
Enable Intents
Enable the following Privileged Gateway Intents:
- Server Members Intent
- Message Content Intent
- Presence Intent
Compile TypeScript
Compile the TypeScript code to JavaScript:This runs the build script from package.json:17:The compiled code will be in the
dist/ directory.Development Scripts
Fire provides several npm scripts for development:Available Commands
package.json:14-20
TypeScript Configuration
Fire uses a specific TypeScript configuration:tsconfig.json
Key Settings
- target: ESNext - Uses latest ECMAScript features
- module: CommonJS - Node.js compatibility
- sourceMap: true - Enables debugging with source maps
- outDir: dist/ - Compiled output directory
- paths: Module aliases for cleaner imports
Project Structure
IDE Setup
Visual Studio Code (Recommended)
Recommended Extensions:- ESLint
- Prettier - Code formatter
- TypeScript Vue Plugin
- GitLens
WebStorm / IntelliJ IDEA
- Enable TypeScript support
- Configure Prettier as default formatter
- Set up Node.js interpreter (v24.13.0+)
- Enable “Reformat on Save”
Troubleshooting
Common Issues
Module resolution errors
Module resolution errors
If you see errors like
Cannot find module '@fire/lib/Fire':- Ensure TypeScript paths are configured in tsconfig.json
- Rebuild the project:
pnpm compile - Restart your IDE
Database connection errors
Database connection errors
If Fire can’t connect to PostgreSQL:
- Verify PostgreSQL is running:
sudo systemctl status postgresql - Check credentials in
.envfile - Ensure database exists:
psql -U postgres -l - Check lib/Fire.ts:440-471 for connection logic
Discord API errors
Discord API errors
If you get 401 Unauthorized:
- Verify
DISCORD_TOKENin.env - Ensure token hasn’t been regenerated in Developer Portal
- Check bot has required intents enabled
Build errors
Build errors
If TypeScript compilation fails:
- Delete
dist/andnode_modules/ - Run
pnpm install - Run
pnpm compile - Check for TypeScript version compatibility
Getting Help
GitHub Issues
Report bugs or request features
Fire Discord Server
Ask questions in the development channel
Next Steps
Now that your environment is set up:Create Commands
Learn how to create your first command
Create Modules
Build background modules
Architecture
Understand the codebase structure