Architecture Overview
Relevant source files
The following files were used as context for generating this wiki page:
GeNCorE (Claude Remote Control) is a command center designed to manage AI agents such as GitHub Copilot, Claude, and Codex. It provides a centralized web interface to delegate tasks, review pull requests, and monitor agent status by interacting directly with the GitHub REST API.
Sources: README.md:1-5, package.json:2-4
System Components
The project is built using Next.js 15 with the App Router architecture. It is divided into a client-side frontend for user interaction and a server-side API layer that handles secure communication with external services.
Frontend Layers
The frontend is built with React and Tailwind CSS, utilizing a mobile-first design optimized for devices like the iPhone. Key views include:
- Dashboard (
/): Displays agent status and a list of active Pull Requests. - Task Panel (
/task): A form to assign new tasks to specific AI agents by creating GitHub Issues. - PR Review (
/review): An interface for approving, merging, or requesting changes on Pull Requests.
Sources: README.md:7-14, app/page.tsx:75-156, app/task/page.tsx:64-135
Backend API Routes
The backend consists of Next.js Route Handlers that proxy requests to the GitHub API using a server-side GITHUB_TOKEN. This ensures sensitive credentials never reach the client.
| Endpoint | Method | Description |
|---|---|---|
/api/prs | GET | Fetches open PRs from the configured GitHub repository. |
/api/task | POST | Creates a new GitHub Issue assigned to an agent. |
/api/merge | POST | Merges a specific PR using squash, merge, or rebase methods. |
/api/review | POST | Submits a review (APPROVE/REQUEST_CHANGES) to a PR. |
/api/chat | POST | Direct interface for interacting with the Anthropic Claude API. |
Sources: README.md:18-24, app/api/prs/route.ts:9-47, app/api/task/route.ts:10-77
Data Flow & Integration
The system acts as an intermediary between the user and GitHub. Below is a visual representation of how a task is delegated through the system.
The flow of creating a task: Validating the agent, communicating with GitHub, and returning the result.
Sources: app/api/task/route.ts:31-77, components/TaskForm.tsx:32-68
Pull Request Management
The application identifies which agent is responsible for a PR by detecting patterns in the branch name (head.ref) or the user login.
Sequence of fetching and identifying agent-specific pull requests.
Sources: app/api/prs/route.ts:18-40, app/page.tsx:49-72, components/PRCard.tsx:33-35
Security Architecture
Security is implemented through a combination of middleware, environment variables, and cryptographic hashing.
Authentication Flow
The application is protected by an ADMIN_TOKEN. Access is managed via a session cookie containing an HMAC-SHA256 hash of the token, preventing the raw password from being stored in the browser.
- Hasing: The
hashAdminTokenfunction uses the Web Crypto API to sign a static payload with theADMIN_TOKEN. - Middleware: Every request (except
/loginand/api/auth) is intercepted bymiddleware.ts. - Timing Protection: Verification uses
timingSafeEqualto prevent timing attacks during hash comparison.
Sources: lib/auth.ts:13-41, middleware.ts:25-63
Validation and Protection
- Input Validation: PR numbers are validated as safe integers (1 to 2,147,483,647) to prevent SSRF (Server-Side Request Forgery) when constructing GitHub API URLs.
- Credential Isolation:
GITHUB_TOKENis strictly server-side. - Production Safety: If
ADMIN_TOKENis missing in a production environment, the middleware forces a 500 error to prevent public access.
Sources: README.md:92-100, app/api/review/route.ts:31-35, middleware.ts:38-51
Technical Stack Summary
| Component | Technology |
|---|---|
| Framework | Next.js 15 (App Router) |
| Language | TypeScript |
| Styling | Tailwind CSS |
| AI SDK | @anthropic-ai/sdk |
| Deployment | Vercel |
| External API | GitHub REST API v3 |
Sources: package.json:15-30, README.md:77-83
Conclusion
The GeNCorE Architecture leverages a stateless API proxy model to provide a secure, mobile-optimized command center for AI agents. By integrating tightly with GitHub's Issue and Pull Request systems and securing the boundary with HMAC-based session management, it allows for safe remote control of automated development workflows.