Skip to content

Commit f15bad2

Browse files
committed
Add documentations (Close algorithm-visualizer#233)
1 parent 6e8be4d commit f15bad2

File tree

4 files changed

+222
-5
lines changed

4 files changed

+222
-5
lines changed

CODE_OF_CONDUCT.md

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [email protected]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

CONTRIBUTING.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Contributing
2+
3+
> #### Table of Contents
4+
> - [Running Locally](#running-locally)
5+
> - [Creating a Pull Request](#creating-a-pull-request)
6+
7+
## Running Locally
8+
9+
1. Fork the main repo.
10+
11+
2. Clone your forked repo to your machine.
12+
13+
```bash
14+
git clone https://github.com/<your-username>/algorithm-visualizer.git
15+
```
16+
17+
3. Install [Docker](https://docs.docker.com/install/), if not already installed.
18+
19+
4. Install dependencies, and run the server.
20+
21+
```bash
22+
cd algorithm-visualizer
23+
24+
npm install
25+
26+
npm run dev
27+
```
28+
29+
5. Open [`http://localhost:8080/`](http://localhost:8080/) in a web browser.
30+
31+
## Creating a Pull Request
32+
33+
6. Create a branch addressing the issue/improvement you'd like to tackle.
34+
35+
```bash
36+
git checkout -b my-problem-fixer-branch
37+
```
38+
39+
7. Write some awesome code.
40+
41+
8. Commit the changes, and push them to `my-problem-fixer-branch` branch on your forked repo.
42+
43+
```bash
44+
git add .
45+
46+
git commit -m "Explain my awesome changes"
47+
48+
git push origin my-problem-fixer-branch
49+
```
50+
51+
9. Create a pull request from `my-problem-fixer-branch` branch on your forked repo to `master` branch on the main repo.

PROJECT_DETAILS.md

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Project Details
2+
3+
> #### Table of Contents
4+
> - [Project Structure](#project-structure)
5+
> - [Directory Structures](#directory-structures)
6+
> - [algorithms](#algorithms)
7+
> - [tracers](#tracers)
8+
> - [algorithm-visualizer](#algorithm-visualizer)
9+
10+
## Project Structure
11+
12+
The project [algorithm-visualizer](https://github.com/algorithm-visualizer) consists of the following 3 repos.
13+
14+
- [algorithms](https://github.com/algorithm-visualizer/algorithms) contains public algorithms shown on the sidebar.
15+
16+
- [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.
17+
18+
- [algorithm-visualizer](https://github.com/algorithm-visualizer/algorithm-visualizer) contains the frontend server written in React and the backend server written in Node.
19+
20+
## Directory Structures
21+
22+
### algorithms
23+
24+
- **Category A/** is the name of the category.
25+
- **Algorithm A/** is the name of the algorithm.
26+
- **code.cpp** is the implementation of the algorithm in C++.
27+
- **code.java** is the implementation of the algorithm in Java.
28+
- **code.js** is the implementation of the algorithm in ECMAScript.
29+
- **README.md** is the description of the algorithm.
30+
- **Algorithm B/**
31+
- **Algorithm C/**
32+
- ...
33+
- **Category B/**
34+
- **Category C/**
35+
- ...
36+
37+
### tracers
38+
39+
- **bin/** is where executables are written to.
40+
- **docs/** is where library documentations are written to.
41+
- **src/** contains source codes.
42+
- **common/** contains commonly used files.
43+
- **executables/** contains the source codes of executables.
44+
- **languages/** builds visualization libraries and defines how to execute users' codes for ...
45+
- **cpp/** ... C++.
46+
- **builder/** builds a visualization library based on the specifications.
47+
- **skeleton/** provides the skeleton of the visualization library.
48+
- **executor/** defines how to execute users' codes.
49+
- **java/** ... Java.
50+
- **js/** ... ECMAScript.
51+
- **specs/** defines the specifications.
52+
- **randomizers/** contains the specifications of randomizers.
53+
- **tracers/** contains the specifications of tracers.
54+
55+
**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.
56+
57+
### algorithm-visualizer
58+
59+
- **app/** wraps the backend and frontend servers.
60+
- **bin/** contains executables.
61+
- **branding/** contains representative image files.
62+
- **build/** is where compiled files are written to.
63+
- **backend/** contains the compiled backend server.
64+
- **frontend/** contains the compiled frontend server.
65+
- **src/** contains source codes.
66+
- **backend/** contains the source code of the backend server.
67+
- **apis/** defines outgoing API requests.
68+
- **common/** contains commonly used files.
69+
- **controllers/** routes and processes incoming requests.
70+
- **public/** is where the backend server writes to.
71+
- **algorithms/** is cloned [`algorithms`](https://github.com/algorithm-visualizer/algorithms) repo.
72+
- **codes/** is where users' codes are uploaded to
73+
- **tracers/** is cloned [`tracers`](https://github.com/algorithm-visualizer/tracers) repo.
74+
- **frontend/** contains the source code of the frontend server.
75+
- **apis/** defines outgoing API requests.
76+
- **common/** contains commonly used files.
77+
- **components/** defines React components.
78+
- **core/** is in charge of visualization.
79+
- **datas/** manages visualization data.
80+
- **renderers/** renders visualization data.
81+
- **reducers/** contains Redux reducers.
82+
- **skeletons/** contains skeleton files to be shown in the code editor.
83+
- **static/** contains static files to be served.

README.md

+12-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Algorithm Visualizer
2+
23
> Algorithm Visualizer is an interactive online platform that visualizes algorithms from code.
34
45
[![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
1112

1213
## Contributing
1314

14-
The project [algorithm-visualizer](https://github.com/algorithm-visualizer) is composed of the following 3 repositories.
15+
**I want to add or improve an algorithm.**
16+
17+
- 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.
18+
19+
**I want to improve the UI.**
20+
21+
- 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.
1522

16-
* [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)
23+
**I want to enhance visualization libraries.**
1724

18-
* [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)
25+
- 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.
1926

20-
* [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)
27+
**I have a question in regards to contributing.**
2128

22-
Take a moment to read `CONTRIBUTING.md` in the repository you want to contribute to.
29+
- Raising an issue is another way of contributing!

0 commit comments

Comments
 (0)