How shreyashxp095/automateit works
1. This repository is a Next.js App Router application centered on a workflow automation product: users authenticate, design workflows in an editor, manage credentials, and inspect executions. The architecture is split by route groups rather than by page-only files.
2. The top-level UI shell is organized into three main areas: an auth area under src/app/(auth), a dashboard area under src/app/(dashboard), and API endpoints under src/app/api. The dashboard itself is further divided into an editor sub-area for workflow design and a rest sub-area for list/detail views.
3. The workflow editor is the core interactive subsystem. It uses React Flow-style node rendering, with custom node components in src/components/react-flow, src/components/workflow-node.tsx, and feature-specific nodes in src/features/triggers, src/features/executions, and src/features/editor. The route workflows/[workflowId] is the main entry point for editing a single workflow graph.
4. Workflow data appears to be modeled as graph entities in the database, not just as simple forms. The Prisma migrations include “react_flow_tables” and “new_nodes”, which indicates persisted nodes/edges, plus workflow improvements over time. The editor likely reads that graph, renders it in React Flow, and writes updates back through server mutations.
5. Execution is a separate subsystem from workflow authoring. The executions screens and src/features/executions/... components suggest read-only or inspection-oriented views of runs, with node-specific visualization such as http-request execution nodes. This is an important boundary: design-time workflow nodes vs. run-time execution nodes.
6. Credentials are managed as a first-class dashboard domain in src/app/(dashboard)/(rest)/credentials. That implies workflows depend on stored secrets or integrations, but the credential UI is separated from the editor to keep secret management outside the graph-editing flow.
7. Data access is Prisma-based. The schema and migrations live under prisma/, and generated client code is checked into src/generated/prisma. src/lib/db.ts is the DB entry point, so the server side talks to a relational database through Prisma rather than directly through raw SQL.
8. Typed server/client communication is handled with tRPC. The app exposes a tRPC endpoint at src/app/api/trpc/[trpc]/route.ts, with shared router setup under src/trpc/routers and client helpers in src/trpc/client.tsx and src/trpc/server.tsx. This is the main application RPC boundary for dashboard data mutations and queries.
9. Background or asynchronous processing is wired through Inngest. The project has an Inngest client and function definitions in src/inngest/, plus a dedicated API route at src/app/api/inngest/route.ts. That suggests workflow/execution events can be processed out of band from the request/response path.
10. Authentication is a dedicated subsystem. It has its own app routes, shared auth utilities in src/lib/auth.ts, src/lib/auth-client.tsx, and src/lib/auth-utils.tsx, and an auth API catch-all at /api/auth/[...all]. The presence of better_auth_fields in migrations suggests auth state is persisted in the same Prisma-backed database.
11. Subscription or billing concerns are present as cross-cutting product logic. src/lib/polar.ts, use-subscription, and upgrade-modal indicate a monetization boundary that can gate features inside the dashboard/editor, even though the billing provider is abstracted away from the page structure.
12. Observability and operational concerns are built in. There are separate Sentry configs for edge and server runtimes, plus instrumentation entry points. That means the app is deployed as a mixed server/client Next.js system with explicit monitoring across both runtime environments.
13. Shared UI and feature composition are centralized. src/components/ui contains a large design-system layer, while src/features/* keeps domain-specific UI, hooks, and server loaders close to each feature. This separation is useful for a diagram because it distinguishes reusable primitives from workflow/auth/domain code.
Main entry points: app/layout.tsx App Shell · (dashboard)/layout.tsx Dashboard Shell · workflow-node.tsx Workflow Nodes · editor.tsx Editor Core
Components 26
Next.js App
Route groups and API surface
- App Shell · Global layout and routing shell
src/app/layout.tsx - Auth Area · Sign-in and sign-up flows
src/app/(auth)/layout.tsx - Dashboard Shell · Main authenticated application shell
src/app/(dashboard)/layout.tsx - Auth API · Authentication endpoint catch-all
src/app/api/auth/[...all]/route.ts - tRPC API · Typed app RPC boundary
src/app/api/trpc/[trpc]/route.ts - Inngest API · Background event ingress
src/app/api/inngest/route.ts - Workflow Editor · Single-workflow graph editor entry point
src/app/(dashboard)/(editor)/workflows/[workflowId]/page.tsx - Workflows List · Workflow overview and navigation
src/app/(dashboard)/(rest)/workflows/page.tsx - Executions · Run history and execution inspection
src/app/(dashboard)/(rest)/executions/page.tsx - Credentials · Stored secrets and integrations
src/app/(dashboard)/(rest)/credentials/page.tsx
Feature Code
Domain-specific UI and loaders
- Editor Core · Workflow graph editing experience
src/features/editor/components/editor.tsx - Workflow Nodes · Shared workflow node rendering and selection
src/components/workflow-node.tsx - Trigger Nodes · Start nodes for manual or event-triggered workflows
src/features/triggers/manual-trigger/node.tsx - Execution Nodes · Runtime visualization for workflow executions
src/features/executions/componenets/http-request/node.tsx - Workflows Domain · Workflow params, loaders, and prefetching
src/features/workflows/server/routers.ts - Auth Feature · Auth forms and subscription-aware auth shell
src/features/auth/components/auth-layout.tsx - Subscription Gate · Plan state and upgrade prompts
src/features/auth/components/hooks/use-subscription.ts
Infrastructure
Database, RPC, jobs, and observability
- Prisma DB · Database entry point through Prisma
src/lib/db.ts - Schema · Data model and migrations source
prisma/schema.prisma - tRPC Core · Shared client, server, and router setup
src/trpc/routers/_app.ts - Inngest Core · Background client and function definitions
src/inngest/functions.ts - Auth Core · Shared auth helpers and client utilities
src/lib/auth.ts - Billing Core · Monetization integration abstraction
src/lib/polar.ts - Observability · Sentry and instrumentation hooks
sentry.server.config.ts
Shared UI
Reusable components and primitives
- React Flow UI · Base node and handle primitives
src/components/react-flow/base-node.tsx - UI Kit · Reusable interface primitives
src/components/ui/button.tsx
Connections 30
- App Shell → Auth Area: routes · Public auth flows are mounted from the root shell
- App Shell → Dashboard Shell: routes · Authenticated app shell is mounted from the root shell
- App Shell → Auth API: api · Auth requests terminate in the auth API route
- App Shell → tRPC API: api · Dashboard data flows through the tRPC route
- App Shell → Inngest API: jobs · Background events enter through the Inngest route
- Dashboard Shell → Workflow Editor: editor · Single-workflow editing lives in the dashboard editor area
- Dashboard Shell → Workflows List: workflows · Workflow list and detail navigation live in the rest area
- Dashboard Shell → Executions: executions · Execution inspection lives in the dashboard rest area
- Dashboard Shell → Credentials: credentials · Credential management is a separate dashboard domain
- Workflow Editor → Editor Core: uses · The route renders the editor feature composition
- Editor Core → Workflow Nodes: renders · Editor composes reusable workflow node UI
- Workflow Nodes → React Flow UI: builds on · Workflow nodes are implemented with graph primitives
- Workflow Nodes → Trigger Nodes: includes · Trigger nodes define workflow starts
- Workflow Nodes → Execution Nodes: mirrors · Execution visualization mirrors workflow nodes at runtime
- Editor Core → Workflows Domain: loads · Editor consumes workflow loaders and params
- Workflows Domain → tRPC Core: queries · Workflow data is fetched and mutated via RPC
- Workflows Domain → Prisma DB: persists · Workflow graph state is stored through Prisma
- tRPC Core → Prisma DB: data · RPC handlers read and write via the database layer
- Prisma DB → Schema: modeled by · Prisma schema and migrations define persistence
- Auth Area → Auth Feature: uses · Auth pages are built from shared auth feature components
- Auth Feature → Auth Core: auth · Auth UI depends on shared auth helpers
- Auth Feature → Subscription Gate: gates · Subscription state can gate dashboard access and upgrades
- Subscription Gate → Billing Core: provider · Billing logic is mediated by the Polar integration
- Auth Core → Prisma DB: users · Auth state is persisted in the shared database
- Auth API → Auth Core: implements · Auth API is backed by shared auth utilities
- tRPC API → tRPC Core: serves · The API route exposes the shared RPC router
- Inngest API → Inngest Core: dispatches · The API route hands off to Inngest functions
- Observability → App Shell: instruments · Monitoring and instrumentation wrap the application runtime
- UI Kit → Editor Core: ui · Editor and dashboard screens are composed from shared primitives
- UI Kit → Auth Feature: ui · Auth screens use the same design system