{"id":18398584,"url":"https://github.com/mongodb-developer/beanie-example","last_synced_at":"2025-04-07T04:33:54.684Z","repository":{"id":98127743,"uuid":"349101201","full_name":"mongodb-developer/beanie-example","owner":"mongodb-developer","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-11T12:48:41.000Z","size":26,"stargazers_count":14,"open_issues_count":2,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-22T13:51:25.674Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mongodb-developer.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":"2021-03-18T14:19:14.000Z","updated_at":"2025-01-08T03:35:23.000Z","dependencies_parsed_at":"2023-03-07T16:45:14.571Z","dependency_job_id":null,"html_url":"https://github.com/mongodb-developer/beanie-example","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/mongodb-developer%2Fbeanie-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongodb-developer%2Fbeanie-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongodb-developer%2Fbeanie-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongodb-developer%2Fbeanie-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mongodb-developer","download_url":"https://codeload.github.com/mongodb-developer/beanie-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247595370,"owners_count":20963939,"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-06T02:22:52.819Z","updated_at":"2025-04-07T04:33:53.455Z","avatar_url":"https://github.com/mongodb-developer.png","language":"Python","readme":"# Building a Cocktail API with Beanie!\n\nThis is a sample cocktail API built with [MongoDB](https://www.mongodb.com/company/what-is-mongodb),\n[Beanie](https://beanie-odm.dev/),\nand [FastAPI](https://fastapi.tiangolo.com/).\n\nThis code was written to try out Beanie and was used to write a [blog post](https://developer.mongodb.com/article/beanie-odm-fastapi-cocktails/),\nwhich may be more interesting than this code.\n\n## Install It\n\nRun the following to install the project (and dev dependencies) into your active virtualenv:\n\n```bash\npython -m pip install -e .[dev]\n```\n\n## Initialize Your Database\n\nThe previous step installs a script, `init-db`, that will generate some random\ncocktails for you, if you want:\n\n```bash\n# This will create 100 dummy cocktails in your database\n# (or run without --dummy-data to just initialize indexes.):\nexport MONGODB_URL=\"mongodb+srv://\u003cuser\u003e:\u003cpass\u003e@host/database\"\ninit-db --dummy-data\n```\n\n\u003e **Don't consume any of the cocktails this script generates, they're randomly generated!\n\n\n## Run It\n\nIf you have an Atlas database you can run the server with:\n\n```bash\nexport MONGODB_URL=\"mongodb+srv://\u003cuser\u003e:\u003cpass\u003e@host/database\"\nuvicorn beaniecocktails:app --reload\n```\n\nYou should then be able to view your API docs at http://127.0.0.1:8000/docs/\n\n\u003e **Note:** This app will only work on MongoDB Atlas clusters, because it makes use of [Atlas Search](https://docs.atlas.mongodb.com/atlas-search/).\n\n## Feedback\n\nI'd love to know whether you found this useful, or if you had any problems.\nPlease leave feedback on the [MongoDB Community Forums](https://developer.mongodb.com/community/forums/) and tag me `@Mark_Smith`.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmongodb-developer%2Fbeanie-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmongodb-developer%2Fbeanie-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmongodb-developer%2Fbeanie-example/lists"}