A powerful tool for detecting duplicate code patterns across your Replit projects with advanced analysis capabilities and intuitive visualizations.
- π Smart Code Analysis: Advanced duplicate detection using AST parsing and pattern matching
- π Multi-Project Scanning: Analyze all your Replit projects simultaneously
- π Visual Comparisons: Side-by-side code comparison with syntax highlighting
- π Cross-Project Patterns: Detect shared patterns across different repositories
- π Analytics Dashboard: Comprehensive insights into code duplication metrics
- π Secure Authentication: Replit OAuth2 integration with secure session management
- π Responsive Design: Works seamlessly on desktop and mobile devices
- Frontend: React 18, TypeScript, Tailwind CSS, Radix UI
- Backend: Express.js, Node.js 20+
- Database: PostgreSQL with Drizzle ORM
- Authentication: Replit OAuth2
- Testing: Vitest, React Testing Library
- Deployment: Replit Deployments
- Node.js 20 or higher
- Replit account
- Git
-
Fork this Repl or Clone the repository
# If cloning from GitHub (replace with actual repo URL) git clone https://github.com/canstralian/replit-duplicate-detector.git cd replit-duplicate-detector
-
Install dependencies
npm install
-
Environment Setup
cp .env.example .env # Edit .env with your configuration -
Database Setup
npm run db:push
-
Start Development Server
npm run dev
The application will be available at http://localhost:5000
-
Build for Production
npm run build
-
Start Production Server
npm run start
-
Deploy to Replit
- Connect your GitHub repository to Replit
- Configure environment variables in Replit Secrets
- Use the provided Replit configuration
βββ client/ # React frontend
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Page components
β β βββ hooks/ # Custom React hooks
β β βββ lib/ # Utility functions
βββ server/ # Express backend
β βββ routes.ts # API routes
β βββ db.ts # Database configuration
β βββ auth.ts # Authentication logic
β βββ services/ # Business logic
βββ shared/ # Shared types and schemas
βββ tests/ # Test files
βββ docs/ # Documentation
| Variable | Description | Required |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | Yes |
REPLIT_CLIENT_ID |
Replit OAuth2 client ID | Yes |
REPLIT_CLIENT_SECRET |
Replit OAuth2 client secret | Yes |
SESSION_SECRET |
Session encryption secret | Yes |
NODE_ENV |
Environment (development/production) | No |
PORT |
Server port (default: 5000) | No |
See .env.example for complete configuration options.
# Run all tests
npm test
# Run tests with coverage
npm run test:coverage
# Run tests in watch mode
npm run test:watchWe maintain >80% code coverage across all modules. Coverage reports are generated in coverage/ directory.
GET /api/auth/user- Get current userGET /api/login- Initiate OAuth loginPOST /api/logout- Logout user
GET /api/projects- List user projectsPOST /api/projects/:id/analyze- Analyze project for duplicatesGET /api/projects/:id/results- Get analysis results
GET /api/settings- Get user settingsPUT /api/settings- Update user settings
For detailed API documentation, visit /api/docs when running the application.
This application implements multiple security layers:
- Authentication: Secure OAuth2 integration with Replit
- Authorization: Role-based access control
- Input Validation: Comprehensive input sanitization using Zod
- Rate Limiting: API rate limiting to prevent abuse
- Security Headers: CSRF, XSS, and clickjacking protection
- HTTPS: Enforced in production with secure cookies
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and add tests
- Ensure tests pass:
npm test - Commit your changes:
git commit -m 'Add amazing feature' - Push to your branch:
git push origin feature/amazing-feature - Submit a pull request
- Bug Reports: GitHub Issues
- Feature Requests: GitHub Discussions
- Documentation: Wiki
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with β€οΈ for the Replit community
- Thanks to all contributors and testers
- Special thanks to the open-source community
- Advanced pattern recognition algorithms
- Integration with more version control systems
- Machine learning-based duplicate detection
- Team collaboration features
- API rate limiting improvements
- Performance optimizations
Made with β€οΈ by the Replit Community