UNPKG

@entro314labs/at3-stack-kit

Version:

Upgrade existing projects to AT3 Stack with intelligent migration

290 lines (215 loc) • 7.57 kB
# AT3 Stack Kit <div align="center"> ![AT3 Logo](../../docs/media/at3-logo-text1.png) **Upgrade existing projects to AT3 Stack with intelligent migration** [![npm version](https://badge.fury.io/js/@entro314-labs%2Fat3-stack-kit.svg)](https://badge.fury.io/js/@entro314-labs%2Fat3-stack-kit) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Node.js Version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg)](https://nodejs.org/) </div> **AT3 Stack Kit** intelligently upgrades your existing Next.js, React, or T3 projects to the full AT3 Stack (AIT3E) with AI integration, edge deployment capabilities, and modern development tools. ## About AT3 Stack **AT3** (AIT3E) combines the proven T3 foundation with first-class AI integration and edge-first architecture: - **šŸ¤– AI** - First-class artificial intelligence integration with multiple providers - **šŸ“š T3** - The beloved Next.js + TypeScript + Tailwind foundation - **⚔ E** - Edge computing and serverless deployment ## Quick Start ```bash # Upgrade your current project to AT3 Stack npx @entro314-labs/at3-stack-kit # Or with pnpm (recommended) pnpm dlx @entro314-labs/at3-stack-kit # Or install globally npm install -g @entro314-labs/at3-stack-kit at3-kit ``` ## Features ### **šŸ” Smart Project Detection** Automatically analyzes your existing project structure and dependencies to determine the best upgrade path. ### **šŸ¤– AI Integration** Add AI capabilities to your existing project: - **Custom AI** - Flexible integration with OpenAI, Anthropic, Google AI - **Vercel AI SDK** - Streamlined AI with built-in streaming support - **Hybrid Approach** - Combine multiple AI providers for maximum flexibility ### **⚔ Edge Enhancement** Transform your app for edge deployment: - Supabase integration for edge-compatible database - Middleware optimization for edge runtime - Global CDN and serverless deployment ready ### **šŸ“¦ Modern Development Stack** Upgrade your development experience: - PWA support for mobile-first experiences - Internationalization (i18n) for global apps - Comprehensive testing setup with Vitest and Playwright - Modern build tools and optimizations ### **šŸ›”ļø Safe Migration** - **Backup Creation** - Automatic backups before any changes - **Rollback Support** - Easy revert if needed - **Dry Run Mode** - Preview changes without applying them - **Incremental Updates** - Add features one at a time ## Usage ### Interactive Mode (Recommended) ```bash # Launch interactive upgrade wizard npx @entro314-labs/at3-stack-kit ``` The CLI will: 1. šŸ” Analyze your current project 2. šŸ’” Recommend AT3 features based on your stack 3. ✨ Guide you through feature selection 4. šŸš€ Apply changes with progress tracking ### Command Line Options ```bash # Upgrade specific directory at3-kit /path/to/project # Add specific feature at3-kit --add ai-vercel # Preview changes without applying at3-kit --dry-run # Skip interactive prompts at3-kit --yes # Verbose logging at3-kit --verbose ``` ### Available Features | Feature | Description | Best For | |---------|-------------|----------| | `ai-custom` | Custom AI integration with multiple providers | Maximum flexibility | | `ai-vercel` | Vercel AI SDK integration | Rapid AI development | | `supabase` | Database, auth, and edge functions | Full-stack applications | | `pwa` | Progressive Web App features | Mobile-first experiences | | `i18n` | Internationalization support | Global applications | | `testing` | Comprehensive testing setup | Production applications | ## Project Analysis Get detailed insights about your project: ```bash # Analyze current project compatibility at3-kit analyze # Check what AT3 features are missing at3-kit detect ``` Sample output: ``` šŸ“Š Project Analysis Type: Next.js application Package Manager: pnpm Features: TypeScript, Tailwind CSS, tRPC šŸ” AT3 Compatibility: āœ… Ready for upgrade šŸ’” Recommended: AI integration, Supabase, Testing setup ⚔ Missing: Edge optimization, PWA features ``` ## Migration Examples ### Upgrading a T3 App ```bash # Your T3 app structure your-t3-app/ ā”œā”€ā”€ src/ │ ā”œā”€ā”€ pages/ │ ā”œā”€ā”€ server/ │ └── styles/ └── package.json # After AT3 upgrade your-t3-app/ ā”œā”€ā”€ src/ │ ā”œā”€ā”€ app/ # ✨ Migrated to App Router │ ā”œā”€ā”€ components/ai/ # šŸ¤– AI components │ ā”œā”€ā”€ lib/supabase/ # ⚔ Edge database │ ā”œā”€ā”€ server/ │ └── styles/ ā”œā”€ā”€ middleware.ts # ⚔ Edge middleware └── .at3-config.json # šŸ“ AT3 configuration ``` ### Upgrading a React App ```bash # Before: Create React App react-app/ ā”œā”€ā”€ src/ ā”œā”€ā”€ public/ └── package.json # After: AT3 Stack react-app/ ā”œā”€ā”€ src/ │ ā”œā”€ā”€ app/ # ✨ Next.js App Router │ ā”œā”€ā”€ components/ # šŸ”„ Migrated components │ ā”œā”€ā”€ lib/ai/ # šŸ¤– AI integration │ └── styles/ # šŸŽØ Tailwind CSS ā”œā”€ā”€ next.config.js # āš™ļø Next.js configuration └── tailwind.config.js # šŸŽØ Styling configuration ``` ## Configuration AT3 Stack Kit creates an `.at3-config.json` file to track your project's AT3 integration: ```json { "version": "0.1.0", "created": "2024-01-09T...", "features": ["ai-vercel", "supabase", "testing"], "toolsUsed": ["at3-stack-kit"], "lastMigration": "2024-01-09T..." } ``` This enables: - šŸ”„ Smart integration with other AT3 tools - šŸ“Š Progress tracking across upgrades - šŸ’” Contextual recommendations - šŸš€ Workflow continuity ## AT3 Ecosystem **AT3 Stack Kit** works seamlessly with other AT3 tools: - **[create-at3-app](../create-at3-app)** - Start new projects with AT3 Stack - **[@entro314-labs/at3-toolkit](../at3-toolkit)** - Advanced development tools and migration ## Supported Projects AT3 Stack Kit can upgrade: - āœ… **Next.js** applications (Pages or App Router) - āœ… **React** applications (Create React App, Vite, custom) - āœ… **T3 Stack** applications - āœ… **TypeScript** and **JavaScript** projects - āœ… **Monorepo** projects (with proper configuration) ## Requirements - Node.js 18.0.0 or higher - One of: npm, pnpm, yarn, bun - Git (for backup creation) ## Advanced Usage ### Rollback Changes ```bash # Rollback last migration at3-kit rollback # Rollback to specific backup at3-kit rollback --backup 2024-01-09-backup ``` ### Custom Configuration ```bash # Use custom templates at3-kit --template-dir ./custom-templates # Skip specific checks at3-kit --skip-checks typescript,eslint # Apply migrations in stages at3-kit --stage database at3-kit --stage ai at3-kit --stage testing ``` ## Troubleshooting ### Common Issues **Migration fails with dependency conflicts:** ```bash # Clean install and retry rm -rf node_modules package-lock.json at3-kit --force ``` **TypeScript errors after upgrade:** ```bash # Update TypeScript configuration at3-kit --fix-typescript ``` **Supabase setup fails:** ```bash # Manual Supabase initialization npx supabase init at3-kit --skip-supabase ``` ## Contributing We welcome contributions! Please see our [Contributing Guide](../../CONTRIBUTING.md). ## Support - šŸ“– [Documentation](https://at3-stack.dev) - šŸ› [Issues](https://github.com/entro314-labs/at3-stack-kit/issues) - šŸ’¬ [Discord](https://discord.gg/at3-stack) - 🐦 [Twitter](https://twitter.com/at3stack) ## License MIT Ā© [entro314-labs](https://github.com/entro314-labs)