Package: herbie
HerbieWhat is Herbie?Herbie is an abstract data layer that makes it easier to exchange data across distributed systems. You define business entities such as “customer” or “order” as JSON schemas which you store in a central schema registry. Herbie can listen for data updates in one system and publish new data to other systems based on your business rules.Why should you use HerbieIt simplifies the process of building integrations and connectors for all your systems. Maybe you want to build a connector between MailChimp and Salesforce, but also between MailChimp and Shopify, and maybe also between Salesforce and Shopify. Each time, you have to customize your connector to the requirements of the two systems. What if all your systems connected to one central data layer? - that’s Herbie.Once all your systems are connected to Herbie, they can then talk to one another. Once the system can subscribe to changes in another system. Just updated your contacts in Salesforce? Your MailChimp connector can listen for the changes and update the Mailchimp database accordingly.OverviewHerbie uses aschema registrycombined with acentral data storefor business
entities.It's built withDjangoand comes with a simple API to create business entities.Thejson-schemaintegration allows you to define custom schema definitions which Herbie uses to validate the entities.By default, we provide support forGoogle Pub/SuborAWS SNS/SQSto provideevent streams— your services can subscribe to these event streams and find out when a certain entity-type is updated.However, you don't have to use Google Pub/Sub - you can also update Herbie touse your preferred messaging system.The philosophy behind Herbie is to avoid behavior that seems like a "black box" and is instead built in very
straightforward way, following Django best practices. It is also meant to be extendable and easy to adapt.Further reading:Core ConceptsGetting startedQuick StartThe easiest and recommended way to start a new project is to clone thesandboxrepository and follow the instructions.Step by step guideHerbie is based on the Django framework, so the first step is to start anew Django projectusingpostgresas database technology.After the Django-skeleton is set up, Herbie can be installed using a common package manager like pip.python -m pip install herbieYou can also add Herbie to yourrequirements.txt.The next step is to configure the settings accordingly:a) Register Herbie and the django rest-framework in your installed apps.INSTALLED_APPS=[# ...'rest_framework','rest_framework.authtoken','herbie_core.apps.HerbieCoreConfig',]b) Setup the token-authentication for the provided Herbie-API:REST_FRAMEWORK={'DEFAULT_AUTHENTICATION_CLASSES':('rest_framework.authentication.TokenAuthentication',),}c) Define Schema packaged) Select a Queueing technology (AWS SNS/SQS vs. Google Pubsub)e) Register herbie urls in your urls.py:fromherbie_coreimporturlsasherbie_urlsurlpatterns=[# ...path('api/',include(herbie_urls)),]Add schemas by either adding them to the remote repository or to a local package.Run the Django-App in preferred way-> linkWhen app is running execute the following commands:Generate model classes for the sample business objects that are included in the Herbieschemas package.python manage.py generatemodelsCreate and execute migration files to initialize your databasepython manage.py makemigrations
python manage.py migrateLoad the schemas to the database:python manage.py import_json_schemasCreate an admin user so that you can log in to the admin dashboard.python manage.py createsuperuser --username "username" --email "email@email-address.com"Changing the messaging systemBy defaultHerbie sandboxsetup usesGoogle Pubsubfor distributing
the business entity messages in a JSON format. But it should be easy to use any other
messaging system:The different messaging systems are distributed as Python packages and are also based on Django. To use or add a new one it is as
easy as registering a new Django app.CheckGoogle Pubsub adapterrepository for detailed instructions.Admin PanelHow to add social login?