You can write it anywhere you want. It is independent from the Rasa code. You just should implement the interface defined in Your Own Website. You need to start the controller next to Rasa. Otherwise Rasa will not be able to call the URL you defined in your credentials.yml.