Skip to content

Latest commit

 

History

History
272 lines (213 loc) · 8.2 KB

File metadata and controls

272 lines (213 loc) · 8.2 KB

GitHub Projects Manager - Implementation Summary

✅ Completed Implementation

All features from the plan have been successfully implemented. Here's what's been created:

1. App Identity & Configuration

Updated Files:

  • README.md - Updated with GitHub Projects Manager description and features
  • index.html - Updated SEO meta tags (title and description)
  • server/main.ts - Extended StateSchema with githubToken and defaultOrganization fields

Configuration Required from Users:

  • GitHub Personal Access Token (classic) with scopes: repo, project, read:org
  • Optional: Default organization name (e.g., 'deco-cx')

2. Database Schema

Updated Files:

  • server/schema.ts - Added two new tables:
    • tracked_repositories - Stores monitored GitHub repositories
    • tracked_projects - Stores monitored GitHub Projects V2

Next Step Required:

npm run db:generate

This will create the migration files for the new database tables.

3. GitHub API Client

Created Files:

  • server/lib/github.ts - Complete GitHub API client with:
    • GraphQL query execution
    • REST API request handling
    • Rate limiting handling
    • Helper methods for node ID resolution
    • Comprehensive error handling

4. MCP Tools

Projects V2 Tools (server/tools/projects.ts):

  1. LIST_GITHUB_PROJECTS - List all projects in an organization
  2. GET_PROJECT_DETAILS - Get detailed project information
  3. CREATE_PROJECT - Create a new Project V2
  4. UPDATE_PROJECT - Update project details
  5. DELETE_PROJECT - Delete a project
  6. LIST_PROJECT_ITEMS - List items in a project
  7. ADD_ITEM_TO_PROJECT - Add issue/PR to project

Issues Tools (server/tools/issues.ts):

  1. LIST_ISSUES - List issues with filtering
  2. GET_ISSUE - Get detailed issue information
  3. CREATE_ISSUE - Create new issue
  4. UPDATE_ISSUE - Update issue details
  5. CLOSE_ISSUE - Close issue with reason
  6. ADD_ISSUE_COMMENT - Add comment to issue
  7. LIST_ISSUE_COMMENTS - List all comments on issue
  8. ADD_LABELS_TO_ISSUE - Add labels to issue
  9. REMOVE_LABELS_FROM_ISSUE - Remove labels from issue
  10. ASSIGN_ISSUE - Assign users to issue
  11. UNASSIGN_ISSUE - Remove assignees from issue

Tracking Tools (server/tools/tracking.ts):

  1. ADD_TRACKED_REPOSITORY - Add repository to tracking
  2. LIST_TRACKED_REPOSITORIES - List tracked repositories
  3. REMOVE_TRACKED_REPOSITORY - Remove/deactivate tracked repository
  4. ADD_TRACKED_PROJECT - Add project to tracking
  5. LIST_TRACKED_PROJECTS - List tracked projects
  6. REMOVE_TRACKED_PROJECT - Remove/deactivate tracked project

Metadata Tools (server/tools/metadata.ts):

  1. GET_TOOL_METADATA - Get information about all available tools

Total: 25 MCP Tools

5. Frontend Views

Tracking Manager (view/src/routes/tracking.tsx):

  • ✅ Add/remove tracked repositories
  • ✅ Add/remove tracked projects
  • ✅ List all tracked items with status
  • ✅ Fetch GitHub projects from organization
  • ✅ Real-time updates with TanStack Query

Tools Inspector (view/src/routes/tools.tsx):

  • ✅ List all available MCP tools
  • ✅ Search and filter tools
  • ✅ Category-based filtering
  • ✅ Expandable tool details with schemas
  • ✅ Syntax-highlighted JSON schemas

Home Page (view/src/routes/home.tsx):

  • ✅ Landing page with feature overview
  • ✅ Navigation to Tracking Manager and Tools Inspector
  • ✅ Quick stats about available tools
  • ✅ Modern, responsive design

TanStack Query Hooks (view/src/hooks/useTracking.ts):

  • useTrackedRepositories - Query tracked repos
  • useAddRepository - Mutation to add repo
  • useRemoveRepository - Mutation to remove repo
  • useTrackedProjects - Query tracked projects
  • useAddProject - Mutation to add project
  • useRemoveProject - Mutation to remove project
  • useGitHubProjects - Query GitHub projects from org

6. View Configuration

Updated Files:

  • server/views.ts - Configured two views:
    • Tracking Manager (bookmark icon)
    • Tools Inspector (extension icon)
  • view/src/main.tsx - Added routes to router tree

Note: View URLs point to https://github-projects.deco.page/*. Update these after deployment if you use a different app name.

7. Cleanup

  • ✅ Deleted server/tools/todos.ts (template file)
  • ✅ Updated server/tools/index.ts to export new tool domains

🚀 Next Steps

1. Generate Database Migrations

npm run db:generate

2. Configure Your App

npm run configure

Set your app name (will determine deployment URL).

3. Test Locally

npm run dev
  • Server will start on http://localhost:8787
  • Test the UI at /tracking and /tools routes
  • Note: Authentication requires deployment first

4. Deploy

npm run deploy

This will:

  • Build the frontend
  • Deploy to Cloudflare Workers
  • Make the app available at https://<your-app-name>.deco.page

5. Update View URLs (if needed)

If your deployment URL is different from github-projects.deco.page, update the URLs in server/views.ts.

6. Install the App

  1. Go to admin.decocms.com
  2. Navigate to your workspace
  3. Install your deployed MCP app
  4. Provide your GitHub token during installation
  5. (Optional) Set default organization

📋 Tool Categories

Projects (7 tools)

  • Full CRUD operations for GitHub Projects V2
  • List and manage project items
  • GraphQL-based implementation

Issues (11 tools)

  • Complete issue lifecycle management
  • Comments, labels, and assignees
  • Advanced filtering and querying

Tracking (6 tools)

  • Database-backed monitoring
  • Soft delete support
  • Active/inactive status management

Metadata (1 tool)

  • Tool introspection and discovery
  • Schema information for UI generation

🎯 Usage Examples

AI Commands You Can Use

Managing Projects:

"List all projects in deco-cx organization"
"Create a new project called 'Sprint 24' in deco-cx"
"Add issue #42 from deco/app to project XYZ"

Managing Issues:

"Create an issue in deco/app titled 'Fix login bug'"
"Close issue #123 as completed"
"Add comment to issue #456 saying 'This is fixed'"
"Assign issue #789 to user 'johndoe'"

Tracking:

"Add deco-cx/deco to tracked repositories"
"List all tracked projects"
"Remove repository with ID 5 from tracking"

🔧 Technical Details

Architecture

  • Backend: Cloudflare Workers + Deco Runtime
  • Frontend: React + Vite + Tailwind CSS + shadcn/ui
  • Database: SQLite (Cloudflare Durable Objects) + Drizzle ORM
  • API: GitHub GraphQL API v4
  • State Management: TanStack Query
  • Routing: TanStack Router

Security

  • All tools use createPrivateTool for access control
  • GitHub token stored securely in app state
  • Database operations use prepared statements
  • Rate limiting handled automatically

Type Safety

  • Full TypeScript coverage
  • Zod schemas for input/output validation
  • Auto-generated types from Drizzle schema
  • Type-safe RPC calls between frontend and backend

🐛 Troubleshooting

GitHub API Errors

  • Verify your token has correct scopes: repo, project, read:org
  • Check token hasn't expired
  • Ensure you have access to the organization/repository

Database Errors

  • Run npm run db:generate after schema changes
  • Migrations apply automatically on first use
  • Check server/drizzle/ for migration files

View Not Showing

  • Deploy the app first (npm run deploy)
  • Update URLs in server/views.ts if needed
  • Reinstall the app in your deco workspace

📚 Resources

✨ What's Next?

Consider adding:

  • Pull request management tools
  • Milestone and release tools
  • GitHub Actions workflow triggers
  • Advanced analytics and reporting
  • Webhook handlers for real-time updates
  • Batch operations for multiple issues/PRs

Implementation Complete! 🎉

All planned features have been successfully implemented. Run npm run db:generate and npm run deploy to get started!