{"id":23888393,"url":"https://github.com/william-fernandes252/advisor.ai-backend","last_synced_at":"2026-04-10T07:10:35.652Z","repository":{"id":229470419,"uuid":"776822868","full_name":"William-Fernandes252/advisor.ai-backend","owner":"William-Fernandes252","description":"Back-end of the advisor.ai project, an article search and recommendation platform focused on promoting collaboration between researchers using AI.","archived":false,"fork":false,"pushed_at":"2024-07-03T03:54:29.000Z","size":184,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-04T09:03:06.591Z","etag":null,"topics":["api","celery","cookiecutter","django","django-rest-framework","docker","docker-compose","machine-learning","postgresql","python","redis","scipy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/William-Fernandes252.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-03-24T14:49:10.000Z","updated_at":"2024-04-29T21:14:51.000Z","dependencies_parsed_at":"2024-04-30T04:55:04.096Z","dependency_job_id":"e71aa47f-bef2-478c-9aa5-d3b482074171","html_url":"https://github.com/William-Fernandes252/advisor.ai-backend","commit_stats":null,"previous_names":["william-fernandes252/advisor.ai-backend"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/William-Fernandes252%2Fadvisor.ai-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/William-Fernandes252%2Fadvisor.ai-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/William-Fernandes252%2Fadvisor.ai-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/William-Fernandes252%2Fadvisor.ai-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/William-Fernandes252","download_url":"https://codeload.github.com/William-Fernandes252/advisor.ai-backend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240271520,"owners_count":19774859,"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":["api","celery","cookiecutter","django","django-rest-framework","docker","docker-compose","machine-learning","postgresql","python","redis","scipy"],"created_at":"2025-01-04T08:59:59.398Z","updated_at":"2025-10-28T11:12:58.318Z","avatar_url":"https://github.com/William-Fernandes252.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# advisor.ai Back-end\n\nBack-end of the advisor.ai project, an article search and recommendation platform focused on promoting collaboration between researchers using AI.\n\n[![Built with Cookiecutter Django](https://img.shields.io/badge/built%20with-Cookiecutter%20Django-ff69b4.svg?logo=cookiecutter)](https://github.com/cookiecutter/cookiecutter-django/)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n\n## Settings\n\nSee the settings specification at [settings](http://cookiecutter-django.readthedocs.io/en/latest/settings.html).\n\n## Development\n\nThis project uses Docker, both in development and in production, to run all its services inside containers.\n\n### Requirements\n\n- Docker `26.0.1` (installation guide [here](https://docs.docker.com/desktop/install/windows-install/))\n- Docker Compose `2.24.6`\n\n### Run locally\n\nIn order to run all the back-end services loccaly, execute\n\n```bash\ndocker compose -f local.yml up\n```\n\n### Setting up users for testing\n\n- To create **normal user accounts** for testing, use the command:\n\n```bash\npython manage.py createfakeusers\n```\n\n- To create a **superuser account**, use this command:\n\n```bash\npython manage.py createsuperuser\n```\n\n### Type checks\n\nRunning type checks with mypy:\n\n```bash\nmypy apps\n```\n\n### Running tests\n\nFor automation of unit and integration tests in the back-end, [pytest](https://docs.pytest.org/en/7.1.x/contents.html#) is being used.\n\nTo just run all the test suites, execute\n\n```bash\npytest\n```\n\nor\n\n```bash\ndocker compose -f local.yml exec django pytest\n```\n\nto run inside the container.\n\n### Test coverage\n\nTo run the tests, check your test coverage, and generate an HTML coverage report:\n\n```bash\ncoverage run -m pytest\ncoverage html\nopen htmlcov/index.html\n```\n\n### Training machine learning models\n\nThere are management commands to help testing models training and the generation of papers recommendations.\n\nIf you want to test the recommendation system locally,\n\n1. create some fake users (between 50k and 100k should be enough) to hold the reviews with\n\n    ```bash\n    docker compose exec -it django python manage.py createfakeusers 50000\n    ```\n\n1. export the papers reviews data with\n\n    ```bash\n    docker compose exec -it django python manage.py exportdatasets\n    ```\n\n1. train a machine learning model with\n\n    ```bash\n    docker compose exec -it django python manage.py trainmodel\n    ```\n\n1. and finally, create suggestions using the trained model by running\n\n    ```bash\n    docker compose exec -it django python manage.py createpaperssuggestions --offset=25 --max=250\n    ```\n\n    Note that this process can take some time to complete and may fail in machines with slower CPUs and little memory. If that is your case, I recommend you to try to limit the number of users covered by the `batch_create_papers_suggestions` method [here](./apps/papers/tasks.py)\n\nNow, you should be able see the suggestions for your user on `GET /papers/suggestions`.\n\n## Email Server\n\nA local SMTP server [Mailpit](https://github.com/axllent/mailpit), with a web interface, is available as a docker container to allow the visualization of the emails that are being set from the application by the developers.\n\nContainer mailpit will start automatically when you will run all docker containers.\nPlease check [cookiecutter-django Docker documentation](http://cookiecutter-django.readthedocs.io/en/latest/deployment-with-docker.html) for more details how to start all containers.\n\nWith Mailpit running, to view messages that are sent by your application, open your browser and go to `http://127.0.0.1:8025`\n\n## Sentry\n\nSentry is an error logging aggregator service. You can sign up for a free account at \u003chttps://sentry.io/signup/?code=cookiecutter\u003e or download and host it yourself.\nThe system is set up with reasonable defaults, including 404 logging and integration with the WSGI application.\n\n## Deployment\n\nThe following details how to deploy this application.\n\n### Docker\n\nSee detailed [cookiecutter-django Docker documentation](http://cookiecutter-django.readthedocs.io/en/latest/deployment-with-docker.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliam-fernandes252%2Fadvisor.ai-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilliam-fernandes252%2Fadvisor.ai-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliam-fernandes252%2Fadvisor.ai-backend/lists"}