04922522cc
Squashed commit of the following: commit fb5e82cea930b011792983c7d1cc9f6ecacc7dd4 Author: Cassie Tarakajian <ctarakajian@gmail.com> Date: Wed Nov 16 12:28:10 2016 -0500 add server side rendering, untested commit 5c60fb30c46ea49a8d9a0ecb56f39ec778464a8b Author: Cassie Tarakajian <ctarakajian@gmail.com> Date: Tue Nov 15 18:26:06 2016 -0500 add redux-form bandage post react update, should probably update to redux-form 6 at some point commit 057b5871e7137179abc93f7821a9690f0ea52c92 Author: Cassie Tarakajian <ctarakajian@gmail.com> Date: Tue Nov 15 16:30:09 2016 -0500 remove passing jsFiles and cssFiles to PreviewFrame, fix rendering bug commit 88c56fd36d3a8d88902c79642171988ce37825f2 Author: Cassie Tarakajian <ctarakajian@gmail.com> Date: Tue Nov 15 16:21:59 2016 -0500 code cleanup, untested commit 82e5dcf8bca461892f1daf06d38f1eaebe72983f Author: Cassie Tarakajian <ctarakajian@gmail.com> Date: Tue Nov 15 15:53:50 2016 -0500 update react and react router, fix a few bugs in rendering code, add ability to parse inline js and css commit e02f4b67803ea45328eff4e53659222f3149964c Author: Cassie Tarakajian <ctarakajian@gmail.com> Date: Tue Nov 15 14:43:38 2016 -0500 add almost full code to create preview html correctly, untested commit 12f61b2a1aed4607fab24d01572b647ca6210262 Author: Cassie Tarakajian <ctarakajian@gmail.com> Date: Wed Nov 2 17:09:26 2016 -0400 refactor some of the preview html generation code commit 111825846703d5c8959cb18795a3aadb7ebe505c Author: Cassie Tarakajian <ctarakajian@gmail.com> Date: Wed Nov 2 11:06:36 2016 -0400 add comments as plan of action commit 1cc2cf5203674732b4057382f1937de38b687078 Author: Cassie Tarakajian <ctarakajian@gmail.com> Date: Thu Oct 27 19:34:55 2016 -0400 add href parsing commit e67189298cda9b70645f454ecd541a363980f0e4 Author: Cassie Tarakajian <ctarakajian@gmail.com> Date: Thu Oct 27 10:48:36 2016 -0400 continue parsing html commit 1458fb940a15a3dc5d74890211a3073e920b84b8 Author: Cassie Tarakajian <ctarakajian@gmail.com> Date: Wed Oct 26 17:40:31 2016 -0400 start to add html parsing |
||
---|---|---|
client | ||
server | ||
static | ||
.babelrc | ||
.eslintignore | ||
.eslintrc | ||
.gitignore | ||
cert_chain.crt | ||
ecosystem.json | ||
index.html | ||
index.js | ||
nodemon.json | ||
package.json | ||
README.md | ||
webpack.config.dev.js | ||
webpack.config.prod.js |
#p5.js Web Editor
This project is currently in the early stages of development! It will definitely be announced when it is in alpha/beta/etc.
##Development Installation
- Clone this repostory and cd into it
$ npm install
- Install MongoDB and make sure it is running
- Create a file called
.env
in the root of this directory that looks like
MONGO_URL=mongodb://localhost:27017/p5js-web-editor
PORT=8000
SESSION_SECRET=whatever_you_want_this_to_be_it_only_matters_for_production
AWS_ACCESS_KEY=<your-aws-access-key>
AWS_SECRET_KEY=<your-aws-secret-key>
S3_BUCKET=<your-s3-bucket>
GITHUB_ID=<your-github-client-id>
GITHUB_SECRET=<your-github-client-secret>
If you don't care about being able to upload media files to S3 or Login with Github, you can drop in the file exactly how it is. Or, if you don't want to do that, just ask me to send you mine. Refer to this gist for creating an S3 bucket for testing, or if you don't want to do that, I can add you to one of my S3 buckets.
5. $ npm start
6. Navigate to http://localhost:8000 in your browser
7. Install the React Developer Tools.
8. Open and close the Redux DevTools using ctrl+h
, and move them with ctrl+w
##Production Installation
- Clone this repostory and
cd
into it $ npm install
- Install MongoDB and make sure it is running
- Create a file called
.env
in the root of this directory that looks like
MONGO_URL=mongodb://localhost:27017/p5js-web-editor
PORT=8000
SESSION_SECRET=make_this_a_long-random_string_like_maybe_126_characters_long
AWS_ACCESS_KEY=<your-aws-access-key>
AWS_SECRET_KEY=<your-aws-secret-key>
S3_BUCKET=<your-s3-bucket>
GITHUB_ID=<your-github-client-id>
GITHUB_SECRET=<your-github-client-secret>
For production, you will need to have real Github and Amazon credentions. Refer to this gist for creating an S3 bucket for testing.
5. $ npm run build
6. $ npm run start:prod
###For Production Setup with PM2
$ npm install -g pm2
$ pm2 start ecosystem.json
##Accessibility Guidelines
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.
Code Structure
- 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 thebody
tag - All buttons/links/windows need to be accessible by the keyboard ( By tabbing, pressing space etc.)
- In cases where tags are not screen reader friendly, we can take advantage of tabIndex. Using tabIndex ensures that all elements are accessible via keyboard. code example
- When opening a new window or pop up window, ensure the keyboard focus also moves to the new window. code example
Labeling
- When creating button icons, images, or something without text (this does not include an HTML5
<button>
), use aria-labels. code example - All
<table>
s need to have asummary
attribute. This will ensure user is given context to what the table is. code example ul
s andnav
s menus need to include a title. code example
For more information on accessibility see the teach access tutorial
##Contribution Guide I am currently open to contributors! Email me if you are looking for a task, or look at the open issues and reply that you are working on a task.
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 and this comment.
This project does not use CSS Modules, but uses Sass. I like to follow BEM rules for CSS naming conventions, write OOSCSS with placeholders and mixins, and follow the 7-1 Pattern for Sass.
I'm using ES6 and transpiling to ES5 using Babel. For reference to the JavaScript style guide, see the Airbnb Style Guide, React ESLint Plugin.
I'm new to using ESLint, but I decided on a configuration based on some 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
.
##Dump of links I'm saving for reference
- https://github.com/brigade/scss-lint
- https://github.com/petehunt/react-howto
- https://github.com/jsbin/jsbin (especially look at the console)
- Need to figure out how to solve the XSS issue, https://github.com/jsbin/jsbin/wiki/Best-practices-for-building-your-own-live-paste-bin
- https://www.npmjs.com/package/express-subdomain
- https://github.com/jsbin/jsbin/blob/master/public/js/render/console.js - the code is a little messy but it might be our only hope for a console