At CARTO, among other things, we render maps, just check this example of Map with countries and USA states.
In order to limit the scope of the challenge, we are gonna use Mapnik and Node.js. Within this repository, we are providing all the pieces you need to reproduce that map. Well, all pieces except the map tile server.
An example of how to create an image with Mapnik: