Skip to content

asuwest1/ServerTracking

Repository files navigation

AI Application Generator

A powerful web application that uses multiple AI models to generate and review code. This application leverages ChatGPT-5 for code generation, and uses both Claude Sonnet 4.5 and Gemini 2.5 for comprehensive code reviews.

Features

  • AI-Powered Code Generation: Describe your application requirements and let ChatGPT generate the complete code
  • Multi-Model Code Review: Get code reviews from both Claude Sonnet 4.5 and Gemini 2.5
  • Intelligent Evaluation: ChatGPT evaluates the reviews and provides recommendations for improvements
  • Modern UI: Clean, responsive interface with real-time feedback
  • Comprehensive Workflow: Seamlessly orchestrates multiple AI models for optimal results

Architecture

Frontend

  • React 18: Modern React application with hooks
  • Responsive Design: Works on desktop and mobile devices
  • Real-time Updates: Live feedback during code generation and review

Backend

  • Node.js/Express: RESTful API server
  • Multi-AI Integration:
    • OpenAI GPT-4 Turbo (preparing for GPT-5)
    • Anthropic Claude Sonnet 4.5
    • Google Gemini 2.5
  • Parallel Processing: Reviews run simultaneously for faster results

Prerequisites

  • Node.js 16.x or higher
  • npm or yarn
  • API keys for:
    • OpenAI (ChatGPT)
    • Anthropic (Claude)
    • Google (Gemini)

Installation

1. Clone the repository

git clone <repository-url>
cd ServerTracking

2. Install dependencies

# Install backend dependencies
npm install

# Install frontend dependencies
cd client
npm install
cd ..

3. Configure environment variables

Create a .env file in the root directory:

cp .env.example .env

Edit .env and add your API keys:

# API Keys for AI Models
OPENAI_API_KEY=your_openai_api_key_here
ANTHROPIC_API_KEY=your_anthropic_api_key_here
GOOGLE_API_KEY=your_google_api_key_here

# Server Configuration
PORT=3001
NODE_ENV=development

4. Get API Keys

OpenAI API Key

  1. Visit https://platform.openai.com/api-keys
  2. Sign in or create an account
  3. Click "Create new secret key"
  4. Copy the key and add to .env

Anthropic API Key

  1. Visit https://console.anthropic.com/
  2. Sign in or create an account
  3. Navigate to API Keys section
  4. Create a new key and add to .env

Google Gemini API Key

  1. Visit https://makersuite.google.com/app/apikey
  2. Sign in with your Google account
  3. Create an API key
  4. Copy and add to .env

Running the Application

Development Mode

Run both frontend and backend concurrently:

npm run dev

Or run them separately:

# Terminal 1 - Backend
npm run server

# Terminal 2 - Frontend
npm run client

Production Mode

# Build the frontend
npm run build

# Start the server
npm start

The application will be available at:

Usage

1. Generate Application

  1. Enter your application requirements in the text area
  2. Click "Generate Application"
  3. Wait for ChatGPT to generate the code
  4. View the generated code in the output section

2. Code Review

  1. After generating code, click the "Code Review" button in the header
  2. The system will:
    • Send the code to Claude Sonnet 4.5 for review
    • Send the code to Gemini 2.5 for review (runs in parallel)
    • Send both reviews to ChatGPT for evaluation
  3. View individual reviews from Claude and Gemini
  4. Read ChatGPT's evaluation and recommendations

API Endpoints

POST /api/generate

Generate application code from requirements.

Request:

{
  "requirements": "Create a todo list application with..."
}

Response:

{
  "success": true,
  "generatedCode": "...",
  "model": "gpt-4-turbo-preview",
  "usage": {...}
}

POST /api/review

Review code using Claude and Gemini, then evaluate with ChatGPT.

Request:

{
  "code": "function example() {...}"
}

Response:

{
  "success": true,
  "reviews": {
    "claude": {...},
    "gemini": {...}
  },
  "evaluation": "..."
}

POST /api/generate-and-review

Complete workflow: generate, review, and evaluate in one request.

Request:

{
  "requirements": "Create a todo list application..."
}

Project Structure

ServerTracking/
├── client/                  # React frontend
│   ├── public/
│   ├── src/
│   │   ├── components/
│   │   ├── services/
│   │   │   └── api.js      # API client
│   │   ├── App.js          # Main component
│   │   ├── App.css         # Styles
│   │   └── index.js        # Entry point
│   └── package.json
├── server/                  # Express backend
│   ├── controllers/
│   │   └── appController.js
│   ├── routes/
│   │   └── appRoutes.js
│   ├── services/
│   │   ├── openaiService.js
│   │   ├── claudeService.js
│   │   └── geminiService.js
│   └── index.js            # Server entry point
├── .env.example            # Environment template
├── .gitignore
├── package.json
└── README.md

How It Works

Workflow

  1. User Input: User describes desired application features
  2. Code Generation: ChatGPT generates complete application code
  3. Code Review:
    • Claude Sonnet 4.5 analyzes code for quality, bugs, and best practices
    • Gemini 2.5 provides additional review (runs in parallel)
  4. Evaluation: ChatGPT evaluates both reviews and determines:
    • Which suggestions are valid
    • Which improvements should be incorporated
    • Provides refined recommendations

Multi-Model Benefits

  • Diverse Perspectives: Different AI models catch different issues
  • Comprehensive Review: Multiple viewpoints ensure thorough analysis
  • Quality Assurance: ChatGPT validates and consolidates feedback
  • Best Practices: Combined expertise from three leading AI models

Troubleshooting

API Key Issues

  • Ensure all API keys are correctly set in .env
  • Check that keys have sufficient credits/quota
  • Verify keys are not expired

Port Conflicts

  • If port 3000 or 3001 is in use, update in .env and client/package.json

CORS Errors

  • Ensure backend is running on the correct port
  • Check proxy configuration in client/package.json

Security Notes

  • Never commit .env file to version control
  • Keep API keys secure and private
  • Use environment variables for all sensitive data
  • Consider implementing rate limiting for production use

Future Enhancements

  • Save generated applications to files
  • Export code in different formats
  • User authentication and project management
  • Version history for generated code
  • Direct code editing with real-time review
  • Support for additional AI models
  • Automated testing generation

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

MIT License - see LICENSE file for details

Support

For issues or questions:

  • Open an issue on GitHub
  • Check existing documentation
  • Review API provider documentation

Built with ChatGPT, Claude Sonnet 4.5, and Gemini 2.5

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published