Tabby Server is the backend component of a Chrome extension that helps users manage their tabs by automatically summarizing and organizing content using AI.
- Tab content processing and summarization using OpenAI's GPT
- Automatic content type classification (articles, tweets, LinkedIn posts, etc.)
- Weekly digest generation and delivery via email and Slack
- RESTful API endpoints for tab management
- Queue-based processing system
- PostgreSQL database for persistent storage
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher)
- PostgreSQL
- Redis (v6 or higher)
- npm (comes with Node.js)
Create a .env file in the root directory with the following variables:
DATABASE_URL="postgresql://username:password@localhost:5432/tabby"
REDIS_URL="redis://localhost:6379"
OPENAI_API_KEY="your-openai-api-key"
SENDGRID_API_KEY="your-sendgrid-api-key"
FROM_EMAIL="your-verified-sender@example.com"
NOTIFICATION_EMAIL="recipient@example.com"
SLACK_WEBHOOK_URL="your-slack-webhook-url"
PORT=3000
NODE_ENV="development"
- Clone the repository:
git clone https://github.com/yourusername/tabby-server.git
cd tabby-server- Install dependencies:
npm install- Set up the database:
npx prisma migrate dev- Start the server:
npm run devGET /health- Checks if the server is running
- Returns:
{ status: "ok", timestamp: "ISO-date", uptime: seconds }
-
POST /api/summaries- Creates a new summary
- Body:
{ url, title, type, content }
-
GET /api/summaries/status- Gets the current processing status
- Returns counts of pending/completed summaries
POST /api/newsletter/trigger- Triggers the generation and sending of the newsletter
src/routes/: API routessrc/workers/: Background jobs and processing logicsrc/lib/: Utility functionssrc/prisma/: Database schema and migrationssrc/types/: TypeScript typessrc/utils/: Miscellaneous utility functionssrc/workers/: Background jobs and processing logicsrc/routes/: API routessrc/routes/newsletter.js: Newsletter generation and sendingsrc/workers/newsletter.js: Newsletter generation and sending logicsrc/routes/summaries.js: Summary processing and storagesrc/workers/summaries.js: Summary processing and storage logicsrc/routes/health.js: Health check endpointsrc/routes/newsletter.js: Newsletter generation and sendingsrc/workers/newsletter.js: Newsletter generation and sending logicsrc/routes/summaries.js: Summary processing and storagesrc/workers/summaries.js: Summary processing and storage logicsrc/routes/health.js: Health check endpoint
- Make changes to the code
- Update database schema if needed:
npx prisma generate npx prisma migrate dev
- Test your changes locally
- Deploy using Fly.io:
fly deploy
Build the container:
docker build -t tabby-server .Run the container:
docker run -d --name tabby-server -p 3000:3000 tabby-server- Framework: Express.js
- Database: PostgreSQL with Prisma ORM
- Queue System: BullMQ with Redis
- AI: OpenAI GPT via LangChain
- Deployment: Fly.io
- Notifications: SendGrid (email) & Slack
- Rate Limiting: express-rate-limit
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support, please open an issue in the GitHub repository or contact the maintainers.
- Add Redis for better queue management
- Implement user authentication
- Add more content type classifications
- Improve error handling and retry mechanisms
- Add testing suite
- Add logging
- Add metrics
- Add monitoring
- Add observability