Skip to content

About

AI-powered workflow automation platform with n8n, Gemini AI, PostgreSQL, Google Sheets, webhooks, execution logging, and analytics.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

FlowMind AI

FlowMind AI is a production-grade AI Workflow Automation Platform. It orchestrates complex business processes by combining the visual routing of n8n, the analytical power of Google Gemini AI, robust storage in PostgreSQL, and real-time syncing to Google Sheets—all managed through a professional, high-performance Next.js dashboard.

🚀 Features

  • Visual Dashboard: Built with Next.js 14, Tailwind CSS, and shadcn/ui.
  • AI Classification Engine: Uses Google Gemini to analyze incoming text (sentiment, intent, priority, summaries, and actions).
  • Strict JSON Enforcement: Enforces structured JSON output from Gemini with automatic retry mechanisms.
  • Workflow Engine: Custom orchestration engine built in TypeScript that handles multi-step processes with detailed logging.
  • n8n Integration: Designed to be the intelligent processor within an n8n webhook automation flow.
  • Graceful Degradation (Demo Mode): Automatically falls back to high-quality static sample data if the database or AI keys are not configured, ensuring the UI always works perfectly for portfolio demonstration.

🛠 Tech Stack

  • Frontend: Next.js 14 (App Router), React, Tailwind CSS, shadcn/ui, Recharts, Lucide Icons.
  • Backend: Next.js API Routes, Node.js, TypeScript.
  • AI & Integrations: Google Gemini API, Google Sheets API.
  • Database: PostgreSQL (via pg package).
  • Automation: n8n (Node-based Workflow Automation).

📂 Project Structure

  • /app: Next.js App Router pages (Dashboard, Workflows, Records, etc.) and API routes (/api).
  • /components: Reusable UI components (shadcn/ui primitives, layout wrappers, shared blocks).
  • /lib: Core business logic.
    • /lib/ai: Gemini API integration and strict JSON prompting.
    • /lib/database: PostgreSQL client, schema definitions, queries, and fallback Demo Data.
    • /lib/google-sheets: Google Sheets API client.
    • /lib/workflow: The custom execution engine that processes tasks and logs steps.
  • /n8n: Exported n8n workflow JSON files for easy import.
  • /database: SQL schema and migration files.

⚙️ Setup Instructions

1. Environment Variables

Copy .env.example to .env.local:

cp .env.example .env.local

If you just want to run the UI in Demo Mode, you can start the app immediately without configuring keys.

To enable real processing, fill in the following variables in .env.local:

  • DATABASE_URL: Your PostgreSQL connection string.
  • GEMINI_API_KEY: Your Google Gemini API key.
  • GOOGLE_SHEET_ID: ID of the Google Sheet for sync.
  • GOOGLE_SERVICE_ACCOUNT_EMAIL & GOOGLE_PRIVATE_KEY: For Sheets auth.
  • N8N_WEBHOOK_URL: Your n8n webhook endpoint.

2. Database Initialization

Run the schema file against your PostgreSQL database to create the required tables:

psql $DATABASE_URL -f database/schema.sql

3. Start the Application

Install dependencies and run the development server:

npm install
npm run dev

Navigate to http://localhost:3000 to view the platform.

4. n8n Configuration

See the instructions in /n8n/README.md to import and configure the workflow in your n8n instance.

🧪 Architecture Notes

The application uses a robust fallback pattern. Every data-fetching function in lib/database/queries.ts first checks isDemo(). If no real database is connected, it returns comprehensive fake data from demo-data.ts. This guarantees that the portfolio project always looks complete and professional, even if backend services are offline or unconfigured.

About

AI-powered workflow automation platform with n8n, Gemini AI, PostgreSQL, Google Sheets, webhooks, execution logging, and analytics.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages