Skip to content

pratiksahu/antagents-db-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

27 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– Antagents DB Tool - AI-Powered Backend-as-a-Service

License: MIT TypeScript Next.js Node.js Build Status Coverage Cypress Tests

Antagents DB Tool is a revolutionary AI-native Backend-as-a-Service platform that transforms natural language into production-ready database architectures. Build complete database schemas, APIs, and real-time applications by simply describing what you need in plain English.

✨ Features

πŸ€– AI-Powered Development

  • Natural Language Schema Generation: Describe your database in plain English
  • Intelligent Query Building: Convert natural language to optimized SQL
  • Smart API Generation: Auto-generate REST and GraphQL APIs from your schema
  • Code Optimization: AI-driven performance and security improvements

πŸš€ Core Features

  • Real-time Database: PostgreSQL with real-time subscriptions
  • Authentication: Multi-provider auth (OAuth, JWT, MFA, Magic Links)
  • File Storage: S3-compatible storage with CDN integration
  • Edge Functions: Serverless functions with TypeScript support
  • WebSocket Support: Real-time data synchronization
  • Auto-generated APIs: REST and GraphQL endpoints from database schema

πŸ›‘οΈ Enterprise-Ready

  • Multi-tenant Architecture: Complete data isolation
  • Row Level Security: Fine-grained access control
  • Compliance Ready: SOC 2, GDPR, CCPA support
  • Comprehensive Monitoring: APM, logging, and analytics
  • High Availability: 99.9% uptime SLA

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         Frontend (Next.js 14)               β”‚
β”‚  Dashboard β”‚ Schema Designer β”‚ API Explorer β”‚ Analytics     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
                                β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     API Gateway (Express)                   β”‚
β”‚  REST API β”‚ GraphQL β”‚ WebSocket β”‚ Auth β”‚ Rate Limiting     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β–Ό                       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     AI Services         β”‚    β”‚     Core Services           β”‚
β”‚  Schema Gen β”‚ Query AI  β”‚    β”‚  Database β”‚ Storage β”‚ Auth  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    β”‚                       β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Data Layer                               β”‚
β”‚  PostgreSQL β”‚ Redis β”‚ S3 Storage β”‚ Elasticsearch           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ (required)
  • pnpm 8+ (required - install with npm install -g pnpm)
  • Docker & Docker Compose (required for database services)
  • Git

Installation

  1. Clone the repository
git clone https://github.com/pratiksahu/antagents-db-tool.git
cd antagents-db-tool
  1. Update pnpm to latest version (if needed)
npm install -g pnpm@latest
  1. Install dependencies
# Install all workspace dependencies
pnpm install

# If you encounter issues, try:
pnpm install -r
  1. Set up environment variables
cp .env.example .env
# The default .env.example is pre-configured for local development
# Update DATABASE_URL and REDIS_URL if using different credentials
  1. Create required directories
mkdir -p infrastructure/docker/postgres
mkdir -p database/dev-scripts
  1. Create PostgreSQL initialization script
cat > infrastructure/docker/postgres/init.sql << 'EOF'
-- Initial database setup for Antagents DB Tool
CREATE DATABASE antagents_test;
CREATE DATABASE antagents_staging;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE EXTENSION IF NOT EXISTS "pgcrypto";
CREATE EXTENSION IF NOT EXISTS "pg_trgm";
GRANT ALL PRIVILEGES ON DATABASE antagents_development TO antagents;
GRANT ALL PRIVILEGES ON DATABASE antagents_test TO antagents;
GRANT ALL PRIVILEGES ON DATABASE antagents_staging TO antagents;
EOF
  1. Start Docker services (PostgreSQL, Redis, etc.)
# Start PostgreSQL and Redis containers
docker-compose up -d postgres redis

# Verify containers are running
docker ps

# If you encounter network issues, the docker-compose.yml has been updated with proper network configuration
  1. Quick Start - Simple Backend Server
# For a quick demo, run the simple backend server
node simple-server.js

# Server will be available at http://localhost:4000
# Health check: http://localhost:4000/health
# API Status: http://localhost:4000/api/v1/status
  1. View the Frontend Demo
# Open the demo dashboard in your browser
open index.html
# Or manually open: /Users/kumarpratik/Sites/ai/openbase/index.html

Full Development Setup (Optional)

For full development with all features:

# Install missing workspace packages dependencies
cd apps/backend
pnpm add express cors dotenv
cd ../frontend
pnpm add next react react-dom

# Start development servers
cd ../..
pnpm dev

Available Services

Troubleshooting

Issue: pnpm version incompatible

npm install -g pnpm@latest

Issue: Docker containers fail to start

# Stop all containers
docker-compose down
# Remove volumes if needed
docker-compose down -v
# Restart
docker-compose up -d postgres redis

Issue: Module not found errors

# The project uses workspace packages that need to be created
# For quick start, use the simple-server.js instead
node simple-server.js

Issue: Permission denied on Docker volumes

# Ensure directories exist with proper permissions
mkdir -p infrastructure/docker/postgres
mkdir -p database/dev-scripts

πŸ› οΈ Development

Project Structure

antagents-db-tool/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ frontend/          # Next.js 14 application
β”‚   └── backend/           # Node.js/Express API server
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ shared/            # Shared utilities and constants
β”‚   β”œβ”€β”€ types/             # TypeScript type definitions
β”‚   β”œβ”€β”€ ui-components/     # Reusable UI components
β”‚   └── database/          # Database models and migrations
β”œβ”€β”€ tools/
β”‚   β”œβ”€β”€ cli/               # CLI tool for project management
β”‚   └── scripts/           # Development and deployment scripts
β”œβ”€β”€ infrastructure/
β”‚   β”œβ”€β”€ docker/            # Docker configurations
β”‚   β”œβ”€β”€ kubernetes/        # K8s manifests
β”‚   └── terraform/         # Infrastructure as Code
└── docs/                  # Documentation

Available Scripts

# Development
pnpm dev                   # Start all services in development mode
pnpm build                 # Build all packages
pnpm test                  # Run tests
pnpm lint                  # Run linting
pnpm format                # Format code with Prettier

# Database
pnpm db:migrate            # Run database migrations
pnpm db:seed               # Seed development data
pnpm db:reset              # Reset database

# Docker
pnpm docker:up             # Start Docker services
pnpm docker:down           # Stop Docker services
pnpm docker:logs           # View Docker logs

# Type Generation
pnpm generate:types        # Generate TypeScript types from database

πŸ§ͺ Testing

# Run all tests
pnpm test

# Run specific test suites
pnpm test:unit             # Unit tests
pnpm test:integration      # Integration tests
pnpm test:e2e              # End-to-end tests

# Watch mode
pnpm test:watch

# Coverage
pnpm test:coverage

πŸ“š Documentation

🚒 Deployment

Production Deployment

  1. Build the application
pnpm build
  1. Deploy with Kubernetes
kubectl apply -f infrastructure/kubernetes/
  1. Or deploy with Docker
docker-compose -f docker-compose.production.yml up -d

Supported Platforms

  • Vercel: Optimized for Next.js frontend
  • AWS: EKS, RDS, S3, CloudFront
  • Google Cloud: GKE, Cloud SQL, Cloud Storage
  • Azure: AKS, Azure Database, Blob Storage
  • Self-hosted: Docker, Kubernetes

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“ž Support


Built with ❀️ by the Antagents Team

About

AntAgents db tool

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors