Phyllo backend implementation sample/boilerplate in Python
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
- About the Project
- Getting Started
- Versioning
- Contributing
- Support
- License
- Acknowledgments
- About Authors
This app is a sample implementation of a basic client for our APIs. In its current form, this is just a pass-through - meaning all the requests you send to it are sent to our APIs without any modifications, and all the responses received from our APIs are sent to you without any modifications. This demonstrates an ideal technical integration with Phyllo. You can use this to see how things work, to help you with your local dev work, or even as a starting boilerplate to customize by adding your business logic.
Clone or fork this repo and follow the instructions.
-
Python 3 or above (check your OS-specific instructions at https://www.python.org/downloads/)
-
pip
python -m ensurepip --upgrade
-
Your Phyllo API credentials should be populated in the
.env
file in the root directory, take reference from the.env.example
file.
-
Clone the repo.
-
Install
pipenv
package to make a virtual environment for the project.pip install pipenv
-
Setup and enter the virtual environment.
pipenv install pipenv shell
-
Run the main app to start the project.
uvicorn app.main:app --port 9000 --forwarded-allow-ips="*"
-
The project should be up and running on port
9000
.
You can make requests to any API endpoints by using the same path as described in our API documentation with the base URL as your localhost:9000
. For example, to create a user, you could send a POST
request to localhost:9000/v1/users
, and it would behave the same as our API does.
-
Create a public URL for port
9003
usingngrok
(or a similar tunneling tool).ngrok http 9003
-
Use the above-generated tunnel URL and the desired webhook events in the
.env
file in the root directory to register the webhook in the sandbox. -
Run the webhook app to start listening for webhooks.
uvicorn app.webhook.webhook_main:app --port 9003 --forwarded-allow-ips="*"
-
The webhook server should be up and running on port
9003
. -
To test webhooks to check if everything works as expected:
- Send a mock webhook notification.
- If you are doing frontend development, you will keep getting auto-generated webhooks when you connect accounts.
-
Run the
main
file inside theunit_tests
directory to run the unit tests.python unit_tests/main.py
See the open issues for a list of proposed features (and known issues).
To get any help regarding this app, please join our Discord community using this invite link.
We use SemVer for versioning. For the versions available, see the tags on this repository.
See CHANGELOG.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated. Sincere thanks to all our contributors!
You are requested to follow the contribution guidelines specified in CONTRIBUTING.md 😄
Contributions, issues, and feature requests are welcome! Give a ⭐️ if you like this project!
If you like what we do here at Phyllo, help us spread the word through a tweet or a post.
This project is licensed under the MIT License - see the LICENSE file for details.
This repo is inspired by:
phyllo-python-sample
is created & maintained by Phyllo, Inc. You can find us on Twitter - @getphyllo or join our Discord community using this invite link.
The names and logos for Phyllo are trademarks of Phyllo, Inc.
We ❤️ open-source software! See our other projects and check out our products.