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.
- 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.
- 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.
- 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.
- Node.js (for running the frontend)
- Rust (for running the backend)
- Cargo (Rust package manager)
- npm or yarn (JavaScript package manager)
-
Clone the repository:
git clone https://github.com/AimanK/time_complexity_analyzer_frontend.git cd time_complexity_analyzer_frontend
-
Navigate to the
frontend
directory and install dependencies:cd time_complexity_analyzer_frontend npm install # or yarn install
-
Start the React development server:
npm start # or yarn start
- Start both the frontend and backend servers as described in the installation steps.
- Open your web browser and navigate to
http://localhost:3000
to access the frontend. - Input your code snippet into the provided text box and click the "Analyze" button.
- View the results of the worst-case algorithmic time complexity analysis in graphical form.
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.
- Obtain your API key from OpenAI.
- Add your API key to the backend configuration (e.g., as an environment variable).
Example configuration:
export OPENAI_API_KEY='your-api-key'
We welcome contributions to improve the Code Complexity Analyzer! To contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.
Please ensure your code follows the project's coding standards and includes appropriate tests.
This project is licensed under the MIT License - see the LICENSE file for details.