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
settingstable.
- 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
askdbfolder to your web root, e.g.htdocs/askdborpublic_html/askdb.
- Upload the
- 2. Create database
- Create a new MySQL/MariaDB database (e.g.
askdb) withutf8mb4charset.
- Create a new MySQL/MariaDB database (e.g.
- 3. Import SQL schema
- In this order, import:
database/askdb_schema.sqldatabase/admin_tables.sqldatabase/saved_queries_table.sqldatabase/chat_messages_table.sqldatabase/settings_table.sql- (Optional migration)
database/add_credits_used.sql
- In this order, import:
- 4. Configure database connection
- Edit
application/config/database.phpand set:hostname,username,password,databasefor your server.
- Edit
- 5. Set base URL
- Edit
application/config/config.php:$config['base_url'] = 'https://yourdomain.com/askdb/';(adjust to your domain/path).
- Edit
- 6. Configure OpenAI
- Option 1 (recommended): Log in as admin and go to
Admin → Settingsto 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_KEYor editapplication/config/openai.php.
- Option 1 (recommended): Log in as admin and go to
- 7. Admin access
- Default admin:
- Email:
admin@askdb.ai - Password:
admin123
- Email:
- Log in at
/adminand change the admin password immediately.
- Default admin:
- 8. User access
- Frontend login page:
/auth/login(or/loginif routed). - New users can register, get starter credits, upload their database schema, and start using AI‑powered SQL tools.
- Frontend login page:
| Author | agstephen33 |
|---|---|
| Category | Scripts & Code / PHP Scripts / Database |
| Price | $25 |
| Extended License | $75 |
| First Release | Mar 16, 2026 |
| Last Update | Mar 16, 2026 |
| Files included | .php, .css, .html, .sql, JavaScript .js |
| Software version | PHP 7.4, PHP 8.0, PHP 8.1, PHP 8.2, PHP 8.3, PHP 8.4 |
Categories
Tags
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🥇
Free LinkedIn Likes From Real Members | LinkedInLikes
Get free LinkedIn likes on your posts from real members who react by hand. No password needed: you only share a link.
Website · 12,847 views · 46 clicksWebsite · Week 49 · 12,847 views · 46 clicks
🥈
Free Medium Claps From Real Writers | MediumPlace
Free Medium claps on your stories from verified accounts of real writers, each given by hand. No bots, no Medium password, nothing to pay. Paste a link.
Website · 7,964 views · 10 clicksWebsite · Week 49 · 7,964 views · 10 clicks
🥉
Free GitHub Stars From Real Developers | GitWow
Get free GitHub stars on your repository from real developers who star by hand. No token or password, and it's free.
Website · 15,624 views · 28 clicksWebsite · Week 49 · 15,624 views · 28 clicks
#4
Free Substack Likes From Real Writers | StackRooms
Free Substack likes on your posts and Notes from verified accounts of real writers, given by hand. Free to ask, free to receive. Just share a link.
Website · 7,784 views · 2 clicksWebsite · Week 49 · 7,784 views · 2 clicks
#5
Free Twitter Likes From Real People | SupaTwitter
Free Twitter likes on your tweets from verified accounts of real people, each given by hand. No bots, no Twitter password, nothing to pay. Paste a link.
Website · 7,679 views · 4 clicksWebsite · Week 49 · 7,679 views · 4 clicks
#6
Free X Likes From Real People, Given by Hand | XFast
Free X likes on your posts from verified accounts of real people, each one given by hand. No bots, no X password, no conditions. Paste a link to start.
Website · 7,591 views · 0 clicksWebsite · Week 49 · 7,591 views · 0 clicks