{"id":22737798,"url":"https://github.com/fourdigits/aihelpdesk","last_synced_at":"2025-03-30T03:21:26.033Z","repository":{"id":236283625,"uuid":"792208161","full_name":"fourdigits/aihelpdesk","owner":"fourdigits","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-07T08:27:31.000Z","size":764,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T05:41:24.007Z","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":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fourdigits.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.txt","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2024-04-26T07:40:41.000Z","updated_at":"2024-05-07T08:27:35.000Z","dependencies_parsed_at":"2024-05-07T09:56:44.024Z","dependency_job_id":null,"html_url":"https://github.com/fourdigits/aihelpdesk","commit_stats":null,"previous_names":["fourdigits/aihelpdesk"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fourdigits%2Faihelpdesk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fourdigits%2Faihelpdesk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fourdigits%2Faihelpdesk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fourdigits%2Faihelpdesk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fourdigits","download_url":"https://codeload.github.com/fourdigits/aihelpdesk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246270802,"owners_count":20750465,"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-12-10T22:17:56.483Z","updated_at":"2025-03-30T03:21:26.016Z","avatar_url":"https://github.com/fourdigits.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Aihelpdesk\n\nThis is the repository for website ....\n\n## Repositories\n\nThis project consists of the following repositories:\n\n- A [public repository on github](https://github.com/fourdigits/aihelpdesk) that publishes the `main` branch of the above repository.\n- The [wagtail-helpdesk project on github](https://github.com/Klimaat-Helpdesk/wagtail-helpdesk) contains the reusable Django `wagtail-helpdesk` app that comprises the main functionality of Klimaathelpdesk: asking questions, and answering, tagging, reviewing and publishing them. This package can be used to implement similar-working websites.\n\n## Requirements\n\nThe aihelpdesk.org website uses `wagtail-helpdesk`, which builds on `wagtail`, for its main functionality.\n\n### Database\n\nWe assume you have Postgres on your $PATH, for example:\n\n    PATH=$PATH:/Applications/Postgres.app/Contents/Versions/13/bin/\n\nCreate a database:\n\n    createdb aihelpdesk\n\n\n### Front-end build\n\nWe require:\n\n- NodeJS (see [package.json](./package.json) for which version)\n\n\n## Installation\n\n    make develop\n\nPossibly, create a superuser by activating the virtualenv and:\n\n    ./manage.py createsuperuser\n\n\n### Running\n\nTo start the Django server:\n\n    make run\n\nNote that `manage.py` assumes the default settings file to be `settings/development.py`. (Production configs don't use that, see the \"Deployment and environments\" section below.)\n\n\n## Development\n\n### Development workflow\n\n#### Setup your local sources\n\n- Clone `ai-helpdesk` from gitlab:\n\n```shell\ngit clone git@github.com:fourdigits/aihelpdesk.git\n```\n\n- Create default development setup:\n\n```shell\ncreatedb aihelpdesk\nmake develop\n```\n\n- Get data from `acceptance` environment and test the website:\n\n```shell\n# The fabfile is in a different branch to ensure we don't push it to the public github repo\ngit checkout ci-utils\nfab get_data acceptance\ngit checkout main\nmake run\nfirefox http://localhost:8000\n```\n\n- Replace the pip-installed `wagtail-helpdesk` package with a local git checkout:\n\n```shell\n# This checks out the repository next to the ai-helpdesk repo\ngit clone git@github.com:fourdigits/aihelpdesk.git ../wagtail-helpdesk\npip install -e ../wagtail-helpdesk\nmake run\n```\n\n#### Make development changes\n\nChanges to the `ai-helpdesk` repo can be handled as a regular development change.\n\nFor changes to `wagtail-helpdesk`:\n\n- Run `make run` in the `ai-helpdesk` repo to get to see changes on http://localhost:8000\n- Run `yarn start` in the `wagtail-helpdesk` repo to rebuild frontend files automatically, refresh the page for updates.\n\nIf you made changes to frontend files, after all files have been updated, run `yarn build` and commit the produced changes to the repo (yes, in the `static` folder).\n\n\n#### Deploy a new version\n\n- Create a new release for wagtail-helpdesk (if you made changes to the repo). After all changes are merged, [update the version in \\_\\_init\\_\\_.py](https://github.com/Klimaat-Helpdesk/wagtail-helpdesk/blob/main/wagtail_helpdesk/__init__.py) and create a corresponding git tag.\n\n- Update the used version of the `wagtail-helpdesk` package [in the `website` requirements](https://gitlab.com/fourdigits/klimaat-helpdesk/-/blob/main/requirements/base.in) if needed, and run `make requirements`. Commit the new requirements.\n\n- After all other changes are done, create a development tag (`x.y.zdevN`) and deploy to test/acceptance. If the changes are accepted, add a production tag (`x.y.z`) and deploy to acceptance and production.\n\n- Push the updated `ai-helpdesk` `main` branch to the github repo by adding an additional remote in git:\n\n```shell\ngit remote add github git@github.com:fourdigits/aihelpdesk.git\ngit push github main\ngit push github --tags\n```\n\n### Testing\n\nRun:\n\n    make test\n\nFor more control locally:\n\n    make test PYTEST_ADDOPTS=\"-k test_only_this_test --pdb\"\n\nNote: You can also run ``pytest`` directly, but `make test` also runs Python in\n[development mode](https://docs.python.org/3/library/devmode.html), which provides\nmore warnings (for example, about unclosed files).\n\n#### Test coverage\n\nRunning `pytest` or `make test` will also generate a coverage report.\nAn HTML version will be placed in `htmlcov/`.\n\nThe file `.gitlab-ci.yml` uses the generated `coverage.xml` to show\n(in the MR on Gitlab) which code changes are being hit by automatic tests,\nmaking code review easier.\n\n### Code conventions\n\n#### Python\n\nFlake-8 is enforced by the test suite.\n\nYou can configure the exceptions to ignore in `setup.cfg`, for example if\nyou want change the maximum allowed line length.\n\nYou can easily fix all code convention errors with `make fix-codestyle`.\n\n#### Frontend\n\n[Prettier](https://prettier.io/) is enforced for code formatting. The easiest way to apply prettier is to install a [plugin for your editor](https://prettier.io/docs/en/editors.html) and apply the formatting on save.\nFor linting we use [ESLint](https://eslint.org/) and [Stylelint](https://stylelint.io/).\n\nTo check formating and linting run `yarn lint` and to automatically fix things (if possible) run `yarn lint:fix`.\n\n### Dependency management\n\nOur dependencies are managed with [pip-tools](https://github.com/jazzband/pip-tools).\nIn `requirements/base.in`, we pin as few packages as we can, and pip-tools generates the rest for us.\n\nTo upgrade dependencies, run:\n\n```shell\nmake requirements\n```\n\nBy default, all dependencies that can be upgraded to a newer version are automatically pinned to\nthe newest available version.\n\nIf you only changed a pinning of a single package, or only added a new dependency, use:\n\n```shell\nmake requirements UPGRADE=no\n```\n\n## Deployment and environments\n\nTest is deployed automatically when the `main` branch is updated, for acceptance and production you can use the\ndeploy button in gitlab, available after you add a tag (and a successful build).\n\nIt's also possible to run deployment manually from you own command line with::\n\n    fab deploy production --ref=\u003ctag/branch\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffourdigits%2Faihelpdesk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffourdigits%2Faihelpdesk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffourdigits%2Faihelpdesk/lists"}