/Code-Translator-AI

This application leverages cutting-edge technologies to translate code between various programming languages. Below, you'll find a guide on setting up the development environment and running the application locally.

Primary LanguageJavaScript

AI Code Translator

This application leverages cutting-edge technologies to translate code between various programming languages. Below, you'll find a guide on setting up the development environment and running the application locally.

image

Getting Started

Setting Up Your Development Environment

Before diving into building the code translator, you've set up your development environment:

  1. Installed Node.js to get your system ready for coding.
  2. Set up a Node.js application.
  3. Wrote code that utilizes the OpenAI API for text generation.
  4. Gained an understanding of training the model using prompts.

Front-End Development

With your environment ready, you started building the front-end of our application:

  1. Creating the UI: You've crafted a user-friendly interface, including a code editor, language selector, scroll-down bar, and a code window for writing and editing code.
  2. Populating Languages: You've curated a list of programming languages to populate the dropdown menu.
  3. Home Page Creation: You've developed a welcoming home page using Next.js, making your application accessible to users.

Back-End Development

After the front-end, you delved into prompt engineering and back-end development:

  1. Prompt Engineering: You've mastered the art of crafting prompts that instruct the AI model effectively.
  2. Model Training: You've learned how to train the model to provide accurate and useful code translations.
  3. Building the Back-End: You've written the back-end code to handle requests and responses.

Running Your Application

Now that you've completed building your application, you're ready to run it and start experimenting. Your code translation bot is ready to assist you with various programming tasks in your daily life.

Setting Up Your Development Environment

  1. Node.js Installation: Ensure you have Node.js installed on your system.

  2. Frontend Setup:

    • Navigate to the client directory: cd client
    • Install dependencies: npm install
    • Start the development server: npm run dev
    • Your frontend will be available at http://localhost:3000.
  3. Backend Setup:

    • Go back to the project root: cd ../server
    • Install backend dependencies: npm install
    • Start the backend server: npm start
    • The backend will be running at http://localhost:3001.

Technologies Used

  • Node.js: The backend of the application is built with Node.js.

  • React: The frontend is developed using React for creating a dynamic user interface.

  • Next.js: Next.js is used for server-side rendering and routing.

  • Tailwind CSS: Tailwind CSS is employed for styling and creating a responsive design.

  • OpenAI API: The OpenAI API powers the code translation functionality.

  • AWS Amplify: Hosting static site (Frontend/Client Deployement).

    Usage

Frontend

After setting up and running both the frontend and backend, open your web browser and access the application at http://localhost:3000.

  1. User Interface: You'll find a user-friendly interface with a code editor, language selector, and code window.

  2. Language Selection: Choose the target programming language from the dropdown menu.

  3. Code Translation: Write or paste your code in the code editor and click the translation button to convert it to the selected language.

Backend

The backend handles requests and responses, enabling the translation functionality. You don't need to interact with the backend directly during normal usage.

Daily Life Use

This AI-powered code translator can simplify your programming tasks:

  • Learning New Languages: Use the translator to generate code in a new programming language to expand your skills.

  • Code Conversion: Easily convert code snippets from one language to another, saving time and effort.

Conclusion

Congratulations on mastering the Code Translator AI project. This tool is a valuable addition to your toolkit, making code translation a breeze. Happy coding! 🚀