{"id":21992200,"url":"https://github.com/amarjotsinghh/uber-api-dockerized","last_synced_at":"2026-04-06T08:01:59.668Z","repository":{"id":261637623,"uuid":"884785992","full_name":"amarjotsinghh/uber-api-dockerized","owner":"amarjotsinghh","description":"A Python/Flask web app demonstrating Uber API integration, containerized with Docker for easy deployment. This app showcases key Uber API endpoints, OAuth authentication, and can be hosted locally or on cloud platforms like AWS EC2 and Heroku.","archived":false,"fork":false,"pushed_at":"2024-11-07T15:54:58.000Z","size":2557,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T03:32:17.390Z","etag":null,"topics":["containerization","docker","dockerfile","flask-application","linux","python"],"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/amarjotsinghh.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":"2024-11-07T11:43:15.000Z","updated_at":"2024-11-07T16:46:35.000Z","dependencies_parsed_at":"2024-11-07T16:43:10.622Z","dependency_job_id":"46a94d5b-815b-4f03-b7ca-9044f867a295","html_url":"https://github.com/amarjotsinghh/uber-api-dockerized","commit_stats":null,"previous_names":["amarjotsinghh/uber-api-dockerized"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/amarjotsinghh/uber-api-dockerized","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amarjotsinghh%2Fuber-api-dockerized","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amarjotsinghh%2Fuber-api-dockerized/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amarjotsinghh%2Fuber-api-dockerized/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amarjotsinghh%2Fuber-api-dockerized/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amarjotsinghh","download_url":"https://codeload.github.com/amarjotsinghh/uber-api-dockerized/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amarjotsinghh%2Fuber-api-dockerized/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31464110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"online","status_checked_at":"2026-04-06T02:00:07.287Z","response_time":112,"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":["containerization","docker","dockerfile","flask-application","linux","python"],"created_at":"2024-11-29T20:13:05.851Z","updated_at":"2026-04-06T08:01:59.652Z","avatar_url":"https://github.com/amarjotsinghh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n---\n\n# uber-api-dockerized\n\n[![TravisCI](https://travis-ci.org/uber/Python-Sample-Application.svg?branch=master)](https://travis-ci.org/uber/Python-Sample-Application)  \n[![Coverage Status](https://coveralls.io/repos/uber/Python-Sample-Application/badge.png)](https://coveralls.io/r/uber/Python-Sample-Application)\n\n**Official Uber Developer Documentation:**  \n[Uber Developer Portal](https://developer.uber.com/)\n\n---\n\n### Introduction\n\nThis repository contains a simple Python/Flask web application that integrates with Uber’s external API. Designed as a practical example, this project demonstrates how to use Uber’s API to build web applications that interact with Uber’s ride-sharing services. It provides developers with an accessible and extensible starting point to develop more complex applications and services on top of Uber’s capabilities.\n\nThe application is built using Python 2.7, and it showcases various Uber API endpoints for developers to experiment with and integrate into their own applications. The repository includes detailed documentation, making it easy for developers to understand and extend the functionality of the app. This app can be hosted locally or deployed to cloud platforms such as Heroku or AWS EC2.\n\n---\n\n### Features of the Application\n\n- **Uber API Integration:** The app connects to Uber's external API to access a variety of services such as ride-hailing, user profile, and ride history.\n- **Flask Web Framework:** The app is built using Flask, a micro-framework for Python that is easy to use and scalable.\n- **OAuth Authentication:** The application allows users to authenticate with Uber's API using OAuth, providing secure access to user data.\n- **Local and Cloud Deployment:** This app can be run locally on your development machine or deployed to cloud services like Heroku and AWS EC2 for wider accessibility.\n- **Customizable:** Developers can extend and customize the application to suit their specific use cases, such as adding new API endpoints or integrating with other services.\n\n---\n\n### Prerequisites\n\nBefore you start using the application, ensure that the following prerequisites are met:\n\n1. **Python 2.7:**  \n   The application is developed using Python 2.7, and thus it is crucial to ensure that Python 2.7 is used in the environment where the app is being run. Python 2.7 is deprecated, but this application maintains compatibility for legacy reasons.\n   \n2. **Docker:**  \n   Docker is used to containerize the application, ensuring that it runs consistently across different environments. If you wish to deploy the app using Docker, make sure Docker is installed and running on your local machine or cloud instance.\n   \n3. **AWS EC2 Instance (Optional):**  \n   If you plan to deploy the app on AWS EC2, you will need to have an EC2 instance running and Docker installed on it.\n\n4. **Heroku (Optional):**  \n   The application can also be deployed to Heroku, a popular cloud platform for hosting web applications.\n\n---\n\n### How to Set Up and Use the Application\n\nFollow these steps to get the Uber Python Sample Application up and running:\n\n#### Step 1: Clone the Repository\n\nClone the Uber Python Sample Application repository to your local machine:\n\n```bash\ngit clone https://github.com/uber/Python-Sample-Application.git\n```\n\n#### Step 2: Navigate to the Project Directory\n\nChange to the project directory to access the application files:\n\n```bash\ncd Python-Sample-Application\n```\n\n#### Step 3: Modify the `app.py` File\n\nIn order to make the application accessible over the internet (not just on `localhost`), you need to modify the `app.py` file. Open the file using a text editor (such as `vim`, `nano`, or any IDE), and find the line where the Flask app is run. Modify the `app.run()` line to:\n\n```python\napp.run(host=\"0.0.0.0\", debug=True, port=7000)\n```\n\n- `host=\"0.0.0.0\"` allows the application to accept requests from external sources, making it accessible over the internet.\n- `port=7000` specifies the port that the Flask application will run on.\n\nOnce you've made this change, save and close the file.\n\n#### Step 4: Docker Setup\n\nThe easiest way to run this application is within a Docker container. To package the application into a Docker container, you will need a Dockerfile. Here’s the Dockerfile that ensures the application runs correctly in an isolated environment:\n\n```Dockerfile\n# Use a base image compatible with Python 2\nFROM python:2.7\n\n# Set the working directory in the container\nWORKDIR /app\n\n# Copy the application code to the container\nCOPY . /app\n\n# Install any dependencies specified in requirements.txt\nRUN pip install --no-cache-dir -r requirements.txt\n\n# Expose port 7000 to the outside\nEXPOSE 7000\n\n# Run the application\nCMD [\"python\", \"app.py\"]\n```\n\nThis Dockerfile defines the following:\n\n- **Base Image:** `python:2.7` is used as the base image to run the application in Python 2.7.\n- **Working Directory:** The working directory `/app` is set inside the container where the application files will reside.\n- **Copying Application Files:** The application files are copied into the container.\n- **Installing Dependencies:** The required Python dependencies are installed from `requirements.txt`.\n- **Exposing Port 7000:** Port 7000 is exposed to allow access to the application.\n- **Running the Application:** The Flask app is run when the container starts.\n\n#### Step 5: Build the Docker Image\n\nOnce your Dockerfile is ready, build the Docker image by running the following command in the terminal:\n\n```bash\ndocker build -t uber-python-sample-app .\n```\n\nThis command will build the Docker image and tag it with the name `uber-python-sample-app`.\n\n#### Step 6: Run the Docker Container\n\nTo run the application inside a Docker container and expose it on port 7000, execute the following command:\n\n```bash\ndocker run -d -p 7000:7000 uber-python-sample-app\n```\n\nThe `-d` flag runs the container in detached mode, and the `-p 7000:7000` flag binds the container’s port 7000 to the host’s port 7000.\n\n#### Step 7: Access the Application\n\nOnce the container is running, you can access the application:\n\n- If running locally, open your browser and navigate to:\n  ```\n  http://localhost:7000\n  ```\n\n- If deploying on an EC2 instance, use the public IP of the EC2 instance to access the application:\n  ```\n  http://\u003cec2-public-ip\u003e:7000\n  ```\n\nYou should now see the Flask application running, providing access to Uber's API functionality.\n\n---\n\n### Testing the Application\n\nTo ensure everything is working properly, you can run the provided tests:\n\n#### Step 1: Install Testing Dependencies\n\nThe application uses `make` for dependency management. To install the required dependencies for testing, run the following command:\n\n```bash\nmake bootstrap\n```\n\n#### Step 2: Run the Tests\n\nTo run the tests and validate the functionality of the application, use:\n\n```bash\nmake test\n```\n\n#### Step 3: Regenerate Test Fixtures\n\nIf you need to regenerate the test fixtures, follow these steps:\n\n1. Run the application to obtain an `auth_token` from the main page.\n2. Copy the `auth_token` and replace it in the `test_endpoints.py` file where it is used.\n3. Run the tests again to ensure everything is functioning properly.\n\n---\n\n### Contributing to the Application\n\nWe welcome contributions from the community! If you would like to contribute to this project, please follow these steps:\n\n#### Step 1: Open a Ticket\n\nIf you find a bug or want to suggest a feature, please open an issue on GitHub. Ensure that the issue is detailed and provides enough context for the maintainers to understand the problem or request.\n\n#### Step 2: Fork the Repository\n\nIf you plan to contribute code, fork the repository and create a new branch for your changes. This helps keep the main codebase clean and makes it easier to manage multiple contributions.\n\n#### Step 3: Submit a Pull Request\n\n- When submitting a pull request, make sure to include tests for the changes you have made.\n- Ensure that the application passes the full test suite by running:\n  ```bash\n  make test\n  ```\n\n---\n\n### Deploying to Heroku\n\nYou can easily deploy this application to Heroku, a cloud platform for hosting applications. To deploy the app to Heroku, click the button below:\n\n[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)\n\nAfter deploying to Heroku, you will need to configure the **redirect URI** in the Uber Developer Portal to match your Heroku application’s URL:\n\n- Set your Uber OAuth app's redirect URI to:\n  ```\n  https://{your-app-name}.herokuapp.com/submit\n  ```\n\nYou should also configure the `FLASK_DEBUG` environment variable to `False` on Heroku to properly serve the application with SSL traffic.\n\n---\n\n### Making Requests to Uber API\n\nThe base URL for all Uber API requests is:\n```\nhttps://api.uber.com/v1/\n```\n\nFor a complete list of available endpoints, visit the [Uber API Endpoints Documentation](https://developer.uber.com/v1/endpoints/).\n\n---\n\nLet me know if you'd like to make any further adjustments or need additional details!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famarjotsinghh%2Fuber-api-dockerized","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famarjotsinghh%2Fuber-api-dockerized","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famarjotsinghh%2Fuber-api-dockerized/lists"}