A small web app that analyzes source code and estimates how likely it is to be AI-generated. The app visualizes an "AI percentage" in a circular chart and streams human-readable analysis results as they are generated.
This repo contains the frontend (Vite + React) and utilities for interacting with a backend analysis service.
Key features
- AI-percentage visual (circular chart)
- Streaming analysis output (progressive text like ChatGPT)
- Simple code editor input and history sidebar
- Open the frontend in your browser (after starting the dev server).
- Paste or type code into the editor.
- The AI-percentage and streaming analysis update in real time.
index.html— app entry HTMLpackage.json— frontend project manifestsrc/— main frontend sourceApp.jsx,main.jsx— entry & bootindex.css— stylescomponents/— UI components (Editor, Header, Sidebar, Report, etc.)utils/analysis.js— client-side helpers for analysis streamingutils/pdfGenerator.js— export report helpers
This project uses npm and Vite for the frontend. From the repo root:
# install dependencies
npm install
# run the dev server (Vite)
npm run devOpen the URL that Vite prints (usually http://localhost:5173). The UI will load and you can paste code into the editor.
This repo assumes a separate backend analysis service (Node/Express) that exposes an API endpoint the frontend calls to run code analysis and stream results. The original README mentioned script.js pointing to a Render backend URL — update the API base URL in the frontend if your backend runs at a different host.
If you have the backend source and want to run it locally, typical commands are:
# from the backend directory (if separate)
npm install
node index.jsThen update the frontend API URL (where the frontend sends code for analysis) to point to http://localhost:<PORT>.
- API endpoint: ensure the frontend points to your analysis backend. Look for the file that contains the backend URL (example:
src/utils/analysis.jsor ascript.jsreferenced inindex.html) and update it. - Environment: if the backend requires API keys or ENV values, provide them locally per the backend README (not included here).
To build the frontend for production:
npm run buildYou can then host the generated dist/ with any static host (Vercel, Netlify, GitHub Pages, etc.). If you deploy the frontend, update the deployed frontend's backend URL to the production backend endpoint.
.
├─ index.html
├─ package.json
├─ src/
│ ├─ App.jsx
│ ├─ main.jsx
│ ├─ index.css
│ ├─ components/
│ │ ├─ CodeEditor.jsx
│ │ ├─ AnalysisReport.jsx
│ │ ├─ HistorySidebar.jsx
│ │ └─ ...
│ └─ utils/
│ ├─ analysis.js
│ └─ pdfGenerator.js
- Fork the repository and create a feature branch.
- Open a pull request with a clear description of the change.
Small, safe improvements I recommend:
- Add instructions or environment templates for the backend if you include it in the repo.
- Add tests for
utils/analysis.js(unit tests for parsing/formatting streaming messages).
- If the analysis stream doesn't start, verify the frontend's API URL and that the backend is running and accessible.
- Open the browser console / network tab to inspect requests and SSE/Fetch streaming responses.