AskDB AI – SQL Query Generator icon

AskDB AI – SQL Query Generator

Hot or Not
AskDB AI – SQL Query Generator

Description

AskDB AI is a production‑ready, credit‑based SaaS application that lets your users query relational databases using plain English instead of SQL. Powered by OpenAI GPT models, it can generate, optimize, debug and execute SQL queries, create reports, build charts, and provide AI‑driven insights on top of your data. The platform includes a complete authentication system, user dashboard, credit packages, simulated billing flow, and a polished admin panel to monitor users, payments, queries, and API settings. Built on CodeIgniter 3 and Bootstrap 5, AskDB AI is easy to deploy on any standard LAMP stack and simple to customize or extend for client projects or white‑label SaaS offerings.

Features

  • Natural language to SQL
    • Convert user questions into executable SQL.
    • Supports generation, optimization, and debugging of SQL queries.
  • AI‑powered analytics
    • Insights: generate SQL, execute it, and explain the results.
    • Report generator: full report SQL from a description.
    • Chat assistant for SQL help and explanations.
  • Charts & ER diagrams
    • Chart.js integration to visualize query results.
    • ER diagram view from uploaded schema definitions.
  • Credit‑based billing system
    • Configurable credit packages (Starter, Pro, Business).
    • Per‑feature credit usage (query, chat, insights, reports, optimizer, debugger).
    • Simulated checkout flow ready to be wired to Stripe/PayPal.
  • User management
    • Email/password registration and login with bcrypt hashing.
    • Free credits on registration (configurable).
    • Query history, saved queries library, templates, and schema management.
    • Block/unblock users from the admin panel.
  • Admin panel
    • Dashboard with key metrics (users, queries, revenue approximation, credits used).
    • Manage users, payments, and recent queries.
    • Settings page to configure OpenAI API key, model, and endpoint (including Azure/OpenAI‑compatible endpoints).
  • Secure architecture
    • Session‑based authentication (user and admin separated).
    • CSRF protection, XSS escaping helpers, and prepared statements / Query Builder.
    • API keys stored in the database settings table.
  • Modern UI/UX
    • Bootstrap 5.3 + Bootstrap Icons.
    • Clean, responsive layouts for both user dashboard and admin panel.
  • Extensible codebase
    • CodeIgniter 3 MVC structure.
    • Reusable OpenAI libraries for SQL, chat, insights, charts, and reports.
    • Helper functions and hooks for centralized AI configuration and overrides.

Requirements

  • Server requirements
    • PHP 7.4+ (PHP 8.x recommended)
    • MySQL 5.7+ or MariaDB 10.3+
    • Apache (with mod_rewrite) or Nginx equivalent
    • PHP extensions: cURL, JSON, MBString, OpenSSL
    • Composer not required (classic CI3 project)
  • Client requirements
    • Modern browser (Chrome, Firefox, Edge, Safari)
    • JavaScript enabled
  • External services
    • OpenAI API key (or compatible provider/Azure endpoint)

Instructions

  • . Upload files
    • Upload the askdb folder to your web root, e.g. htdocs/askdb or public_html/askdb.
  • 2. Create database
    • Create a new MySQL/MariaDB database (e.g. askdb) with utf8mb4 charset.
  • 3. Import SQL schema
    • In this order, import:
      • database/askdb_schema.sql
      • database/admin_tables.sql
      • database/saved_queries_table.sql
      • database/chat_messages_table.sql
      • database/settings_table.sql
      • (Optional migration) database/add_credits_used.sql
  • 4. Configure database connection
    • Edit application/config/database.php and set:
      • hostname, username, password, database for your server.
  • 5. Set base URL
    • Edit application/config/config.php:
      • $config['base_url'] = 'https://yourdomain.com/askdb/'; (adjust to your domain/path).
  • 6. Configure OpenAI
    • Option 1 (recommended): Log in as admin and go to Admin → Settings to set your:
      • OpenAI API key
      • Model (e.g. gpt-4o-mini)
      • Endpoint (default <a href="https://api.openai.com/v1/chat/completions">https://api.openai.com/v1/chat...</a>)
    • Option 2: Put the API key in environment variable OPENAI_API_KEY or edit application/config/openai.php.
  • 7. Admin access
    • Default admin:
      • Email: admin@askdb.ai
      • Password: admin123
    • Log in at /admin and change the admin password immediately.
  • 8. User access
    • Frontend login page: /auth/login (or /login if routed).
    • New users can register, get starter credits, upload their database schema, and start using AI‑powered SQL tools.
Authoragstephen33
CategoryScripts & Code / PHP Scripts / Database
Price$25
Extended License$75
First ReleaseMar 16, 2026
Last UpdateMar 16, 2026
Files included.php, .css, .html, .sql, JavaScript .js
Software versionPHP 7.4, PHP 8.0, PHP 8.1, PHP 8.2, PHP 8.3, PHP 8.4

External listing. code.market does not sell this product and does not process payment for it. Pricing, payment, delivery, licensing, refunds, and support are handled by the third-party merchant on its own website. We may earn an affiliate commission from a referral. Details.

Products of the Week.

Submit