{"id":21974670,"url":"https://github.com/abdulawalarif/ecommerce_backend_drf","last_synced_at":"2025-09-04T02:34:32.257Z","repository":{"id":258441479,"uuid":"871455592","full_name":"abdulawalarif/ecommerce_backend_DRF","owner":"abdulawalarif","description":" E-commerce Product API  app using Django REST framework","archived":false,"fork":false,"pushed_at":"2024-10-21T23:35:32.000Z","size":40919,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-28T15:48:28.631Z","etag":null,"topics":["authentication","django","django-rest-framework","ecommerce","python","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/abdulawalarif.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":"2024-10-12T02:47:22.000Z","updated_at":"2024-10-30T01:35:24.000Z","dependencies_parsed_at":"2024-11-29T15:47:42.561Z","dependency_job_id":"59e21f83-e2b0-4719-b633-5dfdbb3369e8","html_url":"https://github.com/abdulawalarif/ecommerce_backend_DRF","commit_stats":null,"previous_names":["abdulawalarif/ecommerce_backend_drf"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/abdulawalarif/ecommerce_backend_DRF","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdulawalarif%2Fecommerce_backend_DRF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdulawalarif%2Fecommerce_backend_DRF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdulawalarif%2Fecommerce_backend_DRF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdulawalarif%2Fecommerce_backend_DRF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abdulawalarif","download_url":"https://codeload.github.com/abdulawalarif/ecommerce_backend_DRF/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdulawalarif%2Fecommerce_backend_DRF/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273542269,"owners_count":25124123,"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-09-04T02:00:08.968Z","response_time":61,"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":["authentication","django","django-rest-framework","ecommerce","python","rest-api"],"created_at":"2024-11-29T15:47:08.661Z","updated_at":"2025-09-04T02:34:32.217Z","avatar_url":"https://github.com/abdulawalarif.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Django REST Framework E-commerce API with Authentication (GET, POST, PUT, DELETE)\n\n\n## This project provides a Django REST API for an e-commerce platform, supporting CRUD operations (Create, Read, Update, Delete) for products. It includes user authentication for secure access to product data manipulation only (update, delete and create). But user can read for data without auth token.\n\n## Features\n* Secure authentication using Django Rest Framework Authentication (JWT Toke)\n* Full CRUD support for managing products\n* Supports multiple images uploads for products\n* API endpoints GET, POST, PUT, and DELETE\n* Lightweight and fast, perfect for small to medium-scale e-commerce platforms\n\n\n\n\n## Authentication\n\nUse the provided authentication mechanism to obtain tokens.\n\n\n\n* Register User:\n* Fill these 3 fields\n\n\n\n```bash\n  URL: POST to Base_URL/api/auth/register\n  username #PK\n  email\n  password\n```\n\n* Login User:\n\n\n\n```bash\n  POST to Base_URL/api/auth/login\n  username \n  password\n```\n\n\n![Login and Registration visualized ](\u003cscreenshots/auth.jpg\u003e)\n\n \n\nOn successful login, you will receive an authentication token to be used in the header for subsequent write requests.\n\n\n\n# API Endpoints\n## Product Endpoints\n\n* Get All Products:\n\n\n```bash\nGET request to Base_URL/api/products\n```\n\n* Get a Single Product:\n\n\n```bash\nGET request to Base_URL/api/product/product_id\n```\n\n\n![Fetching products from Database ](\u003cscreenshots/fetchProduct.jpg\u003e)\n\n \n* Create Product (Authenticated):\n\n```bash\nPOST request to Base_URL/api/product/products\n# with title, description, num_of_prod_on_stock, price, uploaded_images\n# With Auth token\n```\n\n![Creating products](\u003cscreenshots/createProduct.jpg\u003e)\n\n* Update Product (Authenticated):\n\n\n```bash\nPUT request to Base_URL/api/product/id_of_item\n# with title, description, num_of_prod_on_stock, price, uploaded_images\n# With Auth token\n```\n \n\n![Update products](\u003cscreenshots/updateProd.jpg\u003e)\n\n* Delete Product (Authenticated):\n\n```bash\nDELETE request to Base_URL/api/product/delete/id_of_item\n# With Auth token\n```\n \n\n \n \n\n## Run Locally\n\n1. Clone the project\n\n```bash\n  git clone https://github.com/abdulawalarif/ecommerce_backend_DRF.git\n```\n\n2. Go to the project directory\n\n```bash\n  cd ecommerce_backend_DRF \u0026\u0026 cd ecommerce_backend\n```\n\n3. Create a virtual environment\n\n```bash\n  python3 -m venv .ecom_env\n```\n\n4. Activate the virtual environment\n\n```bash\n  source .ecom_env/bin/activate\n```\n\n\n5. Install all the packages\n\n```bash\n  pip install -r requirements.txt\n```\n\n6. go to the ecommerce_backend/settings.py and change the databse to Sqlite\n\n\n```bash\nDATABASES = {\n    'default': {\n        'ENGINE': 'django.db.backends.sqlite3',\n        'NAME': BASE_DIR / 'db.sqlite3',\n    }\n}\n```\n\nOr you can crate a SQL if you want to.\n\n7.  Now create migration for your database \n\n```bash\npython manage.py makemigrations\n```\n8. Now Create Tables and Fields for the database\n\n```bash\n python manage.py migrate\n```\n9. Run the project\n\n```bash\npython manage.py runserver\n```\n\n Now fill some data first with this URL POST request \n\n\n\n\n## How to tweak this project for your own uses\n\nIt's a good starter boilerplate, for an ecommerce app, Create models for categories and user's follow a good design architecture and make sure to Normalize the datababse for preventing overload or duplication of same data in multiple places.\n\n## Found a bug?\n\nIf you found an issue or would like to submit an improvement to this project,\nplease submit an issue using the issues tab above. If you would like to submit a PR with a fix, reference the issue you created!\n\n\n## Known issues (Work in progress)\n*  Update method do no delete images it just add new images with existing image list. \n\n\n## Author\n\n- [@abdulawalarif](https://github.com/abdulawalarif)\n  \n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdulawalarif%2Fecommerce_backend_drf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabdulawalarif%2Fecommerce_backend_drf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdulawalarif%2Fecommerce_backend_drf/lists"}