/
Cloud App Best Practices

Cloud App Best Practices

This document mentions few of the best practices that we would want to incorporate in our regular app development activities.

Nodejs :

  1. Make your cloud app configurable using the environment variables. We can use this feature to customize the behavior of the application by passing parameters to the application at runtime.

  2. Make use of eslint package for linting the code. This forces us to follow the predefined rules while writing or formatting our code

  3. Make use of the unit and integration testing libraries like JEST for unit testing the code

  4. Add support for latest features in js using babel transpiler

  5. Use the webpack bundler to bundle the client side js code and server side js code separately. We can use babel with webpack to transpile es6+ code to es5 which then can be executed by nodejs environment and the browser

  6. Use templating engines on client side using webpack loaders

  7. In production use minification addons to decrease the side to js and css bundles produced the webpack

  8. Do not mention any sensitive information like passwords or access tokens in the code or in .env(or .properties) file. Pass these values to the app at runtime using environment variables

  9. Always pass the Atlassian Jira base url to the app in non-local environment using the AC_LOCAL_BASE_URL environment variable

  10. Always separate out the development dependencies from other dependencies by using the necessary npm flags

  11. Always run the app in production with NODE_ENV=production flag

  12. Use database abstractions like Sequelize to interact with the database using models

  13. Always comment the code using the JSdoc markup styles

  14. README.md file in the app should list the details of how to configure and run the app in different environments

  15. Always use Nginx as the reverse proxy and do not expose nodejs server to the public network directly

JAVA :

Common :

  1. Always build the cloud app using the Atlaskit or AUI components so that we can retain the look and feel of the actual Atlassian products in our plugin too.