Getting Started
Prerequisites
- Node.js 18+
- npm or pnpm
Installation
bash
git clone https://github.com/backflow/backflow.git
cd backflow
npm installConfiguration
1. Create config.json
bash
cp config.example.json config.json2. Set Environment Variables
bash
cp .env.example env/.env.developmentEdit env/.env.development:
bash
# Database (choose one)
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your-anon-key
# Authentication
JWT_SECRET=your-secure-secret-key
# Optional: Redis for caching
REDIS_URL=redis://localhost:6379
# Optional: AI features
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...3. Configure Your API
Edit config.json:
json
{
"supabase": {
"url": "{{env.SUPABASE_URL}}",
"anonKey": "{{env.SUPABASE_ANON_KEY}}"
},
"jwt": {
"secret": "{{env.JWT_SECRET}}"
},
"routes": [
{
"path": "/health",
"method": "get",
"description": "Health check"
}
]
}Start Development Server
bash
npm run devOpen:
- API Documentation: http://localhost:3000/ui
- OpenAPI Spec: http://localhost:3000/doc
- Health Check: http://localhost:3000/health
Project Structure
backflow/
├── config.json # Main API configuration
├── env/
│ ├── .env.development # Development environment
│ └── .env.production # Production environment
├── integrations/ # Custom integration configs
├── workflows/ # Workflow definitions
└── src/
├── index.ts # Application entry
├── lib/ # Core services
├── routes/ # API routes
├── middleware/ # Auth, rate limiting
└── types/ # TypeScript typesNext Steps
- Quick Start - Build your first API
- Configuration - Full config reference
- Routes - Define endpoints
- Database - Database operations