Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Watch the complete visual explainer video for an overview of AutoGraphQL, its ar

- [πŸ“Ί Video Overview & Architecture Walkthrough](#-video-overview--architecture-walkthrough)
- [🌟 Core Features Overview](#-core-features-overview)
- [πŸ† Why AutoGraphQL? Competitor Comparison](#-why-autographql-competitor-comparison)
- [πŸ“¦ Starter Template & Reference Schema (User & UserProfile)](#-starter-template--reference-schema-user--userprofile)
- [🎯 Real-World Use Cases](#-real-world-use-cases)
- [1. Headless CMS & Content Publishing](#1-headless-cms--content-publishing)
Expand Down Expand Up @@ -76,6 +77,26 @@ relational lookups into single database queries with in-memory tick memoization.

---

## πŸ† Why AutoGraphQL? Competitor Comparison

> πŸ“Š **Interactive Slide Deck**: Open **[`http://localhost:3000/slides`](http://localhost:3000/slides)** for the executive 16:9 presentation slide deck!
> πŸ“– **Full Analysis**: Read the detailed technical breakdown in **[`docs/competitor-analysis.md`](docs/competitor-analysis.md)**.

| Capability | ⚑ AutoGraphQL | 🐘 Hasura | πŸ’Ž Prisma | πŸ“œ PostGraphile | πŸš€ Strapi |
| :--- | :---: | :---: | :---: | :---: | :---: |
| **Architecture Core** | **AST-Driven Engine** | Haskell Proxy | ORM Layer Only | SQL-to-GQL Proxy | Headless CMS |
| **Runtime Environment** | **100% Native Node.js** | Haskell / Go | Node.js / Rust | Node.js | Node.js |
| **Multi-Database Polyglot** | βœ… **Native Mongo + Postgres** | ⚠️ SQL-first (Mongo weak) | ⚠️ ORM only, no API | ❌ Postgres only | ⚠️ SQL-first |
| **Schema-First Workflow** | βœ… **Pure GraphQL SDL** | ❌ DB-first + YAML | ❌ Proprietary DSL | ❌ DB DDL-first | ❌ Admin UI-first |
| **Resolver Generation** | βœ… **100% Zero-Code** | βœ… Auto-generated | ❌ Manual (Apollo/Pothos) | βœ… Auto-generated | ⚠️ Opinionated CMS |
| **Visual Studio Platform** | βœ… **Data + ERD + RBAC + Seeder** | ⚠️ Complex Console | ⚠️ Basic Data only | ❌ None (GraphiQL) | βœ… Heavy CMS Admin |
| **In-Process Lifecycle Hooks** | βœ… **Native JS Pre/Post** | ❌ External HTTP Webhooks | βœ… Native Middleware | ⚠️ SQL Functions | βœ… Lifecycle Hooks |
| **Row-Level Security (RLS)** | βœ… **Directives (`@tenantScoped`)** | ⚠️ Complex Permissions DSL | ❌ Manual Query Filters | ⚠️ Postgres RLS | ⚠️ Plugin-based |
| **Transactional Outbox** | βœ… **Built-in Birdwatch + HMAC** | ⚠️ SQL Triggers | ❌ Needs Kafka/Debezium | ❌ External triggers | ⚠️ Basic Webhooks |
| **Total Cost of Ownership (TCO)** | 🟒 **100% Free & Open Source** | πŸ”΄ Expensive Enterprise Tier | 🟒 Open-source (High Dev Cost) | 🟒 Free & Open Source | 🟑 Paid Enterprise Tiers |

---

## πŸ“¦ Starter Template & Reference Schema (User & UserProfile)

> πŸ’‘ **Educational Starter Reference**: The `User` and `UserProfile` types included in [`graphqlSchema/core/types/`](graphqlSchema/core/types/) are provided purely as a **starter template and reference schema**. They demonstrate 1-to-1 bidirectional relationships, declarative directives, and authentication handling.
Expand Down
84 changes: 84 additions & 0 deletions docs/competitor-analysis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# πŸ† AutoGraphQL vs. Competitors: Comprehensive Comparative Analysis

> **Why Engineering Teams Choose AutoGraphQL over Hasura, Prisma, PostGraphile, Strapi, and AWS AppSync**

Modern development teams building data-driven applications face a difficult choice: spend weeks writing repetitive GraphQL CRUD resolvers and database models, or adopt complex proprietary platforms that lock them into specific databases or cloud vendors.

**AutoGraphQL** solves this by delivering an **AST-driven, schema-first auto-generated GraphQL engine** natively for Node.js. Define standard `.graphql` types once with declarative directives, and AutoGraphQL automatically compiles dynamic MongoDB and PostgreSQL models, wires DataLoader batching, generates CRUD APIs with nested filtering, handles relational connectors, and provides an enterprise visual Studio platform.

---

## πŸ“Š Executive Feature Matrix

| Capability | ⚑ AutoGraphQL | 🐘 Hasura | πŸ’Ž Prisma | πŸ“œ PostGraphile | πŸš€ Strapi | ☁️ AWS AppSync |
| :--- | :---: | :---: | :---: | :---: | :---: | :---: |
| **Core Architecture** | **AST-Driven Engine** | Haskell Proxy Engine | ORM Layer Only | Pg-to-GraphQL Proxy | Headless CMS Monolith | Managed Cloud Proxy |
| **Runtime Environment** | **100% Native Node.js** | Haskell / Go Container | Node.js / Rust binary | Node.js | Node.js | AWS Cloud Only |
| **Multi-Database Polyglot** | βœ… **Native Mongo + Postgres Unified** | ⚠️ SQL-first (Mongo weak) | ⚠️ Supports both, but no API | ❌ PostgreSQL only | ⚠️ SQL-first | ⚠️ DynamoDB + Aurora |
| **Resolver Generation** | βœ… **100% Auto-Generated** | βœ… Auto-Generated | ❌ Manual (Requires Apollo/Pothos) | βœ… Auto-Generated | ⚠️ Opinionated CMS REST/GQL | ❌ Manual VTL / JS |
| **Schema-First Workflow** | βœ… **Pure GraphQL SDL** | ❌ Database-first + YAML | ❌ Prisma Schema DSL | ❌ Database DDL-first | ❌ Admin UI-first | ⚠️ AWS Console / SDL |
| **Zero-Code Studio Platform** | βœ… **Universal Data, ERD, RBAC, Seeder** | ⚠️ Complex Console | ⚠️ Prisma Studio (Basic Data only) | ❌ None (GraphiQL only) | βœ… Heavy CMS Admin | ⚠️ AWS Console |
| **In-Process Business Logic** | βœ… **Native JS Pre/Post Hooks** | ❌ External Webhooks (Action microservices) | βœ… Native JS (Middleware) | ⚠️ SQL Functions / Plugins | βœ… Lifecycle Hooks | ❌ VTL / Lambda calls |
| **Declarative Multi-Tenancy (RLS)** | βœ… **Directives (`@tenantScoped`)** | ⚠️ Complex Permissions DSL | ❌ Manual query filtering | ⚠️ Postgres RLS policies | ⚠️ Plugin-based | ⚠️ IAM / Cognito |
| **N+1 Batching & Prevention** | βœ… **Request-Scoped DataLoader** | βœ… Internal SQL Compiler | ⚠️ Manual / Fluent API | βœ… Lookahead SQL Compiler | ❌ High N+1 risk on relations | ⚠️ Batch Lambda |
| **Transactional Outbox & Webhooks** | βœ… **Built-in Birdwatch + HMAC** | ⚠️ Event Triggers (SQL only) | ❌ Needs Kafka / Debezium | ❌ External triggers | ⚠️ Basic Webhooks | ⚠️ EventBridge integration |
| **Synthetic Mock Seeder** | βœ… **Built-in Contextual Seeder** | ❌ None | ❌ Manual seed scripts | ❌ None | ❌ None | ❌ None |
| **Total Cost of Ownership (TCO)** | 🟒 **100% Free & Open-Source** | πŸ”΄ Expensive Enterprise License | 🟑 Open-source ORM (Self-built API) | 🟒 Open-source | 🟑 Paid Enterprise Tiers | πŸ”΄ Pay-per-query AWS bill |
| **Cloud & Vendor Lock-in** | 🟒 **Zero (Deploy anywhere)** | 🟑 Proprietary metadata | 🟒 None | 🟒 None | 🟒 None | πŸ”΄ Hard AWS lock-in |

---

## πŸš€ The 6 Unfair Advantages of AutoGraphQL

### 1. 🎯 Pure Schema-First GraphQL SDL (No Proprietary DSLs)
* **The Competition**: Hasura forces you into database-first tables and complex YAML/JSON metadata configurations. Prisma introduces a proprietary schema language (`schema.prisma`) that cannot be used directly by frontend GraphQL clients.
* **AutoGraphQL**: Write pure, standard GraphQL SDL. Directives like `@model`, `@relation`, `@unique`, and `@trim` configure storage and behavior directly in the language your API already speaks.

### 2. πŸ—„οΈ True Multi-Database Polyglot in a Single Schema
* **The Competition**: PostGraphile only works on PostgreSQL. Hasura is deeply coupled to relational SQL engines and treats document stores as an afterthought.
* **AutoGraphQL**: Natively compiles both **MongoDB (Mongoose)** and **PostgreSQL (Sequelize)** models in the exact same application. You can have a high-volume `EventLog` in MongoDB and an ACID-compliant `Payment` entity in PostgreSQL, queried together through a unified GraphQL schema!

### 3. πŸ–₯️ Enterprise Visual Studio Cockpit Included
* **The Competition**: Prisma Studio only offers basic row editing. Hasura's console is notoriously dense with hundreds of metadata options. PostGraphile provides no admin UI beyond GraphiQL.
* **AutoGraphQL Studio** is a complete, out-of-the-box visual developer cockpit:
* **Universal CRUD Data Grid**: Sortable, deep-filtered, inline cell editing with keyboard shortcuts.
* **Interactive Visual ERD Canvas**: Real-time graph with curved Bezier relation connectors and dialect tags.
* **Synthetic Mock Data Seeder**: 1-click generation of realistic test datasets with valid relational keys.
* **Visual RBAC Matrix & RLS Inspector**: Visual permission auditing across roles and tenant boundaries.
* **Live Telemetry & Winston Log Console**: Real-time metrics and streaming logs.
* **Spotlight Command Palette (`⌘K`)**: Instant search across models, tabs, and actions.

### 4. ⚑ In-Process Lifecycle Hooks (Zero Latency Overhead)
* **The Competition**: Hasura does not allow running custom Node.js code in-process; every custom business rule requires setting up an external HTTP Action microservice with network overhead and serialization latency.
* **AutoGraphQL**: Place JavaScript files in `hooks/` to intercept mutations with zero-latency Pre-Hooks and Post-Hooks. Validate, transform, encrypt, or trigger third-party APIs directly inside the Node.js event loop.

### 5. πŸ“‘ Built-In Transactional Outbox & Reliable Webhooks
* **The Competition**: Most frameworks require setting up separate Kafka, RabbitMQ, or Debezium pipelines to guarantee that database changes trigger downstream webhooks reliably.
* **AutoGraphQL**: The built-in **Birdwatch Transactional Outbox** guarantees that database events are reliably persisted and dispatched to webhooks with HMAC-SHA256 signatures, exponential backoff, and deduplication.

### 6. πŸ’° Zero Vendor Lock-in & Predictable Economics
* **The Competition**: Hasura Enterprise charges steep per-core licensing fees, and AWS AppSync incurs compounding costs per million queries and websocket connections.
* **AutoGraphQL**: 100% open-source, standard Node.js microservice. Run it in Docker, Kubernetes, AWS ECS, GCP Cloud Run, or on a $5/month VPS. No license keys, no per-query meter, no surprise bills.

---

## ⏱️ Developer Velocity: Time to Production

| Task | Traditional Setup (Prisma + Apollo) | Hasura | ⚑ AutoGraphQL |
| :--- | :--- | :--- | :--- |
| **Define 10 Data Models** | Write `schema.prisma`, run migrations (30 mins) | Create 10 SQL tables, track in console (45 mins) | **Create `.graphql` files in `schemas/` (5 mins)** |
| **Write CRUD Resolvers** | Write 50+ queries, mutations & inputs (4–8 hours) | Auto-generated (0 mins) | **Auto-generated immediately (0 mins)** |
| **Relational Connectors** | Write nested resolvers with DataLoader (3–5 hours) | Manual relationship tracking in YAML (30 mins) | **Instant `@relation` queries & mutations (0 mins)** |
| **Filtering & Pagination** | Implement boolean logic, regex, sorting (4 hours) | Built-in | **Built-in nested filter & sort engine (0 mins)** |
| **Seed 50 Mock Records** | Write custom faker.js script (45 mins) | Write SQL inserts or CSV import (30 mins) | **1-click `🎲 Seed Mock Records` in Studio (10 secs)** |
| **Visual Admin Dashboard** | Build custom Retool or React admin app (2–4 days) | Console (No public end-user CRUD grid) | **Built-in AutoGraphQL Studio (0 mins)** |
| **Total Setup Time** | **2–3 Days** | **2–4 Hours** | **⚑ Under 10 Minutes** |

---

## 🎯 When to Use AutoGraphQL

* βœ… **Rapid MVP to Scale**: When you need production-ready GraphQL APIs immediately without sacrificing architectural control or performance.
* βœ… **Polyglot Microservices**: When your application demands both MongoDB for high-write/flexible documents and PostgreSQL for relational integrity.
* βœ… **Multi-Tenant SaaS**: When you need strict Row-Level Security (`@tenantScoped`) without writing boilerplate query filters everywhere.
* βœ… **Enterprise Internal Tools**: When your operations team needs an instant visual CRUD and ERD console without building a custom admin panel.
6 changes: 5 additions & 1 deletion src/studio/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,9 @@
<button class="btn btn-secondary" onclick="exportSchemaSDL()">
πŸ“„ Dump SDL
</button>
<a href="/slides" target="_blank" class="btn btn-secondary" title="View Competitor Analysis Slide Deck" style="border-color: rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.08); color: #34d399;">
πŸ† Why AutoGraphQL?
</a>
<a href="/graphql/core" target="_blank" class="btn btn-secondary">
Playground β†—
</a>
Expand Down Expand Up @@ -3247,7 +3250,8 @@
{ title: 'Export TypeScript SDK', icon: 'πŸ“¦', action: () => exportTypeScriptSDK() },
{ title: 'Dump GraphQL SDL', icon: 'πŸ“„', action: () => exportSchemaSDL() },
{ title: 'Auto-Layout ERD Canvas', icon: '✨', action: () => { switchTab('tab-erd'); loadERDDiagram(); } },
{ title: 'Clear Server Logs', icon: '🧹', action: () => { switchTab('tab-telemetry'); clearLogConsole(); } }
{ title: 'Clear Server Logs', icon: '🧹', action: () => { switchTab('tab-telemetry'); clearLogConsole(); } },
{ title: 'πŸ† View Competitor Analysis Slide (Hasura, Prisma, Strapi)', icon: 'πŸ†', action: () => window.open('/slides', '_blank') }
].filter(a => !q || a.title.toLowerCase().includes(q));

let html = '';
Expand Down
Loading
Loading