# Changelog

All notable changes to the AeroCorp CLI will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [6.0.0] - 2025-09-02

### 🐘 Added - Neon WebSocket Proxy Support

- **NEW: Neon WebSocket Proxy Integration** - First-class support for serverless Postgres connectivity
- **NEW: `aerocorp neon` command group** with complete lifecycle management:
  - `aerocorp neon setup` - Create Postgres + wsproxy stack in Coolify
  - `aerocorp neon deploy` - (Re)deploy the stack
  - `aerocorp neon status` - Show stack + endpoint health
  - `aerocorp neon env <APP_UUID>` - Inject DATABASE_URL & PG* vars into apps
  - `aerocorp neon teardown` - Delete the stack with optional --force flag
- **NEW: PostgreSQL 17 Support** - Latest PostgreSQL with Alpine Linux base
- **NEW: WebSocket-to-TCP Proxy** - Using `ghcr.io/neondatabase/wsproxy:latest`
- **NEW: Traefik SSL Integration** - Automatic HTTPS/WSS termination with Let's Encrypt
- **NEW: Environment Variable Injection** - Automatic DATABASE_URL setup for applications
- **NEW: Health Monitoring** - Database and proxy endpoint health checks
- **NEW: Drizzle ORM Examples** - Ready-to-use configuration in `examples/drizzle.config.ts`
- **NEW: Comprehensive Documentation** - Complete guide in `docs/NEON_GUIDE.md`

### 🔧 Enhanced

- **Extended CoolifyService** with new methods:
  - `createComposeApp()` - Create docker-compose applications
  - `deployByUuid()` - Deploy applications by UUID with force option
  - `createAppEnv()` - Inject environment variables into applications
  - `deleteApp()` - Delete applications and cleanup resources
  - `getVersion()` - Get Coolify version for health checks
- **Updated CLI Header** - Now displays Neon WebSocket Proxy branding
- **Enhanced Error Handling** - Better error messages for Neon operations
- **Improved Documentation** - Updated README with comprehensive Neon section

### 📦 Dependencies

- **Added**: `@neondatabase/serverless@^0.9.0` - Official Neon serverless driver
- **Updated**: Package keywords to include "neon", "websocket-proxy", "postgres"

### 🏗️ Infrastructure

- **NEW: Docker Compose Template** - `templates/coolify/neon-stack.yml` with:
  - PostgreSQL 17 with persistent storage
  - Neon wsproxy with WebSocket support
  - Traefik labels for SSL/WSS termination
  - Health checks and proper networking
  - Environment variable substitution

### 📋 Configuration

- **NEW: Environment Variables**:
  - `NEON_DOMAIN` - WebSocket endpoint domain (default: cloud.aerocorpindustries.org)
  - `PGUSER` - Database user (default: pgadmin)
  - `PGPASSWORD` - Database password (default: change-me-strong)
  - `PGDATABASE` - Database name (default: aerocorp)
  - `COOLIFY_PROJECT_UUID` - Required for stack creation
  - `COOLIFY_DESTINATION_UUID` - Required for stack creation

### 🎯 Use Cases

- **Serverless Applications** - Connect to Postgres from Vercel, Netlify, Cloudflare Workers
- **Edge Runtime Support** - WebSocket connections work in browser-like environments
- **Development Workflows** - Quick database setup for development and testing
- **Production Deployments** - Scalable Postgres with WebSocket proxy for production use

### 💻 Developer Experience

- **One-Command Setup** - `aerocorp neon setup` creates complete database stack
- **Automatic Configuration** - Environment variables injected automatically
- **Health Monitoring** - Built-in status checks and endpoint testing
- **ORM Integration** - Examples for Drizzle, Prisma, and raw SQL usage
- **TypeScript Support** - Full TypeScript definitions and examples

### 🔄 Migration Guide

For users upgrading from v5.x:

1. **Install New Version**:
   ```bash
   npm install -g @aerocorp/cli@6.0.0
   ```

2. **Set New Environment Variables**:
   ```bash
   export COOLIFY_PROJECT_UUID="your-project-uuid"
   export COOLIFY_DESTINATION_UUID="your-destination-uuid"
   export NEON_DOMAIN="your-domain.com"
   ```

3. **Create Neon Stack** (Optional):
   ```bash
   aerocorp neon setup
   ```

4. **Update Applications** (If using Neon):
   ```bash
   aerocorp neon env <YOUR_APP_UUID>
   ```

### 🚨 Breaking Changes

- **None** - v6.0.0 is fully backward compatible with v5.x
- All existing commands and functionality remain unchanged
- New Neon features are additive and optional

### 📚 Documentation

- **NEW**: `docs/NEON_GUIDE.md` - Comprehensive Neon WebSocket Proxy guide
- **UPDATED**: `README-AeroCorp CLI.md` - Added Neon section with examples
- **NEW**: `examples/drizzle.config.ts` - Drizzle ORM configuration example
- **NEW**: `CHANGELOG.md` - This changelog file

### 🔗 Links

- [Neon WebSocket Proxy](https://github.com/neondatabase/wsproxy)
- [@neondatabase/serverless](https://www.npmjs.com/package/@neondatabase/serverless)
- [Drizzle ORM](https://orm.drizzle.team/)
- [Coolify Documentation](https://coolify.io/docs)

---

## [5.1.0] - 2024-12-XX

### Added
- Enhanced Coolify integration with battle-tested patterns
- PR Preview deployments with automatic lifecycle management
- WSL integration for SSH and Docker operations on Windows
- Improved authentication using API tokens
- GitHub Actions workflow for automated preview deployments
- Enhanced error handling with clear troubleshooting guidance

### Changed
- Updated CLI header and branding
- Improved health monitoring with proper `/api/version` endpoint checks
- Enhanced security with zero-trust architecture

### Fixed
- SSH connectivity issues on Windows
- API authentication edge cases
- Log streaming reliability

---

## [5.0.0] - 2024-11-XX

### Added
- Initial Coolify integration
- Basic deployment commands
- Configuration management
- Health monitoring
- Security features

### Changed
- Complete rewrite of deployment logic
- New command structure
- Updated dependencies

### Removed
- Legacy deployment methods
- Deprecated configuration options

---

## [4.0.0] - 2024-10-XX

### Added
- AI-powered deployment optimization
- GitOps integration
- Edge computing support
- Quantum-ready security features
- Kubernetes native support
- Advanced observability and monitoring

---

## [3.0.0] - 2024-09-XX

### Added
- Multi-cloud support
- Serverless integration
- Advanced security scanning
- Automated rollbacks
- Canary deployments

---

## [2.0.0] - 2024-08-XX

### Added
- Enhanced deployment automation
- Monitoring and alerting
- Database management
- SSL certificate management

---

## [1.0.0] - 2024-07-XX

### Added
- Initial release
- Basic deployment functionality
- Configuration management
- Authentication system
