{"id":15321928,"url":"https://github.com/akmamun/quart-pymngo","last_synced_at":"2025-04-05T12:22:07.864Z","repository":{"id":106931112,"uuid":"219035924","full_name":"akmamun/quart-pymngo","owner":"akmamun","description":"Asynchronous Python with Quart and Mongo DB  Boilerplate","archived":false,"fork":false,"pushed_at":"2020-02-06T17:39:00.000Z","size":236,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T23:36:26.120Z","etag":null,"topics":["asyncio","boilerplate","custom-validation","motor","pymongo","quart","rest-api"],"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/akmamun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2019-11-01T17:53:02.000Z","updated_at":"2022-03-13T17:48:52.000Z","dependencies_parsed_at":"2023-04-01T03:05:00.165Z","dependency_job_id":null,"html_url":"https://github.com/akmamun/quart-pymngo","commit_stats":{"total_commits":29,"total_committers":1,"mean_commits":29.0,"dds":0.0,"last_synced_commit":"80a91e450ecf6090d3a5b30d553cc5dbeb79911e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akmamun%2Fquart-pymngo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akmamun%2Fquart-pymngo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akmamun%2Fquart-pymngo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akmamun%2Fquart-pymngo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akmamun","download_url":"https://codeload.github.com/akmamun/quart-pymngo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247334053,"owners_count":20922133,"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":["asyncio","boilerplate","custom-validation","motor","pymongo","quart","rest-api"],"created_at":"2024-10-01T09:13:39.895Z","updated_at":"2025-04-05T12:22:07.844Z","avatar_url":"https://github.com/akmamun.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Model Based Restful Quart and Mongo DB\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"280\" height=\"140\" src=\"https://motor.readthedocs.io/en/stable/_images/motor.png\"\u003e\n\u003c/p\u003e\n\n### Note: API Integration with React [react-api-integration](https://github.com/mrxmamun/react-api-integration.git)\n#### Model based restful quart (python) and asynchronous mongo db. Integrate with any API development.  \n\n### Create [virtual environment]('https://docs.python.org/3/library/venv.html) and install requirements \n```sh\npip install -r requirements.txt\n```\n### Configure Database\n#### From [config.py](src/config.py) configure datbase url, name, user and password \n```json\n {\n   \"db\": {\n            \"url\" : \"mongodb://localhost:27017/\",\n            \"name\" :\"db_name\",  \n            \"user\" :\"\",\n            \"password\" :\"\"\n    }\n }\n``` \n\n## In model update collection name and desire fields name and fields type. For example see todo [model](src/models/todo.py) file\n#### From [model](src/models) folder write your individual model and configure db collection name, fields name and fields type\n#### Example\n##### In todo [model](src/models/todo.py) update collection name, fields name and fields type\n```py\ncollection_name = 'todos'   # collection name\nfields = {   \n    \"title\"     : \"string\",\n    \"body\"      : \"string\",\n    \"created\"   : \"datatime\"\n} \n```\n\n##### Update required fields, optional fields from todo [model](src/models/todo.py)\n```py\ncreate_required_fields = []  # example create_required_fields = [\"title\", \"body\"]\ncreate_optional_fields = []  # example create_required_fields = [\"created\"]\nupdate_required_fields = []\nupdate_optional_fields = []\n```\n#### Example \n```py\ncreate_required_fields = [\"title\", \"body\"] \ncreate_optional_fields = []  \nupdate_required_fields = [\"title\", \"body\"]\nupdate_optional_fields = []\n```\n#### In [Database](src/factory/database.py) insert, find , find_by_id, update and delete methods are generalize methods.  \n#### Those methods are call from [model](src/models) \n- `insert` method store data to database after confirm validation from model \n- `find` method retries all data from mongo database \n- `find_by_id` method retries back a single search data\n- `update` method store updated data to database with corresponding id \n- and `delete` method delete data from database with corresponding id \n\n### Lets run the App\n```sh\npython app.py \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakmamun%2Fquart-pymngo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakmamun%2Fquart-pymngo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakmamun%2Fquart-pymngo/lists"}