• Stars
    star
    228
  • Rank 175,267 (Top 4 %)
  • Language
  • License
    MIT License
  • Created over 7 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

✅ A checklist for building Java + Angular/React web applications in the correct way

building-java-web-apps-checklist

This repository shares a checklist that I use for building web applications in Java+ Angular/React.

🔰 Before you start development

Software architecture is the set of design decisions which, if made incorrectly, may cause your project to be cancelled. — Eoin Woods

  • Take architectural decisions. Finalize tech stack.
  • Create a multi-module Maven or Gradle project for your development. Start with two modules — backend and frontend. You can refer to spring-boot-react-maven-starter for inspiration. backend contains Java code of the application. frontend contains all React/Angular JavaScript/TypeScript code of the application.
  • You should use Maven or Gradle wrapper scripts so that a new developer do not need to install Maven or Gradle on their machine before executing the build.
  • Build project as a single jar/war using a single command i.e. if I am using Maven as my build tool then I should be able to run ./mvnw clean install in the project root to build the executable.
  • Set up CI server and make sure it can build the project as a single executable.
  • Fix standup time and make sure it works for everyone.
  • Finalise your sprint duration.
  • Finalise your testing strategy both manual and automated.
  • Each team member should come up with their learning goal.

💻 During Development

Git

  • Work on feature branches.
  • Branch out from develop branch.
  • Never push to master or develop. Make a pull request.
  • Create PR on the develop branch and once it is tested then only merge to master. You can use different strategy like merge to master once sprint finishes.
  • Delete local and remote branches after merging. You can automate this process as well.
  • Before raising PR, run the build locally and make sure all tests pass.
  • Use .gitignore file.
  • Protect your master branch.
  • Never commit binary files to Git.
  • Write meaningful Git commit messages. Read Chris Beam post on it.
  • Feature branches should be short lived.

Continuous Integration

The most important practice for continuous integration to work properly is frequent check-ins to trunk or mainline. You should be checking in your code at least a couple of times a day. — David Farley

  • Every code committed to version control system mainline should trigger a continuous integration job that runs on the integration server.
  • Continuous integration job should build the project and run all unit test cases. It should happen on each code commit to mainline.
  • Fix broken builds immediately. CI server should always be in healthy green state.
  • Make CI server visible and transparent to whole team.
  • Maintain build jobs as code use Jenkinsfile if you are using Jenkins
  • You should be able to create build jobs on a new CI server using code.
  • Use pull request builder to build the project when pull request is raised.

Documentation

Documentation is the castor oil of programming. Managers think it is good for programmers and programmers hate it!. — Gerald Weinberg

  • Create README.md file in root of your project and keep it updated. The README file should have following:
  • Couple of lines describing purpose of the project.
  • Instruction to grab the latest code and detailed instructions to build it.
  • Instructions to run the project on local machine.
  • Link to Continuous integration server.
  • Instruction to do any setup required for the project.
  • Instruction to grab project documentation.
  • Any other relevant information that can help a new developer get started with the project.

Code Style

Style distinguishes excellence from accomplishment. — James Coplien

  • For backend, use Checkstyle in your project. Make sure you it is integrated with the build.
  • For frontend, use ESLint or TSLint.
  • Format your code before committing.

Testing

Program testing can be used to show the presence of bugs, but never to show their absence! — Edsger Dijkstra

  • Write one automated functional test per user story.
  • Cover business logic with unit/Integration tests.
  • Understand different between unit testing and integration testing.
  • Use consistent names for tests. I prefer to use *Tests as suffix for my tests.
  • Use consistent naming strategy for tests like shouldRegisterNewUser or registerNewUser or should_register_new_user

Dependencies

  • Add a new dependency to the project after discussing with the team.
  • Use Snyk to check security vulnerabilities.
  • Don't add dependency for each problem you face. First check if you already have some dependency that solves the problem.

Learning

You have to learn the rules of the game. And then you have to play better than anyone else. — Albert Einstein

  • Spend one hour on learning every day.
  • Give session at your office or local meetup.
  • Write blogs.

Naming

There are only two hard things in computer science: Cache Invalidation and Naming Things — Phil Karlton

  • Think and discuss with team before choosing a name for public member.
  • Java and JavaScript use PascalCase for classes, interfaces, enums, annotations.
  • Java and JavaScript use camelCase for methods and variables.

Exception Handling

  • Catch any checked exception thrown by the code.
  • Convert checked exception to unchecked exception.
  • Throw the unchecked exception. Unchecked exception could be custom or plain RuntimeException.
  • Always use two arguments constructor of RuntimeException. The first take a message, second is the actual exception.
  • Catch all exceptions thrown by code in your Controller or Resource classes.
  • Log exceptions only in the Controller or Resource classes.
  • Log both the message and exception. If using slf4j, then use log.error(“message”,e).

Logging

  • Use slf4j with logback for logging.
  • My applications logs all errors
  • The log files are rotated

REST API Design

  • Pick a versioning strategy. If you don't understand pros and cons of different strategies then pick URL versioning scheme /api/v1. Twitter uses this versioning scheme.
  • Resources are nouns.
  • Use HTTP POST for creating a resource on the server or for taking action. Always return location of created entity in the Location header.
  • Use PATCH HTTP method for update for partial update.
  • Use PUT HTTP method when you do full update i.e. when client sends all the information in the request.
  • Use DELETE HTTP method to delete a resource on the server
  • For mapping actions use a consistent strategy. I recommend using resource_name/actions/:action strategy. For example, REST API for implementing like functionality you will make HTTP POST request to /api/v1/posts/123/actions/like URL.
  • In the above example if you have to implement undo action then you can make HTTP DELETE operation to /api/v1/posts/actions/unlike.
  • For testing RESTful clients, use mock server. Use MockWebServer JUnit rule for testing HTTP interactions.
  • Learn how great REST APIs are designed. I refer to Github REST API when in doubt. I find it the best designed REST API.

Code Review

Code reviews are about code not people. Don't take code criticism personally.

  • Are there any obvious logic errors in the code?
  • Are unit tests written for the business logic?
  • Does all the functional requirements met?
  • Does the code conform to existing style guidelines?
  • Propose better way to do certain tasks. It could be a library function that developer can use.

Front-end

  • Commit yarn.lock file
  • Remove all console.log statements in the code.
  • Use linter and integrate it with the build tool.
  • Make sure there are no warnings and errors in the console.
  • Test on all the four major browsers — Chrome, Firefox, IE, and Safari.
  • Check spellings.
  • Make sure grammar is correct in the messages.
  • Add Google Analytics into your project.
  • Use jQuery 3 instead of earlier versions of jQuery.
  • Prefer Angular 4+ over Angular 1.x.
  • Don't use Bower. Use npm to manage client side dependencies.

Website performance optimization

  • Run Lighthouse tool on your website.
  • Go through BrowserDiet guide.
  • All my application web pages load under 3 seconds.

License

  • Make sure you do not violate 3rd-party dependencies licenses. Your can use LicenseFinder to compare licenses against a user-defined whitelist.

You can follow me on twitter at https://twitter.com/shekhargulati or email me at [email protected]. Also, you can read my blogs at http://shekhargulati.com/

More Repositories

1

52-technologies-in-2016

Let's learn a new technology every week. A new technology blog every Sunday in 2016.
JavaScript
7,159
star
2

99-problems

This is an adaptation of the Ninety-Nine Prolog Problems written by Werner Hett.
Java
3,302
star
3

java8-the-missing-tutorial

Java 8 for all of us
Java
1,572
star
4

strman-java

A Java 8 string manipulation library.
Java
1,354
star
5

30-seconds-of-java

Curated collection of useful little Java functions that you can understand quickly
Java
996
star
6

flask-login-example

Flask-Login extension example
Python
154
star
7

spring-boot-maven-angular-starter

Spring Boot 2.x Angular 9 Multi-module Maven Starter Project
HTML
148
star
8

useful-microservices-reading-list

This is a useful reading list on Microservices
101
star
9

day12-face-detection

OpenCV Java example
Java
93
star
10

python-flask-docker-hello-world

Hello world Python Flask application Dockerized
Python
88
star
11

git-the-missing-tutorial

Let's master Git
79
star
12

rx-docker-client

RxJava based Docker REST API client for the JVM
Java
61
star
13

todoapp-spark

Todo app written using Spark web framework http://www.sparkjava.com/
Java
57
star
14

must-read-resources-for-java-developers

55
star
15

project-wiki-template

53
star
16

day20-stanford-sentiment-analysis-demo

Day 20 demo application
CSS
50
star
17

angular-cal-heatmap-directive

AngularJS directive for cal-heatmap https://github.com/kamisama/cal-heatmap
JavaScript
46
star
18

good-docker-resources

A list of good Docker resources on the web
44
star
19

day13-dropwizard-mongodb-demo-app

The Day 13 demo application built using DropWizard and MongoDB
Java
44
star
20

sentiment-analysis-python

sentiment analysis step by step
Python
43
star
21

play-the-missing-tutorial

Play tutorial for Humans
Scala
39
star
22

day25-tornado-demo-app

Day 25 demo app built using Tornado and deployed on OpenShift
JavaScript
39
star
23

youtube-dl-scala

Youtube Video downloader for the JVM
Scala
37
star
24

awesome-multitenancy

33
star
25

day22-spring-angularjs-demo-app

Day 22 demo application
JavaScript
32
star
26

todo-flask-openshift-quickstart

Ported Todo example app https://github.com/mitsuhiko/flask-sqlalchemy/tree/master/examples to OpenShift
CSS
26
star
27

spring-boot-sso

Single sign-on in Spring Boot applications with Spring Security OAuth
Java
26
star
28

wordgame

A simple word game built using WebSockets. The app uses JSR356 API
Java
25
star
29

day30-play-framework-demo

Day 30 demo application
JavaScript
25
star
30

flask-login-openshift-quickstart

Flask Login quickstart for OpenShift
CSS
24
star
31

day23-timelinejs-demo

Day 23 demo application
JavaScript
24
star
32

image-resolver

A Java 8 library to extract main image from a URL or website link
Java
23
star
33

nexus

Sonatype Nexus Repository Manager running in Cloud
HTML
22
star
34

nosql-to-rdbms-stories

This repository contains stories of people moving back to RDBMS from NoSQL datastores
20
star
35

urlcleaner

A Java library that can do URL normalization, unshorten URL, and URL extraction.
Java
17
star
36

software-architecture-document-template

16
star
37

day15-epoll-meteor-demo

The demo application for meteor framework
JavaScript
16
star
38

openshift-tomcat8-quickstart

Get Tomcat 8 running on OpenShift
Shell
15
star
39

day3-instant-flask-web-development-book-app

Sample app built in instant flask web development book
Python
15
star
40

30technologies30days-mobile-app

The mobile application for 30technologiesin30days challenge https://www.openshift.com/blogs/learning-30-technologies-in-30-days-a-developer-challenge
JavaScript
14
star
41

spark-openshift-quickstart

Deploys a simple todo application written using Spark on OpenShift. Application uses Java 8 and MongoDB as well
Java
13
star
42

copy-as-plain-text-chrome-extension

A simple Google Chrome extension that adds "copy as plain text" context menu option
JavaScript
13
star
43

day29-chrome-extension

Chrome extension built using Yeoman
JavaScript
12
star
44

useful-tech-radars

A list of publicly published tech radars
11
star
45

miles2run-java

Miles2Run application
JavaScript
11
star
46

cassandra-openshift-quickstart

A DIY application to get Cassandra running on OpenShift
Shell
11
star
47

localjobshtml5

The LocalJobs application using HTML 5 geo location API.
JavaScript
11
star
48

day19-emberjs-demo

Day 19 demo for EmberJS
JavaScript
10
star
49

localjobs-nodejs

LocalJobs Application written using Node.js and MongoDb
JavaScript
10
star
50

tweet-deduplication

A stream of deduplicated tweets built using RxJava and Twitter4J
Java
10
star
51

gh-stats

A node script that calculates total number of stars and forks for your repositories
JavaScript
10
star
52

git-getting-started

Getting started tutorial for Git
9
star
53

day16-goose-extractor-demo

Day 16 demo
CSS
9
star
54

conduit-on-kubernetes

Source code for "The Kubernetes Guide"
Java
9
star
55

dictionary

Simple Dictionary Application Working on top of Redis. The project is built is Spring Data Redis project
Java
9
star
56

day9-textblob-demo-openshift

Day 9 demo application using TextBlob
CSS
9
star
57

boot-angular-pagination-example-app

Spring Boot 2.x and Angular 9.x Pagination Example Application
TypeScript
9
star
58

day26-togetherjs-demo

Day 26 demo application built using Together
JavaScript
8
star
59

rx-okhttp

Thin RxJava wrapper around OkHttp library
Java
8
star
60

filesave-angular4-example

Sample project that show case how to implement file save functionality in Angular 4
TypeScript
7
star
61

useful-twitter-threads

7
star
62

adventofcode-2016

Advent Of Code 2016 Java 8 Solutions http://adventofcode.com/
Java
7
star
63

vue-docker

Dockerizing a Vue.js application
Vue
7
star
64

the-k8s-internals

Kubernetes Internals (Learning from source)
7
star
65

dailyreads

A simple read it later app powered by Twitter likes. Developed using Python, Flask, and Newspaper
HTML
6
star
66

day24-yeoman-emberjs-demo

Day 24 demo application built using Yeoman and EmberJS
JavaScript
6
star
67

jersey-openshift-quickstart

Jersey file upload example running on OpenShift
Shell
6
star
68

day1-xebiablogmonth-2015-rxjava

Demo code for Xebia's blog month day 1 blog
Java
6
star
69

java8-examples

Contains Java 8 Examples
Java
6
star
70

rxjava-examples

Reactive Java examples
Java
5
star
71

math-java

An extensive Math library for JVM
Java
5
star
72

opentracing-microservices-example

Java
5
star
73

redis-dictionary

A dictionary application built on top of Redis. Spring data is used to interact with Redis
Java
5
star
74

cookiecutter-spring-boot-ms-template

Java
4
star
75

gradle-openshift-quickstart

A quickstart to use Gradle on OpenShift
Java
4
star
76

tdd-training-java7

Java
4
star
77

k8s-workshop

Java
4
star
78

what-will-X-say

Example application of Markov Chains in Java
Java
4
star
79

30-technologies-in-30-days

4
star
80

day11-30technologies30days-mobile-app-with-push-notification

The day 11 demo app. It is a mobile application with push notification using AeroGear
JavaScript
4
star
81

blogger

Sample project to teach TDD with Spring Boot
Java
4
star
82

spring-travel-openshift-tomcat-quickstart

Spring Travel Application on OpenShift
JavaScript
4
star
83

jobfinder

Java
4
star
84

youtrack-openshift

A quickstart to get YouTrack up and running on OpenShift
Shell
4
star
85

glassfish4-openshift-quickstart

GlassFish 4 running on OpenShift
Shell
4
star
86

getbookmarks

A social bookmarking site built using backbone.js , Jax-RS, and MongoDB. The application is deployed on OpenShift https://bookmarks-cix.rhcloud.com/
JavaScript
4
star
87

notebook-part1

The part1 of notebook series
Java
3
star
88

activemq-openshift-quickstart

Quick start for running activemq in cloud
JavaScript
3
star
89

jan2014-javaee-scalability-blog

Demo application for Java EE Scalibility Blog
Java
3
star
90

rx-tweet-stream

A RxJava Observable wrapper over Twitter Streaming API
Java
3
star
91

cobertura-example

An example multi module cobertura project
Java
3
star
92

timeflake-java

Java
3
star
93

day7-gruntjs-livereload-example

GruntJS livereload in action
CSS
3
star
94

schedapp-openshift

Instant Web Development Book Sample app on OpenShift
Python
3
star
95

localjobs-python2.7

LocalJobs Application written using Python 2.7
JavaScript
3
star
96

vagrant-java-box

Configures a Ubuntu VM with Java, Tomcat, and MySQL using chef-apply
Ruby
3
star
97

june-2014-blog-pythonjs

Blog that shows how to use PythonJS to write your Node.js application in Python and deploy to OpenShift
Python
3
star
98

node-openshift-client

A node wrapper around the OpenShift REST API
JavaScript
3
star
99

tdd-demo-application

Demo application for TDD training
Java
2
star
100

profileService

A simple SOAP web service created using Spring WS 2.0
Java
2
star