From f15bad25e2b4d49182b0956df5d719dae25f1ab7 Mon Sep 17 00:00:00 2001 From: Jason Park Date: Wed, 5 Dec 2018 17:44:28 -0500 Subject: [PATCH] Add documentations (Close #233) --- CODE_OF_CONDUCT.md | 76 ++++++++++++++++++++++++++++++++++++++++++ CONTRIBUTING.md | 51 ++++++++++++++++++++++++++++ PROJECT_DETAILS.md | 83 ++++++++++++++++++++++++++++++++++++++++++++++ README.md | 17 +++++++--- 4 files changed, 222 insertions(+), 5 deletions(-) create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md create mode 100644 PROJECT_DETAILS.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..9329120 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at parkjs814@gmail.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..46b679d --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,51 @@ +# Contributing + +> #### Table of Contents +> - [Running Locally](#running-locally) +> - [Creating a Pull Request](#creating-a-pull-request) + +## Running Locally + +1. Fork the main repo. + +2. Clone your forked repo to your machine. + + ```bash + git clone https://github.com//algorithm-visualizer.git + ``` + +3. Install [Docker](https://docs.docker.com/install/), if not already installed. + +4. Install dependencies, and run the server. + + ```bash + cd algorithm-visualizer + + npm install + + npm run dev + ``` + +5. Open [`http://localhost:8080/`](http://localhost:8080/) in a web browser. + +## Creating a Pull Request + +6. Create a branch addressing the issue/improvement you'd like to tackle. + + ```bash + git checkout -b my-problem-fixer-branch + ``` + +7. Write some awesome code. + +8. Commit the changes, and push them to `my-problem-fixer-branch` branch on your forked repo. + + ```bash + git add . + + git commit -m "Explain my awesome changes" + + git push origin my-problem-fixer-branch + ``` + +9. Create a pull request from `my-problem-fixer-branch` branch on your forked repo to `master` branch on the main repo. diff --git a/PROJECT_DETAILS.md b/PROJECT_DETAILS.md new file mode 100644 index 0000000..1dfc9fa --- /dev/null +++ b/PROJECT_DETAILS.md @@ -0,0 +1,83 @@ +# Project Details + +> #### Table of Contents +> - [Project Structure](#project-structure) +> - [Directory Structures](#directory-structures) +> - [algorithms](#algorithms) +> - [tracers](#tracers) +> - [algorithm-visualizer](#algorithm-visualizer) + +## Project Structure + +The project [algorithm-visualizer](https://github.com/algorithm-visualizer) consists of the following 3 repos. + +- [algorithms](https://github.com/algorithm-visualizer/algorithms) contains public algorithms shown on the sidebar. + +- [tracers](https://github.com/algorithm-visualizer/tracers) builds visualization libraries for each supported language based on the specifications, and executes users' codes to extract visualization data. + +- [algorithm-visualizer](https://github.com/algorithm-visualizer/algorithm-visualizer) contains the frontend server written in React and the backend server written in Node. + +## Directory Structures + +### algorithms + +- **Category A/** is the name of the category. + - **Algorithm A/** is the name of the algorithm. + - **code.cpp** is the implementation of the algorithm in C++. + - **code.java** is the implementation of the algorithm in Java. + - **code.js** is the implementation of the algorithm in ECMAScript. + - **README.md** is the description of the algorithm. + - **Algorithm B/** + - **Algorithm C/** + - ... +- **Category B/** +- **Category C/** +- ... + +### tracers + +- **bin/** is where executables are written to. +- **docs/** is where library documentations are written to. +- **src/** contains source codes. + - **common/** contains commonly used files. + - **executables/** contains the source codes of executables. + - **languages/** builds visualization libraries and defines how to execute users' codes for ... + - **cpp/** ... C++. + - **builder/** builds a visualization library based on the specifications. + - **skeleton/** provides the skeleton of the visualization library. + - **executor/** defines how to execute users' codes. + - **java/** ... Java. + - **js/** ... ECMAScript. + - **specs/** defines the specifications. + - **randomizers/** contains the specifications of randomizers. + - **tracers/** contains the specifications of tracers. + +**NOTE** that for ECMAScript, it builds a web worker rather than a visualization library. Once browsers fetch the web worker, they will submit users' codes to the web worker locally, instead of submitting to the remote backend server, to extract visualization data. It not only enables browsers to visualize ECMAScript codes quickly, but also significantly reduces the load on the backend server. + +### algorithm-visualizer + +- **app/** wraps the backend and frontend servers. +- **bin/** contains executables. +- **branding/** contains representative image files. +- **build/** is where compiled files are written to. + - **backend/** contains the compiled backend server. + - **frontend/** contains the compiled frontend server. +- **src/** contains source codes. + - **backend/** contains the source code of the backend server. + - **apis/** defines outgoing API requests. + - **common/** contains commonly used files. + - **controllers/** routes and processes incoming requests. + - **public/** is where the backend server writes to. + - **algorithms/** is cloned [`algorithms`](https://github.com/algorithm-visualizer/algorithms) repo. + - **codes/** is where users' codes are uploaded to + - **tracers/** is cloned [`tracers`](https://github.com/algorithm-visualizer/tracers) repo. + - **frontend/** contains the source code of the frontend server. + - **apis/** defines outgoing API requests. + - **common/** contains commonly used files. + - **components/** defines React components. + - **core/** is in charge of visualization. + - **datas/** manages visualization data. + - **renderers/** renders visualization data. + - **reducers/** contains Redux reducers. + - **skeletons/** contains skeleton files to be shown in the code editor. + - **static/** contains static files to be served. diff --git a/README.md b/README.md index 14c25cb..88387c9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Algorithm Visualizer + > Algorithm Visualizer is an interactive online platform that visualizes algorithms from code. [![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg?style=flat-square)](https://gitter.im/algorithm-visualizer) @@ -11,12 +12,18 @@ Learning algorithms from text and static images is quite boring. For that, there ## Contributing -The project [algorithm-visualizer](https://github.com/algorithm-visualizer) is composed of the following 3 repositories. +**I want to add or improve an algorithm.** -* [algorithm-visualizer/algorithms](https://github.com/algorithm-visualizer/algorithms): contains public algorithms shown on the sidebar. [Contribute](https://github.com/algorithm-visualizer/algorithms/blob/master/CONTRIBUTING.md) +- We have a separate repository for public algorithms. Check out the [contributing guidelines](https://github.com/algorithm-visualizer/algorithms/blob/master/CONTRIBUTING.md) in [`algorithms`](https://github.com/algorithm-visualizer/algorithms) repo. -* [algorithm-visualizer/tracers](https://github.com/algorithm-visualizer/tracers): contains visualization libraries written in each supported language. [Contribute](https://github.com/algorithm-visualizer/tracers/blob/master/CONTRIBUTING.md) +**I want to improve the UI.** -* [algorithm-visualizer/algorithm-visualizer](https://github.com/algorithm-visualizer/algorithm-visualizer): contains the front-end written in React.js and the back-end written in Node.js. [Contribute](https://github.com/algorithm-visualizer/algorithm-visualizer/blob/master/CONTRIBUTING.md) +- Check out the [contributing guidelines](https://github.com/algorithm-visualizer/algorithm-visualizer/blob/master/CONTRIBUTING.md) in this repo. The [directory structure](https://github.com/algorithm-visualizer/algorithm-visualizer/blob/master/PROJECT_DETAILS.md#algorithm-visualizer) might be helpful as well. -Take a moment to read `CONTRIBUTING.md` in the repository you want to contribute to. +**I want to enhance visualization libraries.** + +- It is highly recommended to read the entire [project details](https://github.com/algorithm-visualizer/algorithm-visualizer/blob/master/PROJECT_DETAILS.md) before working on it. Making changes to visualization libraries often requires quite a lot of work since you may need to work on all of 3 repositories: [`algorithms`](https://github.com/algorithm-visualizer/algorithms), [`tracers`](https://github.com/algorithm-visualizer/tracers), and [`algorithm-visualizer`](https://github.com/algorithm-visualizer/algorithm-visualizer). We encourage you to raise an issue about your idea of enhancement before working on it. + +**I have a question in regards to contributing.** + +- Raising an issue is another way of contributing!