Skip to content

dis-app/disapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Disapp Logo

Disapp

Modern Discord bot framework that makes Discord.js 50-90% easier to use

License: GPL-3.0 TypeScript Discord.js Tests Coverage


Why Disapp?

Discord.js is powerful but verbose. Disapp makes it effortless.

Discord.js - 15 lines

const button1 = new ButtonBuilder()
  .setCustomId('confirm')
  .setLabel('Confirm')
  .setStyle(ButtonStyle.Success);
const button2 = new ButtonBuilder()
  .setCustomId('cancel')
  .setLabel('Cancel')
  .setStyle(ButtonStyle.Danger);
const row = new ActionRowBuilder()
  .addComponents(button1, button2);
await interaction.reply({
  content: 'Are you sure?',
  components: [row]
});

Disapp - 1 line

await interaction.reply({
  content: 'Are you sure?',
  components: [confirm('confirm', 'cancel')]
});

πŸ“– See COMPARISON.md for more examples.

✨ Features

πŸš€ Developer Experience

  • 50-90% less code than vanilla Discord.js
  • Fluent API - Chain methods, build faster
  • Type-safe - Full TypeScript support
  • Hot Reload - Memory-safe, instant updates
  • Auto Registry - Commands sync automatically
  • Zero overhead - Fast and efficient

πŸ› οΈ Built-in Tools

  • Database - Drizzle ORM + PostgreSQL
  • Logging - Winston built-in
  • Config - Centralized management
  • i18n - Multi-language support
  • Components V2 - Advanced Discord UI
  • Error Handling - Global error catching

🎯 Why Choose Disapp?

  • βœ… 100% Compatible - Uses Discord.js under the hood
  • βœ… Production Ready - 301 tests passing, 65%+ coverage
  • βœ… Open Source - GPL-3.0 licensed
  • βœ… Modern Stack - TypeScript, PNPM, Monorepo
  • βœ… Active Development - Regular updates and improvements

πŸš€ Quick Start

Option 1: Create New Bot (Recommended)

npx create-disapp my-bot
cd my-bot
npm install
npm run dev

Option 2: Clone Repository

git clone https://github.com/dis-app/disapp.git
cd disapp
pnpm install
pnpm build:core
pnpm dev:bot

πŸ“š See CREATE_DISAPP.md for detailed setup guide.

πŸ“– Examples

Simple Command

import { Command, successEmbed, confirm } from '@disapp/core';

export default class DeleteCommand extends Command {
  constructor() {
    super({
      name: 'delete',
      description: 'Delete something'
    });
  }

  async execute(interaction) {
    await interaction.reply({
      embeds: [successEmbed('Confirm', 'Are you sure?')],
      components: [confirm('yes', 'no')]
    });
  }
}

Complex Message with Components

import { msg, embed, ButtonStyle } from '@disapp/core';

const message = msg()
  .setContent('# User Management')
  .buttons(
    { label: 'View', id: 'view', style: ButtonStyle.Primary, emoji: 'πŸ‘οΈ' },
    { label: 'Edit', id: 'edit', style: ButtonStyle.Secondary, emoji: '✏️' },
    { label: 'Delete', id: 'delete', style: ButtonStyle.Danger, emoji: 'πŸ—‘οΈ' }
  )
  .userSelect('select_user', 'Choose users', [1, 5])
  .addEmbed(
    embed()
      .info('Info', 'Select an action')
      .addFields(
        { name: 'Total', value: '1,234', inline: true },
        { name: 'Online', value: '567', inline: true }
      )
  )
  .build();

await interaction.reply(message);

Database Operations

import { UserRepository } from '@disapp/core';

const userRepo = new UserRepository();
const user = await userRepo.getOrCreate(
  BigInt(userId),
  username,
  avatar
);

πŸ’‘ See EXAMPLES.md for more code examples.

🎨 Shortcuts & Utilities

Disapp provides powerful shortcuts to reduce boilerplate:

Shortcut Description Usage
msg() MessageBuilder Build complex messages
embed() EmbedBuilder Create embeds easily
btn() Button Create buttons
primary() Primary button Blue button
success() Success button Green button
danger() Danger button Red button
confirm() Confirm/Cancel row Two-button confirmation
yesno() Yes/No row Yes/No buttons
successEmbed() Green embed Success message
errorEmbed() Red embed Error message
warningEmbed() Yellow embed Warning message
infoEmbed() Blue embed Info message

πŸ“˜ See FLUENT_API.md for complete API reference.

πŸ“ Project Structure

disapp/
β”œβ”€β”€ apps/
β”‚   └── web/                    # Next.js documentation website
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ core/                   # Core framework (@disapp/core)
β”‚   β”œβ”€β”€ create-disapp/          # CLI scaffolding tool
β”‚   └── config/                 # Shared TypeScript configs
β”œβ”€β”€ examples/
β”‚   └── basic-bot/              # Example Discord bot
└── docs/                       # Documentation files

πŸ› οΈ Development Scripts

Command Description
pnpm dev Start web documentation server
pnpm dev:bot Run example bot in development
pnpm build Build all packages
pnpm build:core Build core package only
pnpm test Run all tests
pnpm test:core Run core package tests
pnpm db:push Push database schema changes
pnpm db:studio Open Drizzle Studio
pnpm db:migrate Run database migrations

πŸ“š Documentation

Getting Started

Core Features

Advanced

Project

βš–οΈ Disapp vs Discord.js

Feature Discord.js Disapp
Code Amount 100% 10-50% ⚑
Readability Medium High πŸ“–
Type Safety βœ… βœ…
Shortcuts ❌ βœ…
Database ❌ βœ… Built-in
Logging ❌ βœ… Winston
Config Management ❌ βœ… Centralized
Hot Reload ❌ βœ… Memory-safe
Auto Registry ❌ βœ… Automatic
i18n Support ❌ βœ… JSON-based
Cooldowns Manual βœ… Built-in
Error Handling Manual βœ… Global
Testing Manual βœ… 301 tests

πŸ“Š See COMPARISON.md for detailed comparison.

🀝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

Development Setup

  1. Fork and clone the repository
  2. Install dependencies: pnpm install
  3. Build core package: pnpm build:core
  4. Run tests: pnpm test:core
  5. Make your changes and submit a PR

πŸ“„ License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0).

  • βœ… Free to use, modify, and distribute
  • βœ… Open source and transparent
  • βœ… Derivative works must also be GPL-3.0

See LICENSE for full license text.

πŸ› οΈ Tech Stack

Core

  • TypeScript - Type-safe development
  • Discord.js 14 - Discord API wrapper
  • Drizzle ORM - Type-safe database
  • PostgreSQL - Reliable database
  • Winston - Logging framework

Tooling

  • PNPM Workspaces - Monorepo management
  • Vitest - Fast unit testing
  • Next.js 16.2.4 - Documentation site
  • Tailwind CSS 4.2.4 - Styling
  • ESLint - Code quality

🌟 Community & Support

πŸš€ Deployment

Documentation Website

The documentation website (apps/web) can be deployed to Vercel:

Quick Deploy: Deploy with Vercel

Manual Setup:

  1. Import repository to Vercel
  2. Set Root Directory: apps/web
  3. Set Install Command: cd ../.. && pnpm install --frozen-lockfile
  4. Set Build Command: cd ../.. && pnpm --filter web build
  5. Deploy

See apps/web/BUILD.md for detailed instructions.

Discord Bot

Deploy your Discord bot to any Node.js hosting platform:

  • Railway - Automatic deployment from Git
  • Heroku - Container or buildpack deployment
  • DigitalOcean - App Platform or Droplet
  • AWS - EC2, ECS, or Lambda
  • Self-hosted - VPS with PM2 or systemd

🎯 Project Status

  • βœ… v0.1.0 - Comprehensive testing (301 tests, 65%+ coverage)
  • 🚧 v0.2.0 - Documentation improvements (in progress)
  • πŸ“‹ v0.3.0 - Examples & tutorials (planned)
  • 🎯 v1.0.0 - Stable release (planned)

See ROADMAP.md for detailed roadmap.


Disapp = Discord.js + Developer Experience + Best Practices + Productivity

Made with ❀️ by the Disapp team

⭐ Star us on GitHub