{"id":21135647,"url":"https://github.com/aalug/e_commerce_drf","last_synced_at":"2026-04-13T06:01:46.547Z","repository":{"id":152686840,"uuid":"617678903","full_name":"aalug/e_commerce_drf","owner":"aalug","description":"E-commerce API built with the Django REST framework","archived":false,"fork":false,"pushed_at":"2023-04-16T19:57:18.000Z","size":114,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-14T12:45:11.192Z","etag":null,"topics":["api","backend","celery","django","django-rest-framework","djangorestframework","docker","drf","drf-spectacular","elasticsearch","postgres","python","rabbitmq","redis","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aalug.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-03-22T22:06:49.000Z","updated_at":"2023-05-15T13:17:36.000Z","dependencies_parsed_at":"2023-04-17T23:03:19.308Z","dependency_job_id":null,"html_url":"https://github.com/aalug/e_commerce_drf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aalug/e_commerce_drf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aalug%2Fe_commerce_drf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aalug%2Fe_commerce_drf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aalug%2Fe_commerce_drf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aalug%2Fe_commerce_drf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aalug","download_url":"https://codeload.github.com/aalug/e_commerce_drf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aalug%2Fe_commerce_drf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271019903,"owners_count":24685763,"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":["api","backend","celery","django","django-rest-framework","djangorestframework","docker","drf","drf-spectacular","elasticsearch","postgres","python","rabbitmq","redis","rest-api"],"created_at":"2024-11-20T06:56:56.506Z","updated_at":"2026-04-13T06:01:41.511Z","avatar_url":"https://github.com/aalug.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# Django REST framework e-commerce app\r\n\r\nThe app is built with the **Django REST framework**.\r\n\r\nThe app uses:\r\n\r\n- Docker\r\n- Postgres\r\n- Elasticsearch\r\n- Celery\r\n- RabbitMQ\r\n- Redis\r\n- drf-spectacular for documentation\r\n\r\n## Getting started\r\n\r\n1. Clone the repository.\r\n2. Rename `.env.sample` to `.env` and replace the values\r\n3. Run in your terminal `docker-compose up --build`\r\n4. Now everything should be set up and app's documentation available on http://localhost:8000/api/docs/\r\n\r\n\r\n## Sample data\r\nTo get sample data:\r\n1. With running containers run `docker ps` and get the ID of the app container\r\n2. Run `docker exec -itu 0 \u003ccontainer ID\u003e sh` to get access to the container's shell\r\n3. In the bash terminal, run the following commands:\r\n- `python manage.py populate_store` to create in the database objects for a book store (this is just an example, database was not designed with this in mind, it was created as a universal database)\r\n\r\nor\r\n\r\n- `python manage.py makemigrations` and `python manage.py migrate` first. Then:\r\n- `python manage.py loaddata category_fixtures.json`\r\n- `python manage.py populate_products`\r\n- `python manage.py populate_brands`\r\n- `python manage.py populate_product_inventories`\r\n- `python manage.py populate_stock`\r\n- `python manage.py populate_attributes`\r\n- `python manage.py populate_product_images` \r\nto create sample data for each model individually.\r\n\r\n## Testing\r\n\r\nTo run tests:\r\n1. If containers are not running, run in your terminal `docker-compose up`\r\n2. In the second terminal tab, run `docker ps` and get the ID of the app container\r\n3. Run `docker exec -itu 0 \u003ccontainer ID\u003e sh` to get access to the container's shell\r\n4. Run `python manage.py test` to run all tests or `python manage.py test \u003capp-name\u003e.tests` to run tests for a specific\r\n   app\r\n\r\n\r\n## Elasticsearch\r\nTo create indexes run in the container's shell `python manage.py search_index --rebuild`\r\n\r\n\r\n## API Endpoints\r\n\r\nAll endpoints are available on http://localhost:8000/api/docs/.\r\nAfter running containers, this will provide you with complete and easy-to-use documentation.\r\nIt also gives the option to use every endpoint of this API.\r\n\r\n#### Users app\r\n\r\n- Use `/api/users/create/` to create a new user\r\n- Then use `/api/users/token/` to create a token for the created user\r\n- Use `/api/users/profile/` to retrieve user details and update password and user profile details\r\n- Use `/api/users/forgot-password/` to send an email with a link to reset the password\r\n\r\n#### Inventory app\r\n- Use `/api/inventory/main-categories/` to list all main categories - that do not have a parent category\r\n- Use `/api/inventory/categories/{id}/` to get category with all children categories\r\n- Use `/api/inventory/products/` to list all products.\r\nAvailable `query_params`:\r\n  + `attribute-values` - a list of ids of attribute values. For example `?attribute-values=1,5,20`\r\n  + `brand` - a list of ids of brands. For example `?brand=1,5,20`\r\n  + `price` - a price range for products in `int,int` format. For example `?price=3,12`\r\n  + `search` - an elasticsearch search feature. For example `?search=foo`\r\n- Use `/api/inventory/products-by-category/{id}/` to list all products from a given category. \r\nIt is handled by the same APIView as `/api/inventory/products/` endpoint, so it also accepts\r\n`query_params` listed above.\r\n- Use `/api/inventory/products/{id}/` to retrieve product details.\r\n- Use `/api/inventory/attribute-values/` to list all product attribute values. \r\n\r\n#### Orders app\r\n- Use `/api/orders/` to create a new order and list all orders of the logged-in user. \r\n\r\n\r\n### More Information\r\nThis app uses [djangorestframework-camel-case](https://github.com/vbabiy/djangorestframework-camel-case) to enable the server to send and receive data in a format that is compatible with TypeScript. This package provides support for camel-case style serialization and deserialization, which is appropriate for the conventions used in Vue.js.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faalug%2Fe_commerce_drf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faalug%2Fe_commerce_drf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faalug%2Fe_commerce_drf/lists"}