Skip to content

Repository files navigation

WebFlows

A workflow automation platform built with Turborepo that allows you to create automated workflows with triggers and actions (similar to Zapier).

Architecture

This is a monorepo containing multiple applications and packages:

Apps

  • web: Next.js frontend application (runs on port 3000)
  • primary-backend: Express.js REST API backend (runs on port 3001)
  • hooks: Express.js webhook service (runs on port 3002)
  • processor: Kafka processor service for handling flow runs
  • worker: Kafka worker service for executing actions (email, Solana transactions, etc.)

Packages

  • @repo/database: Prisma-based database package with PostgreSQL schemas
  • @repo/types: Shared TypeScript type definitions
  • @repo/eslint-config: ESLint configurations
  • @repo/typescript-config: Shared TypeScript configurations

Prerequisites

Before running this application locally, ensure you have the following installed:

  • Node.js >= 18
  • npm 10.6.0 or higher
  • PostgreSQL database
  • Apache Kafka (for processor and worker services)

Getting Started

1. Clone the repository

git clone <repository-url>
cd WebFlows

2. Install dependencies

npm install

3. Set up environment variables

Create a .env file in the root directory and configure the following:

# Database
DATABASE_URL="postgresql://username:password@localhost:5432/webflows?schema=public"

# Backend URLs (for web app)
BACKEND_URL="http://localhost:3001"
HOOKS_URL="http://localhost:3002"

# JWT Secret (optional, for backend)
# JWT_PASSWORD="your-secret-key"

Additional environment variables may be required for:

  • Worker service: Email configuration (SMTP settings) and Solana wallet credentials
  • Processor/Worker: Kafka broker configuration

4. Set up the database

Run Prisma migrations to set up your PostgreSQL database:

cd packages/database
npx prisma migrate dev
npx prisma generate
cd ../..

5. Start Kafka (if running worker/processor)

Make sure Apache Kafka is running on your system. If using Docker:

docker run -d --name kafka -p 9092:9092 apache/kafka:latest

6. Run the application

Development Mode (all services)

Run all applications in development mode:

npm run dev

This will start:

  • Web app at http://localhost:3000
  • Primary backend at http://localhost:3001
  • Hooks service at http://localhost:3002
  • Processor service
  • Worker service

Run specific apps

To run individual applications:

# Web app only
npm run dev --filter=web

# Backend only
npm run dev --filter=primary-backend

# Hooks service only
npm run dev --filter=hooks

# Worker service only
npm run dev --filter=worker

# Processor service only
npm run dev --filter=processor

7. Access the application

Open your browser and navigate to:

  • Frontend: http://localhost:3000
  • Backend API: http://localhost:3001/api/v1
  • Hooks endpoint: http://localhost:3002/hooks

Building for Production

Build all apps and packages:

npm run build

Start production servers:

npm run start

Available Scripts

  • npm run dev - Start all apps in development mode
  • npm run build - Build all apps and packages
  • npm run start - Start all apps in production mode
  • npm run lint - Lint all apps and packages
  • npm run format - Format code with Prettier

Tech Stack

  • Frontend: Next.js 14, React, TailwindCSS, TypeScript
  • Backend: Express.js, TypeScript
  • Database: PostgreSQL with Prisma ORM
  • Message Queue: Apache Kafka (KafkaJS)
  • Integrations: Solana Web3.js, Nodemailer
  • Monorepo: Turborepo

Project Structure

WebFlows/
├── apps/
│   ├── web/                 # Next.js frontend
│   ├── primary-backend/     # Express.js API
│   ├── hooks/               # Webhook service
│   ├── processor/           # Kafka processor
│   └── worker/              # Action worker
├── packages/
│   ├── database/            # Prisma schemas
│   ├── types/               # Shared types
│   ├── eslint-config/       # ESLint configs
│   └── typescript-config/   # TypeScript configs
└── turbo.json              # Turborepo configuration

API Documentation

Comprehensive API documentation is available in API_DOCS.md.

The documentation includes:

  • All REST API endpoints
  • Request/response schemas
  • Authentication details
  • Example usage with curl commands
  • Error handling
  • Webhook integration guide

Learn More

Learn more about the technologies used:

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages