# DataBridge CLI

> **Auto-generate production-ready REST APIs from any database**

Turn your MySQL, PostgreSQL, SQL Server, SQLite, or CockroachDB into a fully functional REST API in seconds.

## Quick Start

```bash
# Install globally
npm install -g @databridge-cli/cli

# Create a new project
databridge init my-api

# Follow the prompts...
# Your API is now running at http://localhost:3000
```

## Features

- ✅ **Full CRUD operations** for all database tables
- ✅ **Interactive API documentation** at `/docs`
- ✅ **Type-safe TypeScript** code generation
- ✅ **OpenAPI 3.0 specification** auto-generated
- ✅ **Multi-language SDK generation** (50+ languages via OpenAPI Generator)
- ✅ **Frontend framework support** (Angular, React, Vue, Svelte)
- ✅ **Production-ready logging** built-in
- ✅ **5+ databases supported** (MySQL, PostgreSQL, SQL Server, SQLite, CockroachDB)

## What It Does

DataBridge automatically:
- Connects to your existing database
- Generates REST API routes with full CRUD operations
- Creates SDKs for 50+ languages (Python, Go, C#, Java, TypeScript, etc.)
- Generates frontend clients (Angular, React, Vue, Svelte)
- Generates OpenAPI 3.0 specs for testing and documentation
- Keeps everything in sync with simple commands
- Stays extensible - customize generated code easily

## Documentation

- **Full Documentation**: https://databridge.chanansystems.co.ke
- **Getting Started**: https://databridge.chanansystems.co.ke/docs/getting-started/quick-start/
- **CLI Reference**: https://databridge.chanansystems.co.ke/docs/api/cli-reference/
- **GitHub Repository**: https://github.com/alex-migwi/databridge

## Usage

### Initialize a New Project

```bash
databridge init my-project
cd my-project
```

### Generate API from Database

```bash
# Configure your database connection
databridge generate
```

### Start the API Server

```bash
databridge serve
# API available at http://localhost:3000
# Docs available at http://localhost:3000/docs
```

### Generate Client SDKs

```bash
# Generate SDK for specific language(s)
databridge generate-sdk --lang typescript-axios --output ./sdks

# Generate multiple SDKs at once
databridge generate-sdk --lang python,go,typescript-axios --output ./sdks
```

## Requirements

- Node.js 18+ (20+ recommended)
- npm 8+
- Supported database (MySQL, PostgreSQL, SQL Server, SQLite, or CockroachDB)

## Support

- **Issues**: https://github.com/alex-migwi/databridge/issues
- **Discussions**: https://github.com/alex-migwi/databridge/discussions

## Package Information

**Universal Package**: Works on Windows, macOS, and Linux.

**Previous Platform-Specific Packages** (deprecated):
- `@databridge-cli/cli-win32`
- `@databridge-cli/cli-darwin`
- `@databridge-cli/cli-linux`

If you're using an old platform-specific package, please upgrade to the universal package.

## License

MIT License - see [LICENSE](https://github.com/alex-migwi/databridge/blob/master/LICENSE) for details.

---

**Built by the DataBridge team**
