This guide walks through the process of setting up Echo for development or deployment.
- Bun 1.0 or higher
- PostgreSQL database
- Discord Bot Token
- OpenAI API Key
-
Clone the repository:
git clone https://github.com/nodebyte/echo.git cd echo
-
Install dependencies:
bun install
-
Create
.envfile:# Discord DISCORD_TOKEN=your_bot_token CLIENT_ID=your_client_id # Database DATABASE_URL=postgresql://user:password@localhost:5432/echo # OpenAI OPENAI_API_KEY=your_api_key TAVILY_API_KEY=your_tavily_key # Optional Settings DEBUG=false LOG_LEVEL=info
-
Create PostgreSQL database:
createdb echo -
Run migrations:
bunx prisma migrate dev
-
Generate Prisma client:
bunx prisma generate
-
Start in development mode:
bun dev
-
Format code:
bun run prettier --write .
-
Run migrations:
bunx prisma migrate deploy
-
Start the bot:
bun start
- Create application at Discord Developer Portal
- Create bot user
- Get bot token and client ID
- Set required intents and permissions
- Set up PostgreSQL database
- Configure connection URL
- Run initial migrations
- Create OpenAI account
- Generate API key
- Configure environment variables
Common issues and solutions:
-
Database Connection
- Check connection string
- Verify PostgreSQL is running
- Check database permissions
-
Discord Connection
- Verify bot token
- Check required intents
- Verify permissions
-
AI Integration
- Validate API key
- Check rate limits
- Verify model access
The bot includes built-in monitoring capabilities. You can:
- Access logs through your NodeByte dashboard
- Use the
/statuscommand to check bot health - View performance metrics in your hosting panel
Keep dependencies updated:
bun updateRun migrations after updates:
bunx prisma migrate dev