Skip to content

Commit 8495a59

Browse files
authored
Development documentation (processing#705)
* delete unused files, move webpack configs to their own directory * start of improved developer documentation, moving everything to developer_docs/ directory * documentation updates
1 parent 7ac6dd0 commit 8495a59

28 files changed

+257
-337
lines changed

.env.example

-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
API_URL=/api
22
MONGO_URL=mongodb://localhost:27017/p5js-web-editor
3-
MONGO_HOSTNAME=localhost
4-
MONGO_PORT=27017
5-
MONGO_NAME=p5js-web-editor
6-
MONGO_ROOT_USERNAME=processing_user
7-
MONGO_ROOT_PASSWORD=<change-this-to-a-secure-password>
83
PORT=8000
94
SESSION_SECRET=whatever_you_want_this_to_be_it_only_matters_for_production
105
AWS_ACCESS_KEY=<your-aws-access-key>

.eslintignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
webpack.config.js
1+
webpack/*
22
index.js

.github/CONTRIBUTING.md

+2-31
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
# Contributing to the p5.js web editor
1+
# Contributing to the p5.js Web Editor
22

3-
Hello! We welcome community contributions to the p5.js web editor. Contributing takes many forms and doesn't have to be **writing code**, it can be **documenting bugs**, **proposing new features**, and **updating documentation**. We would also like to Thank you for choosing to contribute p5.js web editor, any way possible. You are awesome! :blush:
4-
5-
This **web editor** for **p5.js**, a JavaScript library with the goal of making coding accessible to **artists**, **designers**, **educators**, and **beginners**, is an environment to make p5.js sketches without needing to download any software or do any configuration, which makes it a great place to start learning how to code and start learning p5.js.
3+
Hello! We welcome community contributions to the p5.js Web Editor. Contributing takes many forms and doesn't have to be **writing code**, it can be **report bugs**, **proposing new features**, **creating UI/UX designs**, and **updating documentation**.
64

75
Here are links to all the sections in this document:
86

97
<!-- If you change any of the headings in this document, remember to update the table of contents. -->
108

119
- [Code of Conduct](#code-of-conduct)
12-
- [Technologies Used](#technologies-used)
13-
- [Development Installation](#development-installation)
14-
- [New Design](#new-design)
1510
- [How Can I Contribute ?](#how-can-i-contribute?)
1611
- [First Timers](#first-timers)
1712
- [Want something more challenging](#want-something-more-challenging)
@@ -23,30 +18,6 @@ Here are links to all the sections in this document:
2318

2419
Please follow the guidelines mentioned at [CODE OF CONDUCT.md](https://github.com/processing/p5.js-web-editor/blob/master/CODE_OF_CONDUCT.md#p5js-code-of-conduct).
2520

26-
# Technologies Used
27-
28-
> **MERN stack - MongoDB, Express, React/Redux, and Node**.
29-
30-
- For a reference to the **file structure format** I am using, please look at the [Mern Starter](https://github.com/Hashnode/mern-starter).
31-
32-
- This project **does not use CSS Modules, but uses Sass**. [BEM guidelines and naming conventions](http://getbem.com/) are followed.
33-
34-
- For repeatitive and common styles, write OOSCSS (Object-Oriented SCSS) with placeholders and mixins. For organizing styles, follow the 7-1 Pattern for Sass.
35-
36-
- We're using [ES6](http://es6-features.org/) and transpiling to ES5 using [Babel](https://babeljs.io/).
37-
38-
- For reference to the JavaScript style guide, see the [Airbnb Style Guide](https://github.com/airbnb/javascript), [React ESLint Plugin](https://github.com/yannickcr/eslint-plugin-react).
39-
40-
- The ESLint configuration is based on a few popular React/Redux boilerplates. Open to suggestions on this. If in development, **you're getting annoyed with ESLint**, you can **remove** it from `webpack.config.dev.js` in the JavaScript loader, or disable any line from eslint by commenting at the end of the line `// eslint-disable-line`.
41-
42-
# Development Installation
43-
44-
To get started on a patch, first read the instruction from [README.md](https://github.com/processing/p5.js-web-editor#development-installation).
45-
46-
# New Design
47-
48-
Design proposed and theme changes are present at: [Zeplin](https://scene.zeplin.io/project/55f746c54a02e1e50e0632c3).
49-
5021
# How Can I Contribute?
5122

5223
### First Timers

Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ ENV NODE_ENV development
1010
COPY package.json package-lock.json ./
1111
RUN npm install
1212
RUN npm rebuild node-sass
13-
COPY .babelrc index.js nodemon.json webpack.config.babel.js webpack.config.dev.js webpack.config.prod.js webpack.config.server.js webpack.config.examples.js ./
13+
COPY .babelrc index.js nodemon.json ./
14+
COPY ./webpack ./webpack
1415
COPY client ./client
1516
COPY server ./server
1617
CMD ["npm", "start"]

Dockerfile-development

-20
This file was deleted.

README.md

+13-117
Original file line numberDiff line numberDiff line change
@@ -1,127 +1,23 @@
1-
# p5.js Web Editor
1+
# [p5.js Web Editor](https://editor.p5js.org)
22

3-
This project is currently in development! It will be announced when there is a (public) beta release.
3+
The p5.js Web Editor is an in-browser code editor for creating [p5.js](https://p5js.org/) sketches. p5.js, which is a separate project, is a JavaScript library with the goal of making coding accessible for artists, designers, educators, and beginners, and the web editor shares this same spirit. It is designed with the benginner in mind—when using the web editor, you don't need to download or configure anything, you can simply open the website, and start writing code. You can also host their work online and share it with others.
44

5-
## Development Installation
5+
The p5.js Web Editor is currently in active development, and looking for contributions of any type! Please check out the [contribution guide](https://github.com/processing/p5.js-web-editor/blob/master/.github/CONTRIBUTING.md) for more details.
66

7-
1. Fork this repository.
8-
2. Clone the forked repository and cd into it
9-
3. `$ npm install`
10-
4. Install MongoDB and make sure it is running
11-
* For Mac OSX with [homebrew](http://brew.sh/): `brew install mongodb` then `brew services start mongodb`
12-
* For Windows and Linux: [MongoDB Installation](https://docs.mongodb.com/manual/installation/)
13-
5. `$ cp .env.example .env`
14-
6. (Optional) Update `.env` with necessary keys to enable certain app behavoirs, i.e. add Github ID and Github Secret if you want to be able to log in with Github.
15-
7. `$ npm run fetch-examples` - this downloads the example sketches into a user called 'p5'
16-
8. `$ npm start`
17-
9. Navigate to [http://localhost:8000](http://localhost:8000) in your browser
18-
10. Install the [React Developer Tools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en)
19-
11. Open and close the Redux DevTools using `ctrl+h`, and move them with `ctrl+w`
7+
If you have found a bug in the p5.js Web Editor, you can file it under the ["issues" tab](https://github.com/processing/p5.js-web-editor/issues).
208

21-
### Testing SSL on your local machine
22-
Please refer to [this gist](https://gist.github.com/andrewn/953ffd5cb17ac2634dc969fc7bdaff3f). This allows you to access the editor using both HTTP and HTTPS. Don't worry about this unless you need to make changes or test HTTPS behavior.
9+
## Issues
2310

24-
The automatic redirection to HTTPS is turned off by default in development. If you need to test this behavior, put `FORCE_TO_HTTPS=true` in your `.env` file.
11+
Please post bugs and feature requests in the correct repository:
2512

26-
## Development Installation using Docker
13+
* p5.js general and p5.dom: [https://github.com/processing/p5.js/issues](https://github.com/processing/p5.js/issues)
14+
* p5.accessibility: [https://github.com/processing/p5.accessibility/issues](https://github.com/processing/p5.accessibility/issues)
15+
* p5.sound: [https://github.com/processing/p5.js-sound/issues](https://github.com/processing/p5.js-sound/issues)
16+
* p5.js website: [https://github.com/processing/p5.js-website/issues](https://github.com/processing/p5.js-website/issues)
2717

28-
Using Docker, you can have a complete, consistent development environment without having to manually install dependencies such as Node, Mongo, etc. It also helps isolate these dependencies and their data from other projects that you may have on the same computer that use different/conflicting versions, etc.
18+
## Get Involved
2919

30-
Note that this takes up a significant amount of space on your machine. Make sure you have at least 5GB free.
20+
The p5.js Web Editor is a collaborative project created by many individuals, and you are invited to help. All types of involvement are welcome. You can start with the [p5.js community section](https://p5js.org/community), which also applies to this project.
3121

32-
1. Install Docker for your operating system
33-
* Mac: https://www.docker.com/docker-mac
34-
* Windows: https://www.docker.com/docker-windows
35-
2. Clone this repository and cd into it
36-
3. `$ docker-compose -f docker-compose-development.yml build`
37-
4. `$ docker-compose -f docker-compose-development.yml run --rm app npm run fetch-examples`
22+
Developers, check the [developer docs](https://github.com/processing/p5.js-web-editor/blob/master/developer_docs/) details about contributing code, bug fixes, and documentation.
3823

39-
Now, anytime you wish to start the server with its dependencies, you can run:
40-
41-
5. `$ docker-compose -f docker-compose-development.yml up`
42-
6. Navigate to [http://localhost:8000](http://localhost:8000) in your browser
43-
44-
To open a terminal/shell in the running Docker server (i.e. after `docker-compose up` has been run):
45-
46-
7. `$ docker-compose -f docker-compose-development.yml exec app bash -l`
47-
48-
If you don't have the full server environment running, you can launch a one-off container instance (and have it automatically deleted after you're done using it):
49-
50-
8. `$ docker-compose -f docker-compose-development.yml run app --rm bash -l`
51-
52-
## Production Installation
53-
1. Clone this repository and `cd` into it
54-
2. `$ npm install`
55-
3. Install MongoDB and make sure it is running
56-
4. `$ cp .env.example .env`
57-
5. (NOT Optional) edit `.env` and fill in all necessart values.
58-
6. `$ npm run fetch-examples` - this downloads the example sketches into a user called 'p5'
59-
7. `$ npm run build`
60-
8. `$ npm run start:prod`
61-
62-
### For Production Setup with PM2
63-
1. `$ npm install -g pm2`
64-
2. `$ pm2 start ecosystem.json`
65-
66-
## S3 Bucket Configuration
67-
68-
Please refer to the folllowing [gist](https://gist.github.com/catarak/70c9301f0fd1ac2d6b58de03f61997e3) to set up an S3 bucket to be used with this project.
69-
70-
71-
If your S3 bucket is in the US East (N Virginia) region (us-east-1), you'll
72-
need to set a custom URL base for it, because it does not follow the standard
73-
naming pattern as the rest of the regions. Instead, add the following to your
74-
environment/.env file:
75-
76-
`S3_BUCKET_URL_BASE=https://s3.amazonaws.com`
77-
78-
If you've configured your S3 bucket and DNS records to use a custom domain
79-
name, you can also set it using this variable. I.e.:
80-
81-
`S3_BUCKET_URL_BASE=https://files.mydomain.com`
82-
83-
For more information on using a custom domain, see this documentation link:
84-
85-
http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html#VirtualHostingCustomURLs
86-
87-
## Accessibility Guidelines
88-
89-
Here is guide on [how to use the accessible editor](https://gist.github.com/MathuraMG/e86666b7b41fbc8c078bad9aff3f666d) and here is an overview of the [p5-accessibility.js](https://github.com/processing/p5.accessibility) library that makes p5.js sketches accessible to screen readers.
90-
91-
The code for the p5.js web editor adheres to web accessibility standards. The following guidelines will help to ensure that accessibility continues to be a priority as development continues.
92-
93-
**Code Structure**
94-
95-
* Screen Readers are an assistive technology for vision loss which helps users to navigate a web page. They are able to prioritize content based on the semantic meaning of HTML tags. Therefore, it is important to use specific tags, such as `nav`, `ul`, `li`, `section`, and so on. `div` is the least screen reader friendly tag. For example, [here is the semantic meaning of the `body` tag](http://html5doctor.com/element-index/#body)
96-
* All buttons/links/windows need to be accessible by the keyboard ( By tabbing, pressing space etc.)
97-
* In cases where tags are not screen reader friendly, we can take advantage of [tabIndex](http://webaim.org/techniques/keyboard/tabindex). Using tabIndex ensures that all elements are accessible via keyboard. [code example](https://github.com/processing/p5.js-web-editor/blob/master/client/modules/IDE/components/Editor.jsx#L249)
98-
* When opening a new window or pop up window, ensure the keyboard focus also moves to the new window. [code example](https://github.com/processing/p5.js-web-editor/blob/master/client/modules/IDE/components/NewFileForm.jsx#L16)
99-
100-
**Labeling**
101-
102-
* When creating button icons, images, or something without text (this does not include an HTML5 `<button>`), use [aria-labels](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute). [code example](https://github.com/processing/p5.js-web-editor/blob/master/client/modules/IDE/components/Toolbar.jsx#L67)
103-
* All `<table>`s need to have a `summary` attribute. This will ensure user is given context to what the table is. [code example](https://github.com/processing/p5.js-web-editor/blob/master/client/modules/IDE/components/SketchList.jsx#L39)
104-
* `ul`s and `nav`s menus need to include a title. [code example](https://github.com/processing/p5.js-web-editor/blob/master/client/components/Nav.jsx#L7)
105-
106-
For more information on accessibility see the [teach access tutorial](https://teachaccess.github.io/tutorial/)
107-
108-
## Contributing
109-
110-
See [CONTRIBUTING.md](https://github.com/processing/p5.js-web-editor/blob/master/contributing.md).
111-
112-
## Tooling and Style Overview
113-
114-
The p5.js Web Editor is built on a MERN stack - MongoDB, Express, React/Redux, and Node. For a reference to the file structure format I am using, please look at the [Mern Starter](https://github.com/Hashnode/mern-starter) and [this comment](https://github.com/Hashnode/mern-starter/issues/90#issuecomment-221553573).
115-
116-
This project uses an in-development [p5-accessibility.js library](https://github.com/processing/p5.accessibility) for accessibility.
117-
118-
This project does not use CSS Modules, but uses Sass. I like to follow [BEM rules](http://getbem.com/) for CSS naming conventions, write OOSCSS with placeholders and mixins, and follow the [7-1 Pattern](https://sass-guidelin.es/#the-7-1-pattern) for Sass.
119-
120-
I'm using [ES6](http://es6-features.org/) and transpiling to ES5 using [Babel](https://babeljs.io/). For reference to the JavaScript style guide, see the [Airbnb Style Guide](https://github.com/airbnb/javascript), [React ESLint Plugin](https://github.com/yannickcr/eslint-plugin-react).
121-
122-
The ESLint configuration is based on a few popular React/Redux boilerplates. Open to suggestions on this. If in development, you're getting annoyed with ESLint, you can remove it from `webpack.config.dev.js` in the JavaScript loader, or disable any line from eslint by commenting at the end of the line `// eslint-disable-line`.
123-
124-
## AWS information
125-
This project is currently hosted on an EC2 instance and uses S3 for media hosting.
126-
127-
Backups on the MongoDB are also hosted on an S3 bucket, based on the following [gist](https://gist.github.com/eladnava/96bd9771cd2e01fb4427230563991c8d). The backup script runs nightly via a cronjob at 8AM UTC/3AM EST/12AM PST. Backups are deleted after 30 days.

backup.sh

-57
This file was deleted.

developer_docs/README.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
This folder contains documents intended for developers of the p5.js Web Editor.
2+
3+
## List of Documents
4+
* [Installation](https://github.com/processing/p5.js-web-editor/blob/master/developer_docs/installation.md) - A guide for setting up your development environment
5+
* [Preparing a pull-request](https://github.com/processing/p5.js/blob/master/developer_docs/preparing_a_pull_request.md) - Instructions for how to make a pull-request
6+
* [Accessibility Guidelines](https://github.com/processing/p5.js-web-editor/blob/master/developer_docs/accessibility.md) - Guidelines for writing code to create an accessible application
7+
* [Deployment](https://github.com/processing/p5.js-web-editor/blob/master/developer_docs/deployment.md) - A guide to production deployment, and all platforms that are being used.
8+
9+
## Documents to Create
10+
* Design Principles - reference [p5.js design principles](https://github.com/processing/p5.js/edit/master/developer_docs/design_principles.md)
11+
* Issue Labels - reference [p5.js issue labels](https://github.com/processing/p5.js/blob/master/developer_docs/issue_labels.md)
12+
* File Structure - An explanation of the file structure of this application.

0 commit comments

Comments
 (0)