From 454f1dd29a56697d8f673ccb58b145c6e24cbb1d Mon Sep 17 00:00:00 2001 From: Robert Kinney Date: Sat, 29 Nov 2025 02:03:09 -0500 Subject: [PATCH] fix: include a `.env.example` file, add clarification around required environment variables (fixes #74) --- .env.example | 25 +++++++++++++++++++++++++ .gitignore | 2 +- CONTRIBUTING.md | 26 +++++++++++++++++--------- README.md | 10 ++++++++-- 4 files changed, 51 insertions(+), 12 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..0beb746b --- /dev/null +++ b/.env.example @@ -0,0 +1,25 @@ +## Database +DATABASE_URL=postgresql://user:password@localhost:5432/workflow_builder + +## Better Auth +BETTER_AUTH_SECRET=your-secret-key # Generate with: openssl rand -base64 32 +BETTER_AUTH_URL=http://localhost:3000 + +# GitHub +GITHUB_CLIENT_ID= +GITHUB_CLIENT_SECRET= +NEXT_PUBLIC_GITHUB_CLIENT_ID= + +# Google +GOOGLE_CLIENT_ID= +GOOGLE_CLIENT_SECRET= +NEXT_PUBLIC_GOOGLE_CLIENT_ID= + +## AI Gateway (for AI workflow generation) +AI_GATEWAY_API_KEY=your-openai-api-key + +## API URL (for application Route Handlers) +NEXT_PUBLIC_API_URL=http://localhost:3000 + +## Credentials Encryption +INTEGRATION_ENCRYPTION_KEY=your-32-byte-hexadecimal-key # Generate with: openssl rand -hex 32 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 5d0ca29e..03680e03 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ yarn-error.log* # env files (can opt-in for committing if needed) .env* +!.env.example # vercel .vercel @@ -40,6 +41,5 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts -.env*.local tmp/ \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bbb2e3f7..829c2721 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -68,16 +68,20 @@ Required variables for development: ```bash # Database -DATABASE_URL=postgres://localhost:5432/workflow +DATABASE_URL=postgresql://user:password@localhost:5432/workflow_builder -# Authentication -BETTER_AUTH_SECRET=your-auth-secret-here # Generate with: openssl rand -base64 32 +# Better Auth +BETTER_AUTH_SECRET=your-secret-key # Generate with: openssl rand -base64 32 +BETTER_AUTH_URL=http://localhost:3000 -# Credentials Encryption -INTEGRATION_ENCRYPTION_KEY=your-64-character-hex-string # Generate with: openssl rand -hex 32 +# AI Gateway (for AI workflow generation) +AI_GATEWAY_API_KEY=your-openai-api-key + +# API URL (for application Route Handlers) +NEXT_PUBLIC_API_URL=http://localhost:3000 -# App URLs -NEXT_PUBLIC_APP_URL=http://localhost:3000 +# Credentials Encryption +INTEGRATION_ENCRYPTION_KEY=your-32-byte-hexadecimal-key # Generate with: openssl rand -hex 32 ``` Optional OAuth providers (configure at least one for authentication): @@ -384,7 +388,9 @@ export type SendMessageInput = StepInput & { /** * Send message logic - separated for clarity and testability */ -async function sendMessage(input: SendMessageInput): Promise { +async function sendMessage( + input: SendMessageInput +): Promise { const credentials = input.integrationId ? await fetchCredentials(input.integrationId) : {}; @@ -788,7 +794,9 @@ import "server-only"; import { type StepInput, withStepLogging } from "@/lib/steps/step-handler"; -type MyResult = { success: true; data: string } | { success: false; error: string }; +type MyResult = + | { success: true; data: string } + | { success: false; error: string }; export type MyInput = StepInput & { field1: string; diff --git a/README.md b/README.md index 7100a399..9b448f04 100644 --- a/README.md +++ b/README.md @@ -38,18 +38,24 @@ You can deploy your own version of the workflow builder to Vercel with one click ### Environment Variables -Create a `.env.local` file with the following: +Create a `.env.local` file (or rename the existing `.env.example` file) with the following: ```env # Database DATABASE_URL=postgresql://user:password@localhost:5432/workflow_builder # Better Auth -BETTER_AUTH_SECRET=your-secret-key +BETTER_AUTH_SECRET=your-secret-key # Generate with: openssl rand -base64 32 BETTER_AUTH_URL=http://localhost:3000 # AI Gateway (for AI workflow generation) AI_GATEWAY_API_KEY=your-openai-api-key + +# API URL (for application Route Handlers) +NEXT_PUBLIC_API_URL=http://localhost:3000 + +# Credentials Encryption +INTEGRATION_ENCRYPTION_KEY=your-32-byte-hexadecimal-key # Generate with: openssl rand -hex 32 ``` ### Installation