Your intelligent partner for analyzing text. TextSleuth AI is a cutting-edge web application that detects AI-generated content and checks for plagiarism using advanced AI-powered tools.
Live Demo β’ Report Bug β’ Request Feature
- Features
- Tech Stack
- Prerequisites
- Quick Start
- Installation
- Running the Project
- Project Structure
- Available Scripts
- AI Flows
- API Documentation
- UI Components
- Configuration
- Troubleshooting
- Contributing
- License
- Support
- π€ AI Content Detection - Identify whether text is AI-generated or human-written with confidence scoring
- π Plagiarism Checker - Detect plagiarism by comparing text against online sources and get similarity percentages
- π History Tracking - Keep a record of your previous analyses for easy reference
- π¨ Modern UI - Clean, responsive interface built with Next.js and Tailwind CSS
- β‘ Real-time Analysis - Get instant results using Google Genkit AI flows
- π± Fully Responsive - Works seamlessly on desktop, tablet, and mobile devices
- π Type-Safe - Built with TypeScript for maximum reliability
- π Fast Performance - Powered by Next.js with Turbopack for lightning-fast builds
- Frontend: Next.js 15.3.3 with TypeScript
- Styling: Tailwind CSS with shadcn/ui components
- AI Engine: Google Genkit with genai provider
- State Management: React Hooks
- Form Handling: React Hook Form with Zod validation
- Backend: Next.js Server Actions
- Database: Firebase
- Icons: Lucide React
Before running the project, ensure you have:
- Node.js 18 or higher (Download)
- npm or yarn package manager
- Google Gemini API key (Get Free API Key)
# Clone the repository
git clone https://github.com/darvex-0/TextSleuthAi-Project.git
cd TextSleuthAi-Project
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env.local
# Edit .env.local with your credentials
# Start development server
npm run devNavigate to http://localhost:9002 and start analyzing text!
git clone https://github.com/darvex-0/TextSleuthAi-Project.git
cd TextSleuthAi-Projectnpm install
# or
yarn installCreate a .env.local file in the root directory:
# Google Gemini API Key (Get free from https://aistudio.google.com/apikey)
GENKIT_API_KEY=your_gemini_api_key_here- Visit Google AI Studio
- Click "Create API Key" (Free tier available)
- Copy your API key
- Paste it in
.env.localas shown above
# Start Next.js development server (port 9002 with Turbopack)
npm run devVisit http://localhost:9002 to access the application.
# Verify TypeScript types without building
npm run typecheck# Run ESLint checks
npm run lint# Create optimized production build
npm run build
# Start production server
npm startsrc/
βββ ai/ # AI-related configurations
β βββ genkit.ts # Genkit initialization
β βββ dev.ts # Development setup
β βββ flows/ # AI workflow definitions
β βββ analyze-text-for-ai.ts # AI detection flow
β βββ check-text-for-plagiarism.ts # Plagiarism check flow
βββ app/ # Next.js app directory
β βββ layout.tsx # Root layout
β βββ page.tsx # Home page
β βββ globals.css # Global styles
β βββ ai-detector/ # AI detection tool
β β βββ page.tsx
β β βββ actions.ts # Server actions
β βββ plagiarism-checker/ # Plagiarism checker tool
β β βββ page.tsx
β β βββ actions.ts # Server actions
β βββ history/ # User history
β βββ page.tsx
βββ components/ # Reusable React components
β βββ ai-result-chart.tsx # Visualization component
β βββ ui/ # shadcn/ui components
βββ hooks/ # Custom React hooks
β βββ use-mobile.tsx # Mobile detection
β βββ use-toast.ts # Toast notifications
βββ lib/ # Utility functions
βββ utils.ts
βββ placeholder-images.json
βββ placeholder-images.ts
| Command | Description | Port |
|---|---|---|
npm run dev |
Start Next.js dev server with Turbopack | 9002 |
npm run build |
Create optimized production build | β |
npm start |
Start production server | 3000 |
npm run lint |
Run ESLint checks | β |
npm run typecheck |
Run TypeScript type checking | β |
Detects whether text is AI-generated or human-written.
Endpoint: POST /api/ai-detector
Input:
{
text: string; // The text to analyze
}Output:
{
isAiGenerated: boolean; // Whether text is AI-generated
confidenceScore: number; // Confidence score (0-1)
}Example:
curl -X POST http://localhost:9002/api/ai-detector \
-H "Content-Type: application/json" \
-d '{"text": "Your text here..."}'Detects plagiarism by comparing text against online sources.
Endpoint: POST /api/plagiarism-checker
Input:
{
text: string; // The text to check for plagiarism
}Output:
{
similarityPercentage: number; // Similarity percentage (0-100)
sourceUrls: string[]; // URLs of matching sources
}Example:
curl -X POST http://localhost:9002/api/plagiarism-checker \
-H "Content-Type: application/json" \
-d '{"text": "Your text here..."}'| Variable | Description | Required |
|---|---|---|
GENKIT_API_KEY |
Google Gemini API key | β |
Get your free API key at: https://aistudio.google.com/apikey
The project uses:
- next.config.ts - Custom Next.js configuration
- tsconfig.json - TypeScript configuration with strict mode
- tailwind.config.ts - Tailwind CSS customization
- postcss.config.js - PostCSS plugins
- components.json - shadcn/ui component configuration
The project leverages shadcn/ui, a high-quality component library built on Radix UI and Tailwind CSS:
Data Display: Accordion, Avatar, Badge, Card, Carousel, Chart, Progress, Skeleton, Table, Tabs
Input: Button, Checkbox, Dialog, Dropdown, Input, Label, Radio Group, Select, Slider, Switch, Textarea
Feedback: Alert, Alert Dialog, Toast, Tooltip
Layout: Collapsible, Menubar, Popover, Scroll Area, Separator, Sheet, Sidebar
For component documentation, visit shadcn/ui docs.
The application is fully responsive and optimized for:
| Device | Breakpoint | Status |
|---|---|---|
| Mobile | < 640px | β Optimized |
| Tablet | 640px - 1024px | β Optimized |
| Desktop | > 1024px | β Optimized |
All components adapt seamlessly across screen sizes using Tailwind CSS responsive utilities.
- β Type-Safe - Full TypeScript coverage for type safety
- β Server Actions - Secure server-side execution with Next.js
- β Form Validation - Input validation using Zod schemas
- β
Environment Variables - API keys protected via
.env.local(never committed to git) - β API Key Protection - Keys never exposed to client-side code
# If port 9002 is already in use, specify a different port
npm run dev -- -p 3000# Ensure your GEMINI_API_KEY is set correctly in .env.local
# The Genkit flows run automatically with npm run dev- Verify your API key is valid: https://aistudio.google.com/apikey
- Check that Gemini API is enabled for your key
- Verify
.env.localfile is in the root directory with the correct API key - Restart the development server after updating
.env.local
# Verify .env.local exists in the root directory
ls -la .env.local
# Restart the development server after updating .env.local
# Clear Next.js cache if needed
rm -rf .next
npm run dev# Run type checking to identify issues
npm run typecheck
# Update dependencies if types are outdated
npm install --save-dev @types/node@latest# Verify API key is set correctly
echo $env:GENKIT_API_KEY # PowerShell on Windows
echo $GENKIT_API_KEY # Bash on Mac/Linux- Ensure your API key is valid: https://aistudio.google.com/apikey
- Check that Gemini API is enabled for your key
- Verify
.env.localfile is in the root directory - Restart the development server after updating
.env.local
For more help, check the troubleshooting guide or open an issue.
We welcome contributions to TextSleuth AI! Here's how to get started:
-
Fork the repository
git clone https://github.com/darvex-0/TextSleuthAi-Project.git
-
Create a feature branch
git checkout -b feature/amazing-feature
-
Make your changes
- Write clean, well-documented code
- Follow the existing code style
- Add tests if applicable
-
Commit your changes
git commit -m 'Add amazing feature' -
Push to the branch
git push origin feature/amazing-feature
-
Open a Pull Request
- Describe the changes in detail
- Reference related issues
- Ensure all tests pass
- Use TypeScript for type safety
- Follow ESLint rules:
npm run lint - Format code with Prettier (if configured)
- Write meaningful commit messages
When reporting bugs, please include:
- OS and Node.js version
- Steps to reproduce
- Expected vs actual behavior
- Error messages or screenshots
You are free to use, modify, and distribute this software for any purpose. see the LICENSE file for details.
Need help? Here are your options:
- π§ Email - rakeshpallamgod@gmail.com
- π Bug Reports - Open an issue
- π‘ Feature Requests - Request a feature
- π¬ Discussions - GitHub Discussions
- π Documentation - Wiki
This project was built with amazing open-source technologies:
- Next.js - React framework for production
- Google Genkit - Generative AI framework
- Google Gemini API - Advanced AI models (Free tier available)
- shadcn/ui - High-quality UI components
- Tailwind CSS - Utility-first CSS framework
- TypeScript - JavaScript with syntax for types
- Lucide Icons - Beautiful icon library
- React Hook Form - Performant forms
- Zod - TypeScript-first schema validation
Special thanks to the community for contributions and feedback!
Made with β€οΈ by the TextSleuth AI Team
Version: 0.1.0 | Last Updated: December 2025