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 :
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.
Make use of eslint package for linting the code. This forces us to follow the predefined rules while writing or formatting our code
Make use of the unit and integration testing libraries like JEST for unit testing the code
Add support for latest features in js using babel transpiler
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
Use templating engines on client side using webpack loaders
In production use minification addons to decrease the side to js and css bundles produced the webpack
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
Always pass the Atlassian Jira base url to the app in non-local environment using the AC_LOCAL_BASE_URL environment variable
Always separate out the development dependencies from other dependencies by using the necessary npm flags
Always run the app in production with NODE_ENV=production flag
Use database abstractions like Sequelize to interact with the database using models
Always comment the code using the JSdoc markup styles
README.md file in the app should list the details of how to configure and run the app in different environments
Always use Nginx as the reverse proxy and do not expose nodejs server to the public network directly
JAVA :
Common :
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.