Skip to content

Getting Started

Prerequisites

  • Node.js 18+
  • npm or pnpm

Installation

bash
git clone https://github.com/backflow/backflow.git
cd backflow
npm install

Configuration

1. Create config.json

bash
cp config.example.json config.json

2. Set Environment Variables

bash
cp .env.example env/.env.development

Edit 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 dev

Open:

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 types

Next Steps

Released under the ISC License.