Skip to content

Legacy.Ai-An intelligent code review web app powered by Google’s Gemini-2.0-flash model. It analyzes your code, detects potential issues, and provides smart, AI-driven suggestions to improve quality, readability, and performance — helping developers write cleaner, more efficient code effortlessly.

Notifications You must be signed in to change notification settings

ADI-2707/Legacy.Ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Legacy.Ai

Legacy.Ai is a small example project that demonstrates using a backend Express API to call a Gemini generative model for automated code review, with a lightweight React + Vite frontend to submit code and display the review.

This repository has two main pieces:

  • BackEnd/: Node.js + Express server that wraps the Gemini generative model and exposes an API endpoint.
  • FrontEnd/: React (Vite) app that provides a code editor and displays the model's review.

Quick architecture

  • FrontEnd (Vite + React) sends POST requests to the BackEnd endpoint /ai/get-review with a JSON body { code: string }.
  • BackEnd forwards the prompt to the Gemini generative model via @google/generative-ai and returns the model's text response to the FrontEnd.

What it's useful for

  • Prototyping automated code review features.

Running locally

Prerequisites:

  • Node.js (16+ recommended)
  • npm
  • A Gemini API key (set as GEMINI_API_KEY in the environment)
  1. BackEnd
cd BackEnd
npm install
# Set the GEMINI_API_KEY for the current PowerShell session
$env:GEMINI_API_KEY = "your_gemini_api_key_here"
# Start the backend (server listens on port 3000)
node server.js

Notes:

  • The Gemini API key is read from process.env.GEMINI_API_KEY.
  1. FrontEnd
cd FrontEnd
npm install
npm run dev
  • The FrontEnd uses Vite. By default it will run on http://localhost:5173 (or another free port).
  • The app posts to http://localhost:3000/ai/get-review in development. If you change backend port, update the frontend request URL in FrontEnd/src/App.jsx.

Environment variables

  • GEMINI_API_KEY — API key for Google Gemini/Generative AI. Required by the backend.

Troubleshooting

  • If the frontend cannot reach the backend, ensure the backend is running on port 3000 and that CORS is enabled (the backend already uses cors() in src/app.js).
  • If the model call fails, check that GEMINI_API_KEY is set and valid.

Connect with me

About

Legacy.Ai-An intelligent code review web app powered by Google’s Gemini-2.0-flash model. It analyzes your code, detects potential issues, and provides smart, AI-driven suggestions to improve quality, readability, and performance — helping developers write cleaner, more efficient code effortlessly.

Topics

Resources

Stars

Watchers

Forks