How kavyashah26/justrun works
Project Type and Purpose
• JustRun is a full-stack, cloud-native, serverless microservices platform for scheduling and automating HTTP-based tasks.
• It consists of multiple backend Spring-Boot services (AuthService, TaskManagementService, CronScanner, TaskExecutionService) and a Next.js frontend.
• It leverages AWS DynamoDB, SQS, and CloudWatch for persistence, queuing, and logging.
High-Level Architecture Components
a. Frontend (Next.js)
• Handles user authentication, task creation, visualization, and workflow management
• Communicates with backend services via REST API calls
b. AuthService
• Manages user sign-up, login, JWT issuance, and API key validation
• Provides an authentication gateway for all other services
c. TaskManagementService
• CRUD operations for tasks and task chains
• Validates user permissions and task data
d. CronScanner
• Periodically polls DynamoDB for due ROOT tasks based on cron expressions
• Claims tasks and enqueues them into SQS priority queues (HIGH, NORMAL, LOW)
e. TaskExecutionService
• Listens to SQS queues, dequeues tasks, executes HTTP requests
• Handles retries with exponential backoff, logs each attempt to DynamoDB
• Triggers chained tasks upon completion or failure
f. AWS Services
• DynamoDB: Stores users, tasks, task chains, execution logs
• SQS: Three priority queues for task dispatch
• CloudWatch: Centralized metrics and logs
Component Interactions and Data Flow
1. User opens frontend → sends login or API calls to AuthService (via API Gateway)
2. On success, frontend stores JWT and calls TaskManagementService to create/edit tasks
3. TaskManagementService writes task metadata into DynamoDB
4. CronScanner (cron scheduler service) periodically:
– Scans DynamoDB for due ROOT tasks
– Marks the task as claimed (concurrency control)
– Pushes a message to the appropriate SQS queue
5. TaskExecutionService workers poll SQS queues:
– Dequeue task message → execute HTTP call → on success/failure, record in DynamoDB
– If chained tasks exist, enqueue them back into SQS or DynamoDB for next run
6. Frontend or other services can fetch execution logs or task status from TaskManagementService
Architectural Patterns and Principles
• Microservices: Each backend service is independently deployable (own repo, Dockerfile, configs).
• Serverless/Cloud-native: Uses managed AWS services to avoid server management.
• Event-driven: SQS as event bus for task dispatching and decoupling scanner from execution.
• Resilience: JWT-based security, retries with backoff, concurrency control in DynamoDB.
• Scalability: Each service autoscaled; multiple TaskExecutionService workers can consume from SQS.