Skip to content

AimanK/time_complexity_analyzer_frontend

Repository files navigation


Time Complexity Analyzer Frontend

Welcome to the Time Complexity Analyzer Frontend! This application allows users to input code snippets in various modern programming languages and receive an analysis of the worst-case algorithmic time complexity. The results are visually represented on the frontend using line graphs powered by D3.

Table of Contents

Features

  • Input code snippets in various modern programming languages.
  • Analyze the worst-case algorithmic time complexity of the code.
  • Visual representation of the time complexity using line graphs.
  • Responsive and user-friendly UI.

Tech Stack

Frontend

  • React: JavaScript library for building user interfaces.
  • D3.js: JavaScript library for producing dynamic, interactive data visualizations.
  • Tailwind CSS: Utility-first CSS framework for styling.
  • Axios.js: Promise-based HTTP client for making requests to the backend.

Backend

  • Actix Web: Powerful, pragmatic, and extremely fast web framework for Rust.
  • Rust: Programming language for system-level performance.
  • ChatGPT API: For analyzing code snippets and determining their time complexity.

Installation

Prerequisites

  • Node.js (for running the frontend)
  • Rust (for running the backend)
  • Cargo (Rust package manager)
  • npm or yarn (JavaScript package manager)

Frontend Setup

  1. Clone the repository:

    git clone https://github.com/AimanK/time_complexity_analyzer_frontend.git
    cd time_complexity_analyzer_frontend
  2. Navigate to the frontend directory and install dependencies:

    cd time_complexity_analyzer_frontend
    npm install
    # or
    yarn install
  3. Start the React development server:

    npm start
    # or
    yarn start

Usage

  1. Start both the frontend and backend servers as described in the installation steps.
  2. Open your web browser and navigate to http://localhost:3000 to access the frontend.
  3. Input your code snippet into the provided text box and click the "Analyze" button.
  4. View the results of the worst-case algorithmic time complexity analysis in graphical form.

API Integration

To analyze the code snippets, the backend communicates with the ChatGPT API. Ensure you have an API key from OpenAI and set it up in your backend configuration.

  1. Obtain your API key from OpenAI.
  2. Add your API key to the backend configuration (e.g., as an environment variable).

Example configuration:

export OPENAI_API_KEY='your-api-key'

Contributing

We welcome contributions to improve the Code Complexity Analyzer! To contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes.
  4. Commit your changes (git commit -am 'Add new feature').
  5. Push to the branch (git push origin feature-branch).
  6. Create a new Pull Request.

Please ensure your code follows the project's coding standards and includes appropriate tests.

License

This project is licensed under the MIT License - see the LICENSE file for details.


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published