diff --git a/.github/workflows/Push.yml b/.github/workflows/Push.yml index 97fc643..2315a1c 100644 --- a/.github/workflows/Push.yml +++ b/.github/workflows/Push.yml @@ -16,7 +16,7 @@ jobs: contents: read steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install dependencies run: npm ci - name: Build @@ -70,7 +70,7 @@ jobs: packages: write steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install dependencies run: npm install - name: Build package @@ -121,7 +121,7 @@ jobs: # Login to Docker Hub - name: Log in to Docker Hub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/auto_ci.yml b/.github/workflows/auto_ci.yml index 409f941..a6dda70 100644 --- a/.github/workflows/auto_ci.yml +++ b/.github/workflows/auto_ci.yml @@ -14,12 +14,12 @@ jobs: steps: - name: Checkout PR branch - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22 diff --git a/Docker/README.md b/Docker/README.md index 7b31633..cc2dd01 100644 --- a/Docker/README.md +++ b/Docker/README.md @@ -3,11 +3,12 @@ [![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white)](https://docker.com/) [![AxioDB](https://img.shields.io/badge/AxioDB-2.29.82-blue?style=for-the-badge)](https://www.npmjs.com/package/axiodb) -This Docker image provides a REST API server for AxioDB, allowing you to interact with the AxioDB database management system through HTTP requests. The container includes a web-based GUI dashboard for visual database management and comprehensive API endpoints for programmatic access. +This Docker image provides both a REST API server and TCP remote access for AxioDB, allowing you to interact with the AxioDB database management system through HTTP requests or TCP connections. The container includes a web-based GUI dashboard for visual database management, comprehensive API endpoints for programmatic access, and AxioDBCloud TCP connector for remote client connections. ## =� What's Included -- **REST API Server**: Full HTTP API for database operations +- **REST API Server**: Full HTTP API for database operations (Port 27018) +- **TCP Remote Access**: AxioDBCloud connector for remote client connections (Port 27019) - **Web GUI Dashboard**: Browser-based interface at `http://localhost:27018` - **API Documentation**: Interactive API reference at `http://localhost:27018/api` - **AxioDB Core**: Complete database management system @@ -22,19 +23,22 @@ This Docker image provides a REST API server for AxioDB, allowing you to interac docker run -d \ --name axiodb-server \ -p 27018:27018 \ + -p 27019:27019 \ theankansaha/axiodb ``` ### Custom Port Mapping ```bash -# Run on a different host port (e.g., 8080) +# Run on different host ports (e.g., 8080 for HTTP, 8081 for TCP) docker run -d \ --name axiodb-server \ -p 8080:27018 \ + -p 8081:27019 \ theankansaha/axiodb -# Access via http://localhost:8080 +# Access HTTP GUI via http://localhost:8080 +# Connect AxioDBCloud via axiodb://localhost:8081 ``` ### With Data Persistence @@ -44,7 +48,8 @@ docker run -d \ docker run -d \ --name axiodb-server \ -p 27018:27018 \ - -v axiodb-data:/app/AxioDB \ + -p 27019:27019 \ + -v axiodb-data:/app \ theankansaha/axiodb ``` @@ -52,6 +57,28 @@ docker run -d \ Once the container is running: +### TCP Remote Access (AxioDBCloud) + +- **Connection String**: `axiodb://localhost:27019` +- **Description**: Direct TCP connection for remote client access using AxioDBCloud +- **Features**: + - Full database API with same interface as embedded mode + - Auto-reconnection with exponential backoff + - Connection pooling for high concurrency + - Heartbeat monitoring for connection health + - Perfect for Node.js applications connecting remotely + +```javascript +const { AxioDBCloud } = require('axiodb'); + +const db = new AxioDBCloud('axiodb://localhost:27019'); +await db.connect(); + +const database = await db.createDB('myDatabase'); +const collection = await database.createCollection('users'); +const result = await collection.insert({ name: 'John', age: 30 }); +``` + ### Web GUI Dashboard - **URL**: `http://localhost:27018` @@ -130,15 +157,16 @@ const main = async () => { main(); ``` -### When to Use Docker vs NPM Package +### When to Use: Docker (REST API) vs Docker (TCP) vs NPM Package -| Use Case | Docker API | NPM Package | -| ------------------------------ | ------------------ | ----------------------------- | -| **Node.js Applications** | L Not recommended |  **Recommended** | -| **Microservices Architecture** |  Good choice | � Consider service boundaries | -| **Non-Node.js Applications** |  **Recommended** | L Not available | -| **Development/Prototyping** |  Quick setup |  Better performance | -| **Production Deployment** | � Network overhead |  **Recommended** | +| Use Case | Docker (REST API) | Docker (AxioDBCloud TCP) | NPM Package (Embedded) | +| ------------------------------ | ------------------ | ------------------------ | ------------------------- | +| **Local Node.js Apps** | Not recommended | Not recommended | **Recommended** | +| **Remote Node.js Apps** | Good choice | **Better performance** | Not applicable | +| **Microservices Architecture** | Good choice | **Recommended** | Consider boundaries | +| **Non-Node.js Applications** | **Recommended** | Not available | Not available | +| **Development/Prototyping** | Quick setup | Quick setup | **Best performance** | +| **Cloud Deployment** | Network overhead | **Optimized for cloud** | Not applicable | ## =' Configuration @@ -148,9 +176,10 @@ main(); docker run -d \ --name axiodb-server \ -p 27018:27018 \ + -p 27019:27019 \ -e AXIODB_PORT=27018 \ -e AXIODB_HOST=0.0.0.0 \ - + theankansaha/axiodb ``` ### Docker Compose @@ -160,12 +189,13 @@ version: "3.8" services: axiodb: - image: + image: theankansaha/axiodb container_name: axiodb-server ports: - - "27018:27018" + - "27018:27018" # HTTP API & GUI + - "27019:27019" # TCP Remote Access volumes: - - axiodb-data:/app/AxioDB + - axiodb-data:/app restart: unless-stopped volumes: @@ -238,7 +268,7 @@ cd AxioDB/Docker docker build -t axiodb:latest . # Run the container -docker run -d --name axiodb-server -p 27018:27018 axiodb:latest +docker run -d --name axiodb-server -p 27018:27018 -p 27019:27019 axiodb:latest ``` ## = @@ -259,7 +289,7 @@ netstat -tulpn | grep :27018 ```bash # Use a different port -docker run -d --name axiodb-server -p 8080:27018 +docker run -d --name axiodb-server -p 8080:27018 -p 8081:27019 theankansaha/axiodb ``` ### Data Persistence Issues @@ -269,8 +299,9 @@ docker run -d --name axiodb-server -p 8080:27018 docker run -d \ --name axiodb-server \ -p 27018:27018 \ - -v "$(pwd)/axiodb-data":/app/AxioDB \ - + -p 27019:27019 \ + -v "$(pwd)/axiodb-data":/app \ + theankansaha/axiodb ``` ## =� Additional Resources diff --git a/Document/src/App.tsx b/Document/src/App.tsx index 912b312..e70b031 100644 --- a/Document/src/App.tsx +++ b/Document/src/App.tsx @@ -14,6 +14,7 @@ import CreateDatabase from "./components/content/CreateDatabase"; import CreateCollection from "./components/content/CreateCollection"; import MaintainersZone from "./components/content/MaintainersZone"; import WhyChooseAxioDBPage from "./pages/WhyChooseAxioDBPage"; +import AxioDBCloud from "./components/content/AxioDBCloud"; function App() { return ( @@ -32,6 +33,7 @@ function App() { } /> } /> } /> + } /> } /> } /> diff --git a/Document/src/components/content/AxioDBCloud.tsx b/Document/src/components/content/AxioDBCloud.tsx new file mode 100644 index 0000000..700aa5f --- /dev/null +++ b/Document/src/components/content/AxioDBCloud.tsx @@ -0,0 +1,493 @@ +import React, { useEffect } from "react"; +import { React as Service } from "react-caches"; +import CodeBlock from "../ui/CodeBlock"; +import { + Cloud, + Server, + Zap, + Shield, + RefreshCw, + Activity, + Globe, + CheckCircle, + ArrowRight, + Package, + Terminal, + Code2, + Network, +} from "lucide-react"; + +const AxioDBCloud: React.FC = () => { + useEffect(() => { + Service.UpdateDocumentTitle( + "AxioDBCloud - Remote Database Access | AxioDB Documentation" + ); + }, []); + + return ( +
+ {/* Hero Section */} +
+
+
+
+ + + NEW FEATURE + +
+ +

+ AxioDBCloud +

+ +

+ Remote Database Access Made Simple +

+ +

+ Deploy AxioDB in Docker or Cloud. Connect from anywhere with the same API you already know. + Zero code changes, production-ready TCP protocol, automatic reconnection. +

+
+
+ + {/* Key Benefits */} +
+

+ + Why AxioDBCloud? +

+ +
+
+
+
+ +
+

+ Zero Code Changes +

+
+

+ Use the exact same API as embedded AxioDB. Just change from new AxioDB() to new AxioDBCloud() +

+
+ +
+
+
+ +
+

+ Deploy Anywhere +

+
+

+ Docker, AWS, Azure, Google Cloud, DigitalOcean, or your own servers. One instance, unlimited clients. +

+
+ +
+
+
+ +
+

+ Auto-Reconnect +

+
+

+ Built-in exponential backoff reconnection. Up to 10 retry attempts. Your app stays resilient. +

+
+ +
+
+
+ +
+

+ Production Ready +

+
+

+ 1000+ concurrent connections, heartbeat monitoring, request correlation, connection pooling. +

+
+
+
+ + {/* Quick Start - Server */} +
+

+ + Server Setup +

+ +
+ {/* Docker Method */} +
+
+ +

+ Option 1: Docker (Recommended) +

+
+ +

+ The easiest way to deploy AxioDB with TCP access: +

+ + + +
+

+ Tip: Use -v to persist data across container restarts. +

+
+
+ + {/* Node.js Method */} +
+
+ +

+ Option 2: Node.js Application +

+
+ +

+ Start TCP server programmatically: +

+ + + +
+

+ Default Port: TCP server listens on port 27019 (HTTP GUI uses 27018). +

+
+
+
+
+ + {/* Client Usage */} +
+

+ + Client Usage +

+ +
+
+

+ Basic Connection +

+ + +
+ +
+

+ Connection String Format +

+ + axiodb://[host]:[port] + +
    +
  • • Local: axiodb://localhost:27019
  • +
  • • Remote: axiodb://192.168.1.100:27019
  • +
  • • Cloud: axiodb://mydb.example.com:27019
  • +
+
+ +
+

+ Advanced Options +

+ + +
+
+
+ + {/* Complete API Examples */} +
+

+ + Complete API Examples +

+ +
+ {/* CRUD Operations */} +
+

+ CRUD Operations +

+ + +
+ + {/* Real-world Example */} +
+

+ Real-World Example: E-commerce App +

+ + +
+
+
+ + {/* Features */} +
+

+ + Features & Capabilities +

+ +
+ {[ + { icon: CheckCircle, title: "35+ Commands", desc: "Full CRUD, aggregation, indexing support" }, + { icon: RefreshCw, title: "Auto-Reconnect", desc: "Exponential backoff with 10 retry attempts" }, + { icon: Activity, title: "Heartbeat", desc: "PING/PONG every 30 seconds" }, + { icon: Network, title: "Connection Pool", desc: "1000+ concurrent connections" }, + { icon: Zap, title: "Fast Protocol", desc: "Binary JSON with 4-byte length prefix" }, + { icon: Shield, title: "TypeScript", desc: "Full type definitions included" }, + ].map((feature, idx) => ( +
+
+ +
+
+

+ {feature.title} +

+

+ {feature.desc} +

+
+
+ ))} +
+
+ + {/* Use Cases */} +
+

+ Perfect For +

+ +
+ {[ + { + title: "Microservices", + icon: Server, + desc: "Share one AxioDB instance across multiple services", + color: "blue" + }, + { + title: "Desktop Apps", + icon: Package, + desc: "Electron apps connecting to local or remote database", + color: "green" + }, + { + title: "Cloud Deployments", + icon: Cloud, + desc: "Deploy to AWS, Azure, Google Cloud, DigitalOcean", + color: "purple" + }, + ].map((useCase, idx) => ( +
+ +

+ {useCase.title} +

+

+ {useCase.desc} +

+
+ ))} +
+
+ + {/* Next Steps */} +
+

Ready to Get Started?

+

+ Deploy AxioDB in minutes and start connecting from anywhere. +

+ +
+
+ ); +}; + +export default AxioDBCloud; diff --git a/Document/src/components/content/Introduction.tsx b/Document/src/components/content/Introduction.tsx index a2367bc..ec18203 100644 --- a/Document/src/components/content/Introduction.tsx +++ b/Document/src/components/content/Introduction.tsx @@ -1,12 +1,16 @@ import { ArrowRight, + Cloud, Code, Database, Download, GitBranch, + RefreshCw, + Server, Shield, Sparkles, Star, + Terminal, Users, Zap, TrendingUp, @@ -550,6 +554,63 @@ const Introduction: React.FC = () => { + {/* AxioDBCloud Promotional Banner - NEW! */} +
+
+
+
+
+
+ +
+
+
+
+ + NEW FEATURE +
+

+ Introducing AxioDBCloud +

+

+ Deploy AxioDB in Docker or Cloud. Connect from anywhere with TCP protocol. Same API, zero code changes! +

+
+
+ + Fast TCP Protocol +
+
+ + 1000+ Connections +
+
+ + Auto-Reconnect +
+
+ +
+
+
+
+ {/* Built-in GUI Banner */}
diff --git a/Document/src/components/layout/Sidebar.tsx b/Document/src/components/layout/Sidebar.tsx index 9ad0660..54cf4bd 100644 --- a/Document/src/components/layout/Sidebar.tsx +++ b/Document/src/components/layout/Sidebar.tsx @@ -57,6 +57,16 @@ const sidebarSections: SidebarSection[] = [ }, ], }, + { + title: "Cloud & Remote Access", + items: [ + { + id: "axiodb-cloud", + label: "AxioDBCloud (TCP)", + path: "/cloud", + }, + ], + }, { title: "Basic Usage", items: [{ id: "operations", label: "Operations", path: "/usage" }], diff --git a/README.md b/README.md index 9a0a868..be114c3 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ SQLite is great, but it requires native bindings that break in Electron and cros - ✅ Built-in InMemoryCache with automatic invalidation - ✅ Multi-core parallelism with Worker Threads - ✅ Built-in web GUI at `localhost:27018` +- ✅ **NEW:** AxioDBCloud - TCP remote access for Docker/Cloud deployments --- @@ -51,6 +52,7 @@ SQLite is great, but it requires native bindings that break in Electron and cros - **Transaction Support:** ACID-compliant transactions with savepoints, rollback, and Write-Ahead Logging (WAL) - **Single Instance Architecture:** Unified management for unlimited databases, collections, and documents - **Web-Based GUI Dashboard:** Visual database administration, query execution, and real-time monitoring at `localhost:27018` +- **AxioDBCloud Remote Access:** TCP-based client for connecting to AxioDB from anywhere—Docker, Cloud, or local network - **Zero-Configuration Setup:** Serverless architecture—install and start building instantly - **Custom Database Path:** Flexible storage locations for better project organization @@ -89,6 +91,87 @@ await session.withTransaction(async (tx) => { --- +## ☁️ AxioDBCloud - Remote Database Access (NEW!) + +**Host AxioDB in Docker, connect from anywhere!** AxioDBCloud provides TCP-based remote access to your AxioDB instance with the exact same API as local embedded mode. + +### 🌟 Why AxioDBCloud? + +- **🚀 Deploy Once, Connect Everywhere:** Host AxioDB in Docker/Cloud, connect from multiple clients +- **🔄 Zero Code Changes:** Same API as embedded AxioDB - just change the client class! +- **⚡ TCP Protocol:** Fast binary protocol with automatic reconnection +- **🔐 Production Ready:** Connection pooling, heartbeat monitoring, error recovery +- **📦 Docker Support:** One-command deployment with included Dockerfile + +### Quick Start - Server (Docker) + +```bash +# Pull and run the AxioDB Docker container +docker run -d \ + --name axiodb-server \ + -p 27018:27018 \ + -p 27019:27019 \ + -v axiodb-data:/app \ + theankansaha/axiodb + +# Ports: +# 27018 - HTTP GUI Dashboard +# 27019 - TCP Remote Access (AxioDBCloud) +# Volume: /app is the main data directory +``` + +**Or run locally with Node.js:** + +```javascript +const { AxioDB } = require('axiodb'); +const db = new AxioDB(false, 'MyDB', '.', true); // Enable TCP on port 27019 +``` + +### Quick Start - Client + +```javascript +const { AxioDBCloud } = require('axiodb'); + +// Connect to remote AxioDB (same API as embedded!) +const client = new AxioDBCloud("axiodb://localhost:27019"); +await client.connect(); + +// Use exactly like embedded AxioDB +const db = await client.createDB("ProductionDB"); +const users = await db.createCollection("Users"); + +// All operations work identically +await users.insert({ name: "Alice", role: "admin" }); +const results = await users.query({ role: "admin" }) + .Limit(10) + .Sort({ createdAt: -1 }) + .exec(); + +await client.disconnect(); +``` + +### Features + +✅ **35+ Commands** - Full CRUD, aggregation, indexing +✅ **Auto-Reconnect** - Exponential backoff with up to 10 retry attempts +✅ **Heartbeat Monitoring** - PING/PONG every 30 seconds +✅ **Request Correlation** - UUID-based request/response matching +✅ **Connection Pooling** - Supports 1000+ concurrent connections +✅ **TypeScript Support** - Full type definitions included +✅ **Zero Breaking Changes** - Existing AxioDB code works unchanged + +### Use Cases + +- **Microservices:** Share one AxioDB instance across multiple services +- **Desktop Apps:** Electron apps connecting to local/remote database +- **Development:** Team members sharing a development database +- **Docker Deployments:** Container-based production deployments +- **Cloud Hosting:** Deploy to AWS, Azure, Google Cloud, DigitalOcean + +👉 **[Full AxioDBCloud Documentation](https://axiodb.in/cloud)** - Setup guides, API reference, Docker examples + +--- + ## 🏆 Performance Comparison ### AxioDB vs SQLite diff --git a/package.json b/package.json index 57d8819..26cdfda 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "axiodb", - "version": "7.33.229", + "version": "7.33.230", "description": "The Pure JavaScript Alternative to SQLite. Embedded NoSQL database for Node.js with MongoDB-style queries, zero native dependencies, built-in InMemoryCache, and web GUI. Perfect for desktop apps, CLI tools, and embedded systems. No compilation, no platform issues—pure JavaScript from npm install to production.", "main": "./lib/config/DB.js", "types": "./lib/config/DB.d.ts",