Home

Awesome

中文版 | 日本語版 | 한국어 | Русский | Português | Italiana

<img src="./images/elsewhen-logo.png" width="180" height="180">

Project Guidelines · PRs Welcome

While developing a new project is like rolling on a green field for you, maintaining it is a potential dark twisted nightmare for someone else. Here's a list of guidelines we've found, written and gathered that (we think) works really well with most JavaScript projects here at elsewhen. If you want to share a best practice, or think one of these guidelines should be removed, feel free to share it with us.

<hr>

<a name="git"></a>

1. Git

Git <a name="some-git-rules"></a>

1.1 Some Git rules

There are a set of rules to keep in mind:

<a name="git-workflow"></a>

1.2 Git workflow

Because of most of the reasons above, we use Feature-branch-workflow with Interactive Rebasing and some elements of Gitflow (naming and having a develop branch). The main steps are as follows:

<a name="writing-good-commit-messages"></a>

1.3 Writing good commit messages

Having a good guideline for creating commits and sticking to it makes working with Git and collaborating with others a lot easier. Here are some rules of thumb (source):

<a name="documentation"></a>

2. Documentation

Documentation

<a name="environments"></a>

3. Environments

Environments

<a name="consistent-dev-environments"></a>

3.1 Consistent dev environments:

<a name="consistent-dependencies"></a>

3.2 Consistent dependencies:

<a name="dependencies"></a>

4. Dependencies

Github

<a name="testing"></a>

5. Testing

Testing

<a name="structure-and-naming"></a>

6. Structure and Naming

Structure and Naming

<a name="code-style"></a>

7. Code style

Code style

<a name="code-style-check"></a>

7.1 Some code style guidelines

<a name="enforcing-code-style-standards"></a>

7.2 Enforcing code style standards

<a name="logging"></a>

8. Logging

Logging

<a name="api"></a>

9. API

<a name="api-design"></a>

API

9.1 API design

Why:

Because we try to enforce development of sanely constructed RESTful interfaces, which team members and clients can consume simply and consistently.

Why:

Lack of consistency and simplicity can massively increase integration and maintenance costs. Which is why API design is included in this document.

<a name="api-security"></a>

9.2 API security

These are some basic security best practices:

<a name="api-documentation"></a>

9.3 API documentation

For each endpoint explain:

<a name="a11y"></a>

10. Accessibility (a11y)

Accessibility

10.1 Laying accessibility practices in place

Take the following steps at the start of your project to ensure an intentional level of accessibility is sustained:

Why:

Web content is accessible by default. We compromise this when we build complex features. It's much easier to reduce this impact by considering accessibility from the start rather than re-implement these features later.

10.2 Some basic accessibility rules to add to your project:

More accessibility rules can be found here.

<a name="licensing"></a>

11. Licensing

Licensing

Make sure you use resources that you have the rights to use. If you use libraries, remember to look for MIT, Apache or BSD but if you modify them, then take a look at the license details. Copyrighted images and videos may cause legal problems.


Sources: RisingStack Engineering, Mozilla Developer Network, Heroku Dev Center, Airbnb/javascript, Atlassian Git tutorials, Apigee, Wishtack

Icons by icons8