Documentation Index
Fetch the complete documentation index at: https://docs.databite.dev/llms.txt
Use this file to discover all available pages before exploring further.
Overview
This guide walks you through setting up a Databite server from scratch. You’ll learn how to install dependencies, configure connectors, and start serving REST API endpoints for your frontend applications.Prerequisites
- Node.js >= 16.0.0
- npm or pnpm
- A connector you want to use (we’ll use Slack in this example)
Step 1: Create a New Project
Create a new directory for your server:Step 2: Install Dependencies
Install the core Databite packages:Step 3: Create Environment Configuration
Create a.env file for your secrets:
Step 4: Create the Server
Createserver.ts:
Step 5: Configure Connection Storage
By default, Databite uses an in-memory connection store that loses all connection data when the server stops. For development and testing, this is fine, but for production you’ll want persistent storage.In-Memory Store (Default)
The current setup usesInMemoryConnectionStore, which:
- Stores connections in memory only
- Loses all data when the server restarts
- Is perfect for development and testing
Adding a Persistent Store
- For production, implement the
ConnectionStoreinterface with your database of choice: - Avoid file-based storage for production as it can lead to data corruption and doesn’t handle concurrent access well.
Step 6: Run Your Server
You can run your server directly with ts-node:Step 7: Test Your Server
Test the health endpoint:Step 9: Add Security (Production)
For production, add security configuration:Next Steps
- Connect your frontend using @databite/connect
- Add more connectors from @databite/connectors
