How devitaliya22/autominds works
Project Type and Purpose
• AutoMinds is a full-stack automation platform.
• It lets users connect multiple external apps and configure workflows. Triggers from one app (such as a new Google Doc or CSV file in GitHub) automatically trigger actions in another.
• The README emphasizes automated triggers, state management (using Zustand), real-time updates (using WebSockets on the workflow page), and integrations with external services.
Analyzing the File Structure
• The top-level structure includes configuration files (like .eslintrc.json, tsconfig.json, etc.), the Next.js configuration (next.config.mjs), and a public folder for static assets.
• The core code lives in the "src" folder, which is further divided into "app", "components", "api" (in src/app/api), "lib", "hooks", "store", and "types". This separation suggests a clear division between UI, business logic, and data access.
• Database interactions and schema management are handled using Prisma (prisma folder), where multiple migrations, a seed file, and the schema are located.
• There are dedicated API routes for external integrations (e.g., /api/auth, /api/github, /api/google, and /api/webhook) indicating that the backend is segmented into modules corresponding to each integration.
Key Components
a. Frontend:
• Next.js-based client UI hosted under src/app and src/components.
• Pages for connections, dashboards, and workflow editors.
• Global layout and state management (using Zustand as mentioned in the README and implemented in src/store).
• Real-time updates on the workflows page (likely using WebSocket connections).
b. API/Backend Services:
• Next.js API routes (in src/app/api) for handling all integrations:
• Authentication endpoints in /api/auth for NextAuth.
• Integration endpoints for GitHub (/api/github) and Google (/api/google) including specialized routes for Drive and Gmail, handling creation, updates, and webhooks.
• Webhook endpoints (/api/webhook) to process incoming trigger events from external services.
• Auth & user management using NextAuth (under src/app/api/auth/[...nextauth]).
c. Database:
• Managed via Prisma with its own schema (prisma/schema.prisma) and migrations.
• This serves as the source of truth storing user details, workflows, integrations, and other metadata.
d. External Services:
• Third-party APIs for Google (Drive, Gmail, etc.), GitHub, and potentially Discord.
• These interact with the API endpoints and trigger actions on the platform.
Architectural Patterns & Design Principles
• The project follows a clear separation of concerns:
• Frontend (UI/UX, client state with Zustand) is distinct from backend logic.
• API endpoints are modularly separated based on functionality/integration.
• Database operations abstracted through Prisma.
• The RESTful API endpoints and webhooks pattern allow for clean bidirectional communication between AutoMinds and external services.
• Emphasis on modularity: Breaking the workflows into triggers, actions, and reactions, each manageable through clearly defined API routes and components.