{"id":13678561,"url":"https://github.com/Yezz123-Archive/Apollo","last_synced_at":"2025-04-29T15:31:59.336Z","repository":{"id":103635147,"uuid":"385766999","full_name":"Yezz123-Archive/Apollo","owner":"Yezz123-Archive","description":"A basic Application with multiple functionalities built with FastAPI aim to help Users Buy New Items Provided using PaypalAPI :rocket:","archived":false,"fork":false,"pushed_at":"2023-07-13T06:18:52.000Z","size":42,"stargazers_count":26,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-08-02T13:23:37.230Z","etag":null,"topics":["api","ecommerce","fastapi","fastapi-crud","fastapi-sqlalchemy","model","paypal","rest-api","sqlalchemy","sqlite"],"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/Yezz123-Archive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"custom":["https://paypal.me/yassertahiri"]}},"created_at":"2021-07-14T00:15:44.000Z","updated_at":"2023-07-13T06:18:58.000Z","dependencies_parsed_at":"2024-01-14T15:23:30.274Z","dependency_job_id":"383b3233-5a92-4b19-b35e-268228ea892d","html_url":"https://github.com/Yezz123-Archive/Apollo","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/Yezz123-Archive%2FApollo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yezz123-Archive%2FApollo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yezz123-Archive%2FApollo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yezz123-Archive%2FApollo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yezz123-Archive","download_url":"https://codeload.github.com/Yezz123-Archive/Apollo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224178929,"owners_count":17268973,"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","ecommerce","fastapi","fastapi-crud","fastapi-sqlalchemy","model","paypal","rest-api","sqlalchemy","sqlite"],"created_at":"2024-08-02T13:00:55.178Z","updated_at":"2024-11-11T21:30:41.197Z","avatar_url":"https://github.com/Yezz123-Archive.png","language":"Python","funding_links":["https://paypal.me/yassertahiri","https://developer.paypal.com/docs/api/reference/api-requests/","https://developer.paypal.com/docs/api/overview/"],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"![apollo](.github/header.svg)\n\n# Apollo\n\nA basic Application with multiple functionalities built with FastAPI aim to help Users Buy New Items Provided by PaypalAPI to Complete the Payment and Check it.\n\n## Getting Started\n\nApollo provide a Basic API Compose :\n\n\u003col\u003e\n    \u003cli\u003eUsers\u003c/li\u003e\n\u003col\u003e\n        \u003cli\u003elogin : \u003ccode\u003ehttp://localhost:8000 user/login\u003c/code\u003e \u003c/li\u003e\n        \u003cli\u003eRegister : \u003ccode\u003ehttp://localhost:8000/user/register\u003c/code\u003e\u003c/li\u003e\n        \u003cli\u003eGet User : \u003ccode\u003ehttp://localhost:8000/user/get_user/{username}\u003c/code\u003e\u003c/li\u003e\n\u003c/ol\u003e\n    \u003cli\u003eItems\u003c/li\u003e\n\u003col\u003e\n        \u003cli\u003eAdd Item : \u003ccode\u003ehttp://localhost:8000/item/add_item\u003c/code\u003e\u003c/li\u003e\n        \u003cli\u003eGet Item : \u003ccode\u003ehttp://localhost:8000/item/get_item/{id}\u003c/code\u003e\u003c/li\u003e\n        \u003cli\u003eDelete Item : \u003ccode\u003ehttp://localhost:8000/item/get_item/{id}\u003c/code\u003e\u003c/li\u003e\n\u003c/ol\u003e\n    \u003cli\u003ePayment\u003c/li\u003e\n\u003col\u003e\n        \u003cli\u003eAdd Item to Cart : \u003ccode\u003ehttp://localhost:8000/cart/add_to_cart/{username}\u003c/code\u003e\u003c/li\u003e\n        \u003cli\u003eProvide Item to Payments : \u003ccode\u003ehttp://localhost:8000/cart/payment\u003c/code\u003e\u003c/li\u003e\n        \u003cli\u003eMoney Callback : \u003ccode\u003ehttp://localhost:8000/cart/callback\u003c/code\u003e\u003c/li\u003e\n        \u003cli\u003eDelete Cart Item : \u003ccode\u003ehttp://localhost:8000/cart/delete_cart_item/{id}\u003c/code\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\u003c/ol\u003e\n\n\u003e I pre-configured the Cruds with the payment process based on `PaypalAPI`, you can read the Official docs here [REST APIs / API Requests](https://developer.paypal.com/docs/api/reference/api-requests/)\n\n### Prerequisites\n\n- Python 3.9.2 or higher\n- FastAPI\n- Docker\n\n### Project setup\n\n```sh\n# clone the repo\n$ git clone https://github.com/yezz123/Apollo.git\n\n# move to the project folder\n$ cd Apollo\n```\n\n### Creating virtual environment\n\n- Install `pipenv` a global python project `pip install pipenv`\n- Create a `virtual environment` for this project\n\n```shell\n# creating pipenv environment for python 3\n$ pipenv --three\n\n# activating the pipenv environment\n$ pipenv shell\n\n# if you have multiple python 3 versions installed then\n$ pipenv install -d --python 3.8\n\n# install all dependencies (include -d for installing dev dependencies)\n$ pipenv install -d\n```\n\n### Running the Application\n\n- To run the [Main](main.py) we need to use [uvicorn](https://www.uvicorn.org/) a lightning-fast ASGI server implementation, using uvloop and httptools.\n\n```sh\n# Running the application using uvicorn\n$ uvicorn main:app\n\n## To run the Application under a reload enviromment use -- reload\n$ uvicorn main:app --reload\n```\n\n- Here we can Switch Between using [SWAGGER UI](https://swagger.io/tools/swagger-ui/) or [Redoc](https://redocly.github.io/redoc/) to Play around the API.\n\n- You can Now Start using the Application, i use a simple Template for the `index` file to simply launch `/docs` : \u003chttps://codepen.io/ma_suwa/pen/QWWqJBK\u003e\n\n### Configured Enviromment\n\n- To Provide a good work, i choose a `SQLite` Database using `SQLAlchemy`.\n- If you want to configure the Database with an other Provider like `MySQL` or `PostgreSQL` you can change the `Database_URL` here :\n\n- [Database.py](data/database.py) :\n\n```py\n# here you need to insert the Connection URL.\nSQLALCHEMY_DATABASE_URL = 'sqlite:///apollo.db'\n```\n\n- For Example\n\n```py\nSQLALCHEMY_DATABASE_URL = 'mysql://username:password@server/apollo'\n```\n\n## Running the Docker Container\n\n- We have the Dockerfile created in above section. Now, we will use the Dockerfile to create the image of the FastAPI app and then start the FastAPI app container.\n\n```sh\n$ docker build\n```\n\n- list all the docker images and you can also see the image `apollo:latest` in the list.\n\n```sh\n$ docker images\n```\n\n- run the application at port 5000. The various options used are:\n\n\u003e - `-p`: publish the container's port to the host port.\n\u003e - `-d`: run the container in the background.\n\u003e - `-i`: run the container in interactive mode.\n\u003e - `-t`: to allocate pseudo-TTY.\n\u003e - `--name`: name of the container\n\n```sh\n$ docker container run -p 5000:5000 -dit --name Apollo apollo:latest\n```\n\n- Check the status of the docker container\n\n```sh\n$ docker container ps\n```\n\n## Preconfigured Packages\n\nIncludes preconfigured packages to kick start Apollo API by just setting appropriate configuration.\n\n| Package                                                      | Usage                                                                                                                           |\n| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- |\n| [uvicorn](https://www.uvicorn.org/)                          | a lightning-fast ASGI server implementation, using uvloop and httptools.                                                        |\n| [PaypalAPI](https://developer.paypal.com/docs/api/overview/) | exchange these credentials for an access token that authorizes your REST API calls. To test your web and mobile apps.           |\n| [SQLAlchemy](https://www.sqlalchemy.org/)                    | is the Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL. |\n| [starlette](https://www.starlette.io/)                       | a lightweight ASGI framework/toolkit, which is ideal for building high performance asyncio services.                            |\n\n`yapf` packages for `linting and formatting`\n\n## Contributing\n\n- Join the Apollo Creator and Contribute to the Project if you have any enhancement or add-ons to create a good and Secure Project, Help any User to Use it in a good and simple way.\n\n## License\n\nThis program is free software under MIT license. Please see the [LICENSE](LICENSE) file in our repository for the full text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYezz123-Archive%2FApollo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FYezz123-Archive%2FApollo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYezz123-Archive%2FApollo/lists"}