Complete installation guide for self-hosting EmitKit locally.
Before you begin, ensure you have the following installed:
- Node.js 18+ and pnpm package manager
- PostgreSQL database (Docker recommended for local development)
- Tinybird account (sign up)
- Git for cloning the repository
- Redis (optional, for SSE - recommended for production)
Clone the EmitKit repository to your local machine:
git clone https://github.com/yourusername/blip-sk.git
cd blip-skInstall all project dependencies using pnpm:
pnpm installThis will install:
- SvelteKit and Svelte 5
- Drizzle ORM for database
- Better Auth for authentication
- shadcn-svelte UI components
- Tinybird CLI
- All other dependencies
cp .env.example .envOption A: Using Docker (Recommended for Local Development)
Start PostgreSQL with Docker:
pnpm run docker:upThis starts a PostgreSQL container on port 5433.
Your .env should have:
DATABASE_URL="postgres://root:mysecretpassword@localhost:5433/local"Option B: Using Existing PostgreSQL
If you have PostgreSQL already installed, update .env with your connection string:
DATABASE_URL="postgres://user:password@localhost:5432/blip"Generate a random secret for Better Auth:
openssl rand -base64 32Add to .env:
BETTER_AUTH_SECRET="your-generated-secret-here"
BETTER_AUTH_URL="http://localhost:5173"- Sign up for Tinybird at ui.tinybird.co
- Get your API token from ui.tinybird.co/tokens
- Add to
.env:
TINYBIRD_TOKEN="your-tinybird-token"
TINYBIRD_API_URL="https://api.tinybird.co"Generate VAPID keys for web push notifications:
pnpm dlx web-push generate-vapid-keysAdd the output to .env:
PUBLIC_VAPID_KEY="BPx1...xyz"
VAPID_KEY="abc...123"
VAPID_SUBJECT="mailto:your-email@example.com"If you want AI-powered features (like channel description generation):
OPENAI_API_KEY="your-openai-api-key"Get from platform.openai.com
For production-like SSE (real-time updates), configure Redis:
- Create free account at console.upstash.com
- Create a new Redis database
- Get REST URL and token
- Add to
.env:
UPSTASH_REDIS_REST_URL="https://your-region.upstash.io"
UPSTASH_REDIS_REST_TOKEN="your-token-here"Note: Redis is optional for local development. SSE will fall back to polling without it.
Apply the database schema to your PostgreSQL database:
pnpm run db:pushThis creates all necessary tables.
Open Drizzle Studio to verify tables were created:
pnpm run db:studioVisit https://local.drizzle.studio to view your database.
cd tinybird
pnpm exec tb loginThis opens a browser for authentication.
Deploy data sources and pipes:
pnpm exec tb deployThis creates:
- Events data source
- Streaming pipes
- Analytics pipes
pnpm exec tb datasource ls
pnpm exec tb pipe lsYou should see events datasource and several pipes.
Return to project root:
cd ..Start the SvelteKit development server:
pnpm run devVisit http://localhost:5173 to see your app running!
- Navigate to
http://localhost:5173 - Click "Sign Up" or "Get Started"
- Create an account with email and password
- You're ready to start using EmitKit!
After installation, verify everything is working:
- App loads at
http://localhost:5173 - Can create an account and log in
- Database connection successful (check Drizzle Studio)
- Can create an organization
- Can create a site
- Can create a channel
- Can create an event
- Events appear in the channel feed
- Real-time updates work (SSE)
Error: "Connection refused" or "Cannot connect to database"
Solution:
- Verify Docker is running:
docker ps - Check PostgreSQL is accessible:
psql -U root -h localhost -p 5433 -d local - Verify DATABASE_URL in
.envis correct
Error: "Authentication failed" or "Invalid token"
Solution:
- Verify TINYBIRD_TOKEN in
.envis correct - Check token has admin permissions in Tinybird Console
- Try re-running
pnpm exec tb login
Error: TypeScript errors or missing dependencies
Solution:
# Clean install
rm -rf node_modules pnpm-lock.yaml
pnpm install
# Verify Node version (must be 18+)
node --version
# Check for TypeScript errors
pnpm run checkError: "Port 5173 is already in use"
Solution:
- Stop other processes using port 5173
- Or change port in
vite.config.ts:
export default defineConfig({
server: {
port: 3000 // Change to any available port
}
});Now that you have EmitKit installed locally:
- Configure: Review Configuration Guide for all options
- Explore: Create sites, channels, and events to test the platform
- Deploy: When ready, see Deployment Guide for production
- Customize: Modify code and make it your own
- Contribute: See CONTRIBUTING.md if you want to contribute
If you run into issues:
- Check Troubleshooting Guide
- Review logs in terminal for error messages
- Check browser console for client-side errors
- Visit GitHub Issues
# Start development server
pnpm run dev
# Open database GUI
pnpm run db:studio
# Type checking
pnpm run check
# Generate database migrations
pnpm run db:generate
# View Tinybird data
cd tinybird
pnpm exec tb datasource query events "SELECT * FROM events LIMIT 10"The dev server supports hot module replacement (HMR):
- Save any
.sveltefile to see changes instantly - Save any server file to restart the server automatically
- No need to manually refresh browser
When you modify database schema:
- Update schema in
src/lib/server/db/schema/ - Generate migration:
pnpm run db:generate - Apply changes:
pnpm run db:push - Verify in Drizzle Studio:
pnpm run db:studio
When you modify Tinybird resources:
- Edit
.datasourceor.pipefiles intinybird/ - Deploy changes:
cd tinybird && pnpm exec tb deploy - Test pipes:
pnpm exec tb pipe test PIPE_NAME --param key=value
Never commit secrets to Git:
.envis gitignored by default- Never commit API keys, tokens, or passwords
- Use environment variables for all secrets
- Rotate keys regularly
Congratulations! You now have EmitKit running locally. Explore the platform and see Configuration Guide for customization options.