Skip to content

Open-Sourced-Olaf/Code-Kindle

Repository files navigation

Code Kindle
code

A ReactJS webapp to convert source code into pseudocode using SMT( Statistical Machine Translation)

Use Code Kindle

What is SMT? · Live . Report Bug · Request Feature

About The Project

An aid to learning which helps to visualize source code into pseudocode using SMT
You can use it live here: Code Kindle

Usage Guidelines

  • The converter page contains two editors, one for writing the source code that you want to convert and the other one which will display the pseudocode after the conversion.
  • You can also upload the file to be converted by firstly choosing the language from the dropdown menu and then browsing the file and uploading it.
  • The file that you chose will also be displayed in the text editor.
  • Now, just click on the convert button, it will run the docker container based compiler in the background.

Built With

Project Architecture

  • backend folder contains the code for the Django based API to upload the files into the projects directory.
  • code_converter folder contains the frontend code deployed on DFINITY.
  • cpp-pseudogen folder contains the translator code for cpp/c languages.
  • frontend folder contains the UI of the entire webapp.
  • python-scripts folder contains the translator for python source code.

Getting Started as Contributor

To get a local copy up and running follow these simple steps.

Prerequisites

This is an example of how to list things you need to use the software and how to install them.

  • npm
npm install npm@latest -g

Installation

  1. Clone the repo
git clone https://github.com/Open-Sourced-Olaf/Code-Kindle.git
  1. Install NPM packages
npm install
  1. Run Locally
npm run start

Roadmap

  • Add support to more languages
  • Convert one language code into other like cpp code to php and so on.
  • Improving the algorithm of the translator to include complex cases like multiple functional calls inside the main.
  • See the open issues for a list of proposed features (and known issues).

Local Dev Setup

  • To translate the cpp/c codes,move to the cpp-pseudogen folder upload a file named "prog.cpp" and then compile the main.cpp using the command g++ main.cpp -o main after that execute ./main, it will display the output in the terminal as well as create a output.text file.
  • To translate the python code, move to the python-scripts folder, upload a file named hello.py, then compile the generatePseudo.py file using the python3 generatePseudo.py, it will produce hello-pseudo file in the working directory.
  • to run the frontend code, move to the frontend directory and run npm i followed by npm start.
  • to deploy and run the code on DFINITY, run dfx start --background to start the server in the background, then run dfx deploy, it will produce a code_converter_assets canister id, copy that.
  • then open dfx.json and find the ip address, now the url of the web app will be http://127.0.0.1:8000/?canisterId=[canister-id].
  • to deploy, run dfx ping ic, dfx deploy --network=ic.
  • the deployed url will be https://[ your canisterId here ].ic0.app/

https://gb33l-zyaaa-aaaab-aagyq-cai.ic0.app/

How to contribute.

  • Fork and clone the repository.
  • create a branch
  • make changes in that branch
  • add and commit your changes
  • then push the changes into your branch
  • now you can create a PR using that branch in our repository.
  • 🎉 you have successfully contributed to this project.

Useful links

🌟 Contributors

Admins

Important decisions regarding the project are taken by the following maintainer.

Anjali Deepak Prashi Bushra Yvon Manzi
@anjalisoni3655 @DebugAgrawal @prashi23 @codingbug671 @yvonmanzi

Deployment and Resources

About

Source code to pseudocode generator using Statistical machine learning techniques for C/C++ and python3.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published