A variety of routes are available for architecting a robot web application. A common route is building web technologies on an existing robot framework. The Robot Operating System (ROS) is one of the more popular robot middlewares to build upon.
ROS is one of the top frameworks to program robots and can run on a variety of robots, from a TurtleBot to a PR2 to an Arduino connected to a computer. ROS - and other robot middleware frameworks - provide common robot functionality, including drivers for interfacing with a variety of sensors and actuators and algorithms for navigation, perception, and manipulation.
While ROS works great for applications on the robot, another layer is needed to connect external devices and applications. rosbridge is both a JSON spec for interacting with ROS and a transport layer, providing a WebSocket for clients to communicate over.