Skip to content

AADYTH/RepoProof

Repository files navigation

# RepoProof A real GitHub repository originality analyzer that actually fetches data from the GitHub API. ## What Makes This Real Unlike mockup demos, this app: - ✅ Connects to GitHub's real API - ✅ Fetches actual repository metadata (stars, forks, languages, topics) - ✅ Calculates originality scores based on real metrics (fork status, language diversity, description quality) - ✅ Finds similar repositories using GitHub's search API - ✅ Returns live data for any public repository ## Quick Start (VS Code) ### 1. Frontend Setup ```bash # In the root folder npm install npm run dev ``` Frontend runs on `http://localhost:5173` ### 2. Backend Setup (Real GitHub API) Open a **new terminal** in VS Code: ```bash cd backend npm install ``` Create your environment file: ```bash # Windows (PowerShell) copy .env.example .env # Mac/Linux cp .env.example .env ``` Edit `.env` and add your GitHub token: ``` GITHUB_TOKEN=ghp_your_actual_token_here PORT=3001 ``` **Get your GitHub token:** 1. Go to https://github.com/settings/tokens 2. Click "Generate new token (classic)" 3. No scopes needed for public repos (just public_repo if you want to analyze private ones you own) 4. Copy the token and paste in `.env` Run the backend: ```bash npm run dev ``` Backend runs on `http://localhost:3001` ### 3. Connect Frontend to Backend In the root folder, create `.env`: ``` VITE_API_BASE_URL=http://localhost:3001 ``` Restart the frontend (Ctrl+C then `npm run dev` again) ## How It Works 1. You paste a GitHub URL (e.g., `https://github.com/facebook/react`) 2. Frontend sends it to the backend API (`POST /api/analyze`) 3. Backend calls GitHub API to fetch: - Repository metadata (stars, forks, language, topics, description) - Language breakdown - Related repositories via search 4. Backend calculates originality score based on: - Not being a fork (+15 points) - Having a good description (+10 points) - Using multiple languages (+10 points) - Having custom topics (+10 points) - Reasonable repository size (not empty template) 5. Returns real data to frontend with animated visualization ## Project Structure ``` repoproof/ ├── src/ # Frontend (React + Vite) │ ├── App.tsx # Main page │ └── lib/ │ ├── repoproof.ts # API client │ └── types.ts # TypeScript types ├── backend/ # Backend (Node.js + Express) │ ├── server.js # API server │ ├── package.json │ └── .env.example ├── index.html └── package.json ``` ## API Endpoints ### POST /api/analyze Analyzes a GitHub repository **Request:** ```json { "repoUrl": "https://github.com/vercel/next.js" } ``` **Response:** ```json { "score": 87, "confidence": 85, "summary": "Independent repository with original codebase. Uses TypeScript. High uniqueness detected...", "similarRepos": [ { "name": "remix-run/remix", "similarity": 45, "stars": 28000, "url": "https://github.com/remix-run/remix" } ], "metadata": { "name": "vercel/next.js", "stars": 123000, "languages": ["TypeScript", "JavaScript"], "topics": ["react", "framework", "javascript"] } } ``` ### GET /api/health Check API status and GitHub token configuration ## Customizing the Score Algorithm Edit `backend/server.js` → `calculateOriginalityScore()` function: ```javascript function calculateOriginalityScore(repoData) { let score = 50; // Base // Add your own logic: if (repoData.stargazers_count > 1000) score += 10; if (repoData.topics.includes('react')) score -= 5; // Penalize common topics // etc... return Math.min(98, Math.max(20, score)); } ``` ## Deployment ### Deploy Backend (Railway/Render/Fly.io) 1. Push to GitHub 2. Connect Railway/Render to your repo 3. Add environment variable: `GITHUB_TOKEN=your_token` 4. Get your deployed URL (e.g., `https://repoproof-api.up.railway.app`) ### Deploy Frontend (Vercel) ```bash npm run build ``` Add environment variable in Vercel: ``` VITE_API_BASE_URL=https://your-backend-url.com ``` ## GitHub Rate Limits - **Without token:** 60 requests/hour (good for testing) - **With token:** 5,000 requests/hour (production ready) If you hit limits, the app will show an error message suggesting you add a token. ## LinkedIn Post Template "Just shipped RepoProof — a tool that analyzes GitHub repos for originality using real API data. Built with: • React + TypeScript + Framer Motion • Node.js backend calling GitHub API • Real-time similarity detection Try it: [your-url] GitHub: [repo-link] It actually fetches live repo data, calculates uniqueness scores based on metadata analysis, and finds similar projects using GitHub's search API. No mock data." ## Troubleshooting **"Failed to analyze repository"** - Is the backend running? Check `http://localhost:3001/api/health` - Is your GitHub token valid? **"Repository not found"** - Make sure it's a public repository - Check the URL format: `https://github.com/owner/repo` **CORS errors** - Backend already has CORS enabled for all origins - Make sure frontend URL is correct ## Next Steps to Make It Yours 1. **Improve the algorithm**: Add code fingerprinting using AST parsing 2. **Add caching**: Store results in Redis/database to avoid hitting GitHub limits 3. **User accounts**: Let users save their scans 4. **Better similarity**: Use embeddings to compare code semantics, not just metadata 5. **Chrome extension**: Analyze repos while browsing GitHub --- Built to be real. No fake data. Just actual GitHub analysis. # RepoProof

About

AI-powered scanner to verify project authenticity. RepoProof analyzes GitHub repos against open-source templates to generate an "Originality Score." Built to provide objective proof of integrity in an era of boilerplate and AI-assisted code. Know if your project is truly original.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors