Table of Contents
- Runtime: Node.js with Bun for development
- Framework: Hono.js
- Language: TypeScript
- Database: File-based with DB service abstraction
The backend follows a service-oriented architecture with clear boundaries:
graph TD
Server["Server Layer (Hono.js)"] --> Services["Service Layer"]
Services --> SubmissionService["Submission Service"]
Services --> ProcessorService["Processor Service"]
Services --> TransformationService["Transformation Service"]
Services --> DistributionService["Distribution Service"]
Services --> ConfigService["Configuration Service"]
Services --> PluginLoader["Plugin Loader Service"]
style Server color:white
style Services color:white
style SubmissionService color:white
style ProcessorService color:white
style TransformationService color:white
style DistributionService color:white
style ConfigService color:white
style PluginLoader color:white
The backend features a powerful plugin system with:
- Runtime module federation for dynamic loading
- Hot-reloading support
- Type-safe plugin configuration
- Custom endpoint registration
- Scheduled task integration
Supported plugin types:
- Source plugins (Twitter, Telegram, etc.)
- Transformer plugins (AI Transform, Simple Transform)
- Distributor plugins (Telegram, RSS, Notion, Supabase)
- Bun runtime installed (for development)
- Node.js 18+ (for production)
- Twitter API credentials (for content source)
- Install dependencies:
bun install
- Configure environment:
cp .env.example .env
- Start development server:
bun run dev
Run the test suite:
bun test
Run tests in watch mode during development:
bun test --watch
API documentation is available at /swagger
when running the development server.
To develop new plugins for curate.fun, see the Plugin Development Guide.
Plugins can extend the platform in various ways:
- Add new content sources
- Create custom transformations
- Implement new distribution channels
The plugin system provides a standardized interface with type safety and comprehensive testing support.
AWS has been configured inside of the container, in order to take manual back-ups to Tigris object storage. These backups can be installed and replace .db/submissions.sqlite for local development, or for testing migration scripts.
- SSH into container
fly ssh console
- Export a backup, and then gzip it
litefs export -name db ./backups/MONTH-DAY
gzip ./backups MONTH-DAY
- Save to S3 bucket (environment is preconfigured with S3 secrets)
aws s3 cp ./MONTH-DAY.gz s3://curatedotfun-backups/MONTH-DAY.gz --endpoint-url https://fly.storage.tigris.dev
- Download from Tigris, unzip, and replace .db/submissions.sqlite