How seolha314/my-fedi-bot works
Project type and purpose
• This is “my-fedi-bot,” a Bun-based federated-social-media bot. It runs entirely on Bun (a fast JS runtime), loads “modules” at run-time, connects to a Fediverse server (e.g. Mastodon), optionally calls an AI API, persists state in a database, and caches media locally.
File structure
• Top-level container/build files: Dockerfile, docker-compose.yml (dev & prod variants), .dockerignore, CONTAINER_DEPLOYMENT.md.
• Config: .env.example, config.example.json, src/config.ts.
• Core runtime: src/index.ts (entry), src/bot.ts (bot logic), src/module.ts (module loader).
• Services: src/database.ts, src/mediacache.ts, src/ai.ts.
• Extensions: src/modules/*.ts (e.g. aichat.ts).
• Tests: test/*.ts.
• Package management: package.json, bun.lockb, tsconfig.json, ESLint/Prettier configs.
README
• Minimal: “bun install” to install, “bun run index.ts” to start. No further architecture docs.
Detail
• How config.ts is consumed by bot.ts and module.ts.
• Module loader reading the file system (src/modules).
• Environment (DEV vs PROD) via separate docker-compose overlays or labels.
• That all modules share the same Bun process, but each may independently call sub-services.
Putting it all together: