Bodies interact due to the gravitational iteraction with each other. I used the Burnes-Hut algorigthm for improved time complexity O(nlogn) in the numerical integration and webgl for graphics in the browser.
Here is a blog post with more details and my experience in creating it.