{"id":19110017,"url":"https://github.com/coopdevs/lazona_connector","last_synced_at":"2025-08-17T16:05:39.285Z","repository":{"id":45121633,"uuid":"335989926","full_name":"coopdevs/lazona_connector","owner":"coopdevs","description":null,"archived":false,"fork":false,"pushed_at":"2023-04-22T10:27:43.000Z","size":236,"stargazers_count":1,"open_issues_count":19,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-01-03T03:45:24.182Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coopdevs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-04T15:05:23.000Z","updated_at":"2023-03-31T16:02:51.000Z","dependencies_parsed_at":"2024-11-09T04:24:47.413Z","dependency_job_id":"9639c0c7-33fd-463a-b40f-57f33d05bd94","html_url":"https://github.com/coopdevs/lazona_connector","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coopdevs%2Flazona_connector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coopdevs%2Flazona_connector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coopdevs%2Flazona_connector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coopdevs%2Flazona_connector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coopdevs","download_url":"https://codeload.github.com/coopdevs/lazona_connector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240163734,"owners_count":19758053,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T04:23:18.020Z","updated_at":"2025-02-22T11:18:33.616Z","avatar_url":"https://github.com/coopdevs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# La Zona connector\n\nThis Django app aims to integrate Lazona's Woocommerce site to other services.\nSo far, Koiki's API, its delivery and distribution provider and the CRM, Sugar\nCRM.\n\nThis is implemented using Django and Celery with Webhooks and API calls.\n\n## Requirements\n\n* Python 3.8.3\n* PostgreSQL\n* Redis\n* [direnv](https://direnv.net/)\n\n## Setup\n\nYou have two options to work on the project: to run the docker containers or to run the project manually.\n\n### Run Docker\n\nYou can have the project up \u0026 running locally just with a command:\n`docker-compose up`. \n\nYou need to have an .env file created. Check the .env.example to see the required variables and their purpose. Run:\n\n```\ncp .env.example .env\n```\nEdit the variables on .env adding the actual data.\n\n### Run manually\n\n#### Python\n\nFirst, install the Python versions listed above. We strongly recommend [pyenv]\nwith its [pyenv-virtualenv] plugin.\n\n[pyenv]: https://github.com/pyenv/pyenv\n[pyenv-virtualenv]: pyenv-virtualenv\n\n#### Database\n\nWe need to create lazona_connector database on PostgreSQL. Login to PostgreSQL using psql and create it.\n\n```\nCREATE DATABASE lazona_connector;\n```\n\nThe app relies on PostgreSQL peer authentication to work with a simple database\nconfiguration. To enable that add a new entry to the bottom of your pg_hba.conf,\nwhich you'll find at `/etc/postgresql/\u003cpostgresql_version\u003e/main/pg_hba.conf`, as\nfollows.\n\n```\n# TYPE  DATABASE          USER            ADDRESS                 METHOD\nlocal   lazona_connector  \u003cyour_user\u003e                             peer\n```\n\nWhere `\u003cyour_user\u003e` is your current user's name.\n\n#### Redis\n\nWe use Celery with Redis as broker. The quickest way to set it up locally is:\n\n```sh\n$ docker run -p 6379:6379 redis\n```\n\nAlternatively, you can install the appropriate Redis package for your OS.\n\n#### Direnv\n\nWe keep required config environment variables in `.envrc` which is managed by\n[direnv](https://direnv.net/). Any time you modify that file, you'll need to run\n`direnv allow`. You'll see an error message telling you so when cd-ing into the\nproject's directory.\n\nYou need to have an .envrc file created. Check the .envrc.example to see the required variables and their purpose. Run:\n\n```\ncp .envrc.example .envrc\n```\nEdit the variables on .envrc adding the actual data.\n\n#### Django\n\nCreate a superuser to authenticate Woocommerce's webhook requests:\n\n```\npython manage.py createsuperuser --username woocommerce --email woocommerce@example.com\n```\n\n\nOnce all previous points are setup run migrations to create the necessary tables on django\n\n```\npython manage.py migrate\n\n```\n\nAfterwards collect all static files by running:\n\n```\npython manage.py collectstatic\n\n```\n\n#### Code style validation\n\nBefore pushing changes in the repo please run the following code style validation command:\n\n```\nflake8 . --count --show-source --statistics\n\n```\nIf it fails, you'll have to adapt your python code to pass the validation.\n\n## Usage\n\n### Authentication\n\nThe API we expose for Woocommerce to send its webhook uses a signature mechanism. The signature is verified using our custom [SignatureValidaton](https://github.com/coopdevs/lazona_connector/blob/main/api/authentication.py).\n\n### Sending a request to the connector\n\nWe'll need to configure our woocommerce instance to send requests to the connector.\n\nFirst of all, define the webhook on WooCommerce / Ajustes / Avanzado / Webhooks\n\nAfterwards, depending on the webhook defined, actions applied to Woocommerce orders will turn into API requests to the connector.\n\n\n### Expose my local instance of the connector for testing\n\nFor developing purposes we'll use a staging Woocomerce version to create the request and we'll send them to our local instance. To do this we expose our localhost:8000 using ngrok.\n\nYou can read ngrok documentation [here](https://ngrok.com/product)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoopdevs%2Flazona_connector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoopdevs%2Flazona_connector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoopdevs%2Flazona_connector/lists"}