{"id":15192086,"url":"https://github.com/phaniteja5789/containerized-data-ingestion-api-with-fastapi-and-mongodb","last_synced_at":"2026-02-12T04:08:17.018Z","repository":{"id":173331403,"uuid":"650307490","full_name":"phaniteja5789/Containerized-Data-Ingestion-API-with-FastAPI-and-MongoDB","owner":"phaniteja5789","description":"Developed an API using FastAPI that gets the data and stores the data in MongoDB. The entire process runs in containers using Docker ","archived":false,"fork":false,"pushed_at":"2023-06-07T12:27:11.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T12:39:39.606Z","etag":null,"topics":["docker","docker-image","docker-volumes","dockercompose","dockerfile","fastapi","mongodb"],"latest_commit_sha":null,"homepage":"","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/phaniteja5789.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":"2023-06-06T19:43:23.000Z","updated_at":"2024-08-20T18:27:47.000Z","dependencies_parsed_at":"2023-09-26T13:56:24.684Z","dependency_job_id":null,"html_url":"https://github.com/phaniteja5789/Containerized-Data-Ingestion-API-with-FastAPI-and-MongoDB","commit_stats":null,"previous_names":["phaniteja5789/fastapi_docker","phaniteja5789/containerized-data-ingestion-api-with-fastapi-and-mongodb"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/phaniteja5789/Containerized-Data-Ingestion-API-with-FastAPI-and-MongoDB","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phaniteja5789%2FContainerized-Data-Ingestion-API-with-FastAPI-and-MongoDB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phaniteja5789%2FContainerized-Data-Ingestion-API-with-FastAPI-and-MongoDB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phaniteja5789%2FContainerized-Data-Ingestion-API-with-FastAPI-and-MongoDB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phaniteja5789%2FContainerized-Data-Ingestion-API-with-FastAPI-and-MongoDB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phaniteja5789","download_url":"https://codeload.github.com/phaniteja5789/Containerized-Data-Ingestion-API-with-FastAPI-and-MongoDB/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phaniteja5789%2FContainerized-Data-Ingestion-API-with-FastAPI-and-MongoDB/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271061478,"owners_count":24692546,"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","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["docker","docker-image","docker-volumes","dockercompose","dockerfile","fastapi","mongodb"],"created_at":"2024-09-27T21:04:51.313Z","updated_at":"2026-02-12T04:08:16.975Z","avatar_url":"https://github.com/phaniteja5789.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastAPI_Docker\nDeveloped an API using FastAPI that gets the data and stores the data in MongoDB. The entire process runs in containers using Docker \n\n\n**Steps**\n  1.) \n      Developed an API that is used to get the details from a Public API to retrieve the data.\n      The Public API used is **\"https://randomuser.me/api/\"**\n\n   2.)\n       Once the details is fetched, we will store the details in MongoDB.\n       \n   3.) \n       Run the application inside container using **Docker**\n      \n Installed Modules\n  \n    1.) pymongo ==\u003e Mongo DB Driver for Python\n    2.) fastapi ==\u003e API is developed using FastAPI\n    3.) requests ==\u003e In order to get the data from the Public API\n    4.) uvicorn ==\u003e To run the fastapi on the Uvicorn server\n    \n    All the modules are present in the \"Requirements.txt\"\n    \n    Dockerfile and DockerCompose files are present in the Code Repository\n    \n  Dockerfile\n  \n    FROM python:latest ==\u003e Fastapi is developed in python. So using Python as Base Image\n\n    WORKDIR /code ==\u003e To make \"code\" as a directory inside container as working directory\n\n    COPY ./requirements.txt /code/requirements.txt ==\u003e copying the requirements file from local to container working directory\n\n    RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt ==\u003e Installing all the modules present in requirements.txt in docker container\n\n    COPY ./app /code/app ==\u003e copying all the source code from local to docker container file system\n\n    CMD [\"uvicorn\",\"app.sourcecode:app\",\"--host\",\"0.0.0.0\",\"--port\",\"8000\"] ==\u003e Running the fastAPI server using CMD with options\n    \n  Docker Commands\n  \n    **docker build -t fastapi .** ==\u003e fastapi == Image name, . == Dockerfile to build an image\n   \n  Docker Compose\n      \n      version: '3'\n      services:\n        mongodb:\n          image: mongo\n          ports:\n            - 27017:27017\n          volumes:\n            - mongovolume:/var/lib/mongodb/data\n        fastcontainer:\n          image: fastapi\n          ports:\n            - 8000:8000  \n      volumes:\n        mongovolume: {}\n    \n    mongodb and fastcontainer are the names of the containers\n    mongo,fastapi are the image names\n    ports to bind the localhost with docker container ports\n    volumes to persist the data, so that data is persisted even the container got deleted\n    \n   Docker Command\n   \n    docker-compose -f dockercompose.yaml up ==\u003e To start the containers present inside the dockercompose.yaml file\n    docker-compose -f dockercompose.yaml down ==\u003e To stop the containers present inside the dockercompose.yaml file\n    \n    docker exec -it container_name bash ==\u003e To run the container in bash mode\n    \n    docker ps ==\u003e To list the containers\n    \n  Output of the details is fetched it will be stored in MongoDB. The data is persisted using **Docker Volumes**\n  \n  The Data stored in MongoDB\n  \n\u003cimg width=\"958\" alt=\"image\" src=\"https://github.com/phaniteja5789/FastAPI_Docker/assets/36558484/d32bc712-a8a3-4189-b469-b913e8780cdc\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphaniteja5789%2Fcontainerized-data-ingestion-api-with-fastapi-and-mongodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphaniteja5789%2Fcontainerized-data-ingestion-api-with-fastapi-and-mongodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphaniteja5789%2Fcontainerized-data-ingestion-api-with-fastapi-and-mongodb/lists"}