Commit Graph

29 Commits

Author SHA1 Message Date
daniel f5f7146888 feat: Add collections API endpoints and improve dashboard proxy
- Add Vercel serverless functions for user collections CRUD (collections.js, [id].js, items.js)
- Add shared auth (Clerk JWT verification) and Neon DB client helpers
- Add @clerk/backend dependency for token verification
- Improve dashboard API proxy: handle double-compression, error handling, filter accept-encoding
- Add retry logic to collections-api.ts for GET requests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 16:32:23 -05:00
daniel cf7e008c59 feat: Add monitoring points P1-P5 (installation outcomes, website events, API health)
- Create 3 Neon tables: installation_outcomes, website_events, api_health_logs
- Add API endpoints: track-installation-outcome, track-website-events, health-check
- Track CLI installation success/failure with timing and error classification
- Add website event tracker (search, cart, component views) with batched sendBeacon
- Add health-check cron every 15min with Discord alerts on failure
- Integrate tracking in all 6 installIndividual* functions with batchId support

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 22:08:34 -05:00
Dani b5c377ae6c feat: expand secret scanner patterns and add skills support
- Add 25+ new secret detection patterns to secret-scanner.py (Anthropic,
  Google OAuth, GitLab, Vercel, Supabase, Hugging Face, Replicate, Groq,
  Databricks, Azure, Cloudflare, DigitalOcean, Linear, Notion, Figma,
  npm, PyPI tokens)
- Fix regex escaping in security-scanner.json (single quote matching)
- Add skills component type to Discord bot interactions
- Add Linear MCP server to .mcp.json
- Update .gitignore for opsx commands, skills, and openspec dirs
- Regenerate components.json catalog

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 19:13:48 -05:00
Dani 01f1ce959f fix(api): Add missing commands to Neon tracking validation
Add 'skills-manager' and '2025-year-in-review' to valid commands list
so their usage is properly tracked in Neon database.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 20:18:48 -05:00
Dani 7cb214e083 feat: Add command usage tracking system to Neon Database
This update adds comprehensive tracking of CLI command executions
to understand community usage patterns of the npm package.

**What's New:**
- Command usage logging in Neon Database with PostgreSQL
- Tracks: --chats, --analytics, --health-check, --plugins, --sandbox, and more
- API endpoint: /api/track-command-usage with validation
- Comprehensive test suite (18/18 tests passing)
- Fire-and-forget tracking (non-blocking, respects privacy)
- Auto-aggregated statistics with PostgreSQL triggers
- Useful views: daily usage, platform distribution, popular commands

**Technical Details:**
- Database: Neon PostgreSQL (separate from Supabase component downloads)
- Endpoint: https://www.aitmpl.com/api/track-command-usage
- Privacy: Respects CCT_NO_TRACKING environment variable
- Metadata: Includes tunnel usage, platform, Node version, etc.

**Files Changed:**
- api/track-command-usage.js - New endpoint for command tracking
- database/migrations/002_create_command_usage_logs.sql - Database schema
- cli-tool/src/tracking-service.js - Added trackCommandExecution()
- cli-tool/src/index.js - Integrated tracking for 10+ commands
- api/__tests__/endpoints.test.js - Added comprehensive tests

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 15:21:28 -04:00
Dani 598aac0e6b test: Add comprehensive API testing and deployment documentation
Critical Infrastructure Protection:
- Comprehensive test suite for all API endpoints
- Pre-deployment validation script
- Detailed API architecture documentation in CLAUDE.md

Test Suite (__tests__/endpoints.test.js):
- Critical endpoint availability checks
- Component download tracking validation
- Discord bot integration tests
- Claude Code changelog monitor tests
- Security & CORS validation
- Response time validation

Pre-Deployment Script (scripts/predeploy-check.sh):
- Git status validation
- Node.js & npm version checks
- Automatic dependency installation
- API test execution
- File structure validation
- Environment variable checklist
- Vercel configuration validation

Documentation Updates:
- API Architecture & Deployment section in CLAUDE.md
- Endpoint specifications and usage
- Testing procedures
- Deployment workflow
- Troubleshooting guides
- Emergency rollback procedures
- api/README.md with quick reference

This ensures the critical /api/track-download-supabase endpoint
(used by ALL component installations) never breaks during deployments.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 14:22:13 -04:00
Dani 4cc03122b9 feat: Add Claude Code changelog monitor with Discord notifications
- Database schema for tracking Claude Code versions in Neon
- Automated parser for CHANGELOG.md with change classification
- Discord webhook integration with formatted embeds
- Vercel Cron job running every 4 hours
- Supports detection of features, fixes, improvements, and breaking changes

Endpoints:
- /api/claude-code-check - Main endpoint for version checking and notification

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 14:11:23 -04:00
Dani 8b25e94998 fix: include category in component URLs 2025-10-28 12:22:34 -04:00
Dani 69079cb037 fix: improve code block formatting and add URLs to all commands 2025-10-28 12:20:08 -04:00
Dani 69d26b9cc7 fix: improve link format in search results 2025-10-28 12:05:59 -04:00
Dani 60dfab2260 feat: add clickable links to all Discord bot responses 2025-10-28 11:50:26 -04:00
Dani 8234194ce3 fix: use pure ES modules for Discord bot 2025-10-28 08:01:47 -04:00
Dani f8812b6331 fix: add Discord bot dependencies to api/package.json 2025-10-28 07:57:05 -04:00
Dani 65fa873c2e fix: consolidate Discord bot into single ES module file 2025-10-28 07:54:12 -04:00
Dani db095849e9 fix: add ES module wrapper for interactions endpoint 2025-10-28 07:50:08 -04:00
Dani c95a9e214a fix: convert Discord bot files to CommonJS (.cjs) 2025-10-28 07:48:07 -04:00
Dani b572cb14db feat: add Discord bot with Vercel Functions
- Add 5 slash commands: /search, /info, /install, /popular, /random
- Serverless implementation using Vercel Functions
- Component search and discovery functionality
- Smart caching for components.json
- Setup documentation
2025-10-28 07:39:10 -04:00
Dani 404bbfe538 feat: Add 'skill' as valid component type in tracking API
- Add 'skill' to validTypes array in track-download-supabase.js
- Allows tracking of skill component downloads in Supabase

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-22 18:58:16 -04:00
Dani eef88f88a4 Revert: Restore /api directory - Vercel requires it for serverless functions
This reverts commit b082254. Vercel requires serverless functions in /api/
regardless of outputDirectory. Both directories are needed:
- /api/ for serverless functions (Vercel auto-detects here)
- /docs/api/ can be removed as it's redundant

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-22 18:55:12 -04:00
Dani b0822549a1 refactor: Remove redundant /api directory and consolidate to /docs/api
- Eliminated duplicate /api directory (not used by Vercel)
- Updated /docs/api/README.md to reflect single source of truth
- /docs/api/track-download-supabase.js already includes 'skill' type support
- Simplified maintenance workflow (no more file syncing needed)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-22 18:48:25 -04:00
Dani 3a88de9e45 fix json 2025-08-27 23:53:13 -04:00
Dani 50acf5676a cleanup: remove debugging files and secure sensitive data
Security improvements:
- Remove all debugging and test files (debug-db.js, test-db.js, init-db.js, etc.)
- Remove unused @vercel/postgres endpoint (track-download.js)
- Eliminate .env.production and .env.local files with exposed credentials
- Update documentation to reference correct API endpoint
- Ensure all sensitive data uses environment variables properly

Production ready:
- Only essential files remain for production deployment
- All endpoints use proper environment variable configuration
- Clean, secure codebase ready for main branch merge

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-19 15:41:48 -04:00
Dani 79b47207db fix: use correct @vercel/postgres version 0.10.0 2025-08-19 15:15:50 -04:00
Dani 477edf1c22 add: Supabase-based tracking endpoint and database initialization
- Add track-download-supabase.js using @supabase/supabase-js client
- Add init-db.js to check/initialize database tables
- Update dependencies to include Supabase client and latest @vercel/postgres
- Configure Supabase environment variables
- Provide SQL instructions for manual table creation if needed

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-19 15:13:57 -04:00
Dani d9a6c19b77 add: database debug endpoint for troubleshooting 2025-08-19 15:11:04 -04:00
Dani 77539b9982 fix: remove nested cli-tool directory and add local testing
- Remove accidentally created nested cli-tool/cli-tool directory
- Add simple tracking test script for local verification
- Confirmed tracking system works correctly with proper error handling
- Both database and telemetry endpoints are functional
- System gracefully handles local vs production differences

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-19 15:03:40 -04:00
Dani 0e6ded1a4c fix: convert API to Vercel-compatible format
- Replace pool-based connection with @vercel/postgres sql template
- Use Vercel's auto-detection instead of explicit runtime config
- Convert all database queries to sql template literals
- Simplify table creation with proper error handling
- Maintain all functionality while ensuring Vercel compatibility

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-19 14:37:12 -04:00
Dani d6fc02b52f fix: update Vercel API configuration for proper deployment
- Fix runtime configuration to use @vercel/node instead of nodejs18.x
- Convert API to ES modules for Vercel compatibility
- Add package.json for API function dependencies
- Ensure proper module handling for @vercel/postgres

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-19 14:32:37 -04:00
Dani b5f5c49ec8 feat: add anonymous download tracking system with Vercel database integration
Implements a comprehensive download tracking system inspired by npm analytics
to monitor component usage and improve popular components.

Key features:
• Anonymous download tracking for all component types (agents, commands, mcps, settings, hooks)
• Vercel + PostgreSQL backend with dual endpoint strategy
• Privacy-first design with complete opt-out support
• Fire-and-forget tracking that never blocks user experience
• Comprehensive test suite and documentation

Backend changes:
• Created API endpoint /api/track-download.js with PostgreSQL integration
• Implemented proper database schema with download_stats aggregation
• Added request validation, rate limiting, and security measures
• Configured Vercel deployment with database functions

CLI changes:
• Enhanced TrackingService to support database + telemetry endpoints
• Added automatic tracking for all installation types
• Implemented graceful fallback when database is unavailable
• Maintains existing privacy and opt-out mechanisms

Testing & Documentation:
• Added comprehensive test suite (test-download-tracking.js)
• Created detailed documentation (DOWNLOAD_TRACKING.md)
• Included deployment instructions and troubleshooting guide
• Added security and compliance information

The system respects user privacy by:
- Only collecting anonymous usage metrics
- Providing multiple opt-out mechanisms (CCT_NO_TRACKING, CCT_NO_ANALYTICS, CI=true)
- Never storing personally identifiable information
- Using fire-and-forget requests with timeout limits

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-19 14:17:34 -04:00