TestGen AI is a state-of-the-art test case generator designed to create high-coverage test suites instantly. Utilizing the power of Google Gemini API, TestGen AI scans your source code, requirements specs, or API endpoints to construct standard, copy-paste ready assertions spanning multiple testing frameworks (Jest, Mocha, PyTest, Supertest, Cypress, Playwright, etc.).
- Frontend Dashboard: https://ai-test-case-generation-agent.vercel.app
- Backend API Gateway: https://ai-test-case-generation-agent-5gnq.vercel.app
- Unit Assertion Builder: Builds standard assertions verifying method behaviors, success states, and input checks.
- Integration Pipelines: Simulates multi-step workflow logic covering databases, API routers, and services.
- Vulnerability Scanner: Tests boundary validation checks, SQL Injection safety, cross-site scripting risks, and headers.
- Edge Cases & Boundaries: Verifies empty payloads, zero limits, null pointer references, and extreme sizing.
- Performance Benchmarking: Sets expectations for response latencies, payload throughput, and limits.
- Dark Mode UI: Sleek, glassmorphism-based web interface built with Next.js, featuring glowing mesh gradients, progressive thinking sequences, and copyable results blocks.
- Core Framework: React 19 & Next.js 15 (App Router)
- Styling: Tailwind CSS & Vanilla CSS transitions
- Icons: Lucide React
- Client Routing: Next.js App Router static optimization
- Core Environment: Node.js (ES Modules)
- Routing Framework: Express.js
- AI Core: Google Gemini SDK (
@google/generative-ai) - Security & Utilities: CORS, dotenv, nodemon
Here is the complete folder and file tree of the project:
.
βββ backend/ # Node.js Express REST API server
β βββ controllers/ # Handlers for API endpoints
β β βββ generateController.js # Receives prompts and manages generation responses
β βββ middleware/ # Middleware interceptors
β β βββ errorMiddleware.js # Standard Express error handler
β βββ routes/ # API path routes definitions
β β βββ generateRoutes.js # Route mapping for POST /api/generate
β βββ services/ # Logic connecting to Google Gemini APIs
β β βββ geminiService.js # Core LLM processing and response schema mapping
β βββ utils/ # Helper functions for the backend
β β βββ promptBuilder.js # Builds and formats structured system prompts
β βββ .env # Backend environment configuration variables
β βββ package.json # Backend package and script setup
β βββ server.js # Server boot entry point, CORS settings, health checks
β βββ vercel.json # Serverless configuration rules for Vercel
β
βββ frontend/ # Next.js SPA Web Client
β βββ app/ # App Router views and layouts
β β βββ favicon.ico # Next.js tab logo file
β β βββ globals.css # Global stylesheets, fonts, animations, layout styles
β β βββ layout.tsx # Root App Router layout enclosing Navbar/Footer
β β βββ page.tsx # Main dashboard, templates grid, feature summaries
β β βββ privacy/ # Privacy policy route
β β β βββ page.tsx # Privacy Policy page details
β β βββ terms/ # Terms of Service route
β β βββ page.tsx # Terms of Service page details
β βββ components/ # Reusable UI component modules
β β βββ EmptyState.tsx # Component displayed when no tests are generated
β β βββ ExportButtons.tsx # Handles PDF/JSON actions
β β βββ Footer.tsx # Custom footer with links and admin contact
β β βββ Hero.tsx # Mesh gradient header and floating title transitions
β β βββ InputArea.tsx # Prompt textarea area and form submit controls
β β βββ Loading.tsx # Progressive 0-99% thinking sequencer UI
β β βββ Navbar.tsx # Premium top navigation header
β β βββ OutputCard.tsx # Code viewer with syntax highlight and copy functionality
β β βββ ResultSection.tsx # Outer boundary managing active output cards
β β βββ SampleTemplates.tsx # Clickable grid examples for fast prompts loading
β β βββ StatsSection.tsx # Viewport count-up numbers displaying test statistics
β βββ hooks/ # React custom state hooks
β β βββ useGenerate.ts # Integrates frontend UI states with backend API calls
β βββ public/ # Public static assets folder
β β βββ logo.png # Main app branding logo image file
β βββ services/ # API communication helpers
β β βββ api.ts # Defines base fetch instances with fallback values
β βββ types/ # TypeScript type interfaces definitions
β β βββ testResult.ts # Typing interface for AI test suite outputs
β βββ utils/ # Helper utilities
β β βββ copyText.ts # Handles secure clipboard copying
β β βββ downloadJson.ts # Triggers instant local file JSON downloads
β β βββ exportPDF.ts # Dynamic PDF report builder
β βββ .env.local # Frontend local build environments configuration file
β βββ next-env.d.ts # Next.js TypeScript definitions compiler file
β βββ next.config.ts # Configuration rules for Next.js routing/headers
β βββ package.json # Frontend packages, TS types, next scripts configuration
β βββ postcss.config.mjs # PostCSS styling pipeline config file
β βββ tailwind.config.ts # Design tokens, custom themes, and core color setup
β βββ tsconfig.json # TypeScript compiler strict mode settings
β
βββ .gitignore # Defines version control ignored resources
βββ README.md # Repository documentation guide
Follow these steps to run the application locally on your computer.
- Node.js (v18 or higher)
- npm package manager
- A Google Gemini API Key (Get one from Google AI Studio)
- Navigate to the backend directory:
cd backend - Install the backend dependencies:
npm install
- Create a
.envfile in thebackend/directory:PORT=5000 GEMINI_API_KEY=your_gemini_api_key_here GEMINI_MODEL=gemini-1.5-flash
- Start the backend development server:
The backend will boot up on http://localhost:5000.
npm run dev
- Navigate to the frontend directory:
cd ../frontend - Install the frontend dependencies:
npm install
- Create a
.env.localfile in thefrontend/directory to configure endpoints:NEXT_PUBLIC_API_URL=http://localhost:5000
- Run the frontend development server:
Open http://localhost:3000 in your browser to view the TestGen AI dashboard.
npm run dev
Check the status of the server.
- Endpoint:
GET /health - Response:
{ "status": "OK", "timestamp": "2026-05-25T08:52:00.000Z" }
Send specifications/code and receive a fully generated, multi-category test suite.
- Endpoint:
POST /api/generate - Headers:
Content-Type: application/json - Body:
{ "prompt": "Create an integration test suite for a node.js Express user register route that checks email validations and password hash storage." } - Response:
{ "unitTests": "...", "integrationTests": "...", "edgeCases": "...", "securityTests": "...", "performanceTests": "..." }
- Admin Name: Vijayapandian T
- Email Support: Vijayapandian.T
- GitHub Profile: Vijayapandian.T
- Git Repository: Vijayapandian.T