{"id":28637297,"url":"https://github.com/abhaybraja/ecommerce","last_synced_at":"2026-05-06T11:34:32.843Z","repository":{"id":295952807,"uuid":"991798040","full_name":"abhaybraja/ecommerce","owner":"abhaybraja","description":"A Django-React based eCommerce platform with JWT authentication, supporting user-specific cart, order checkout, and conditional discount codes. Includes admin analytics and unit tests for a robust backend system.","archived":false,"fork":false,"pushed_at":"2025-05-28T08:12:04.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-05-28T08:20:07.603Z","etag":null,"topics":["django","ecommerce","jwt","rbac","reactjs"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abhaybraja.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-28T07:00:29.000Z","updated_at":"2025-05-28T08:12:07.000Z","dependencies_parsed_at":"2025-05-28T08:32:39.553Z","dependency_job_id":null,"html_url":"https://github.com/abhaybraja/ecommerce","commit_stats":null,"previous_names":["abhaybraja/ecommerce"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/abhaybraja/ecommerce","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhaybraja%2Fecommerce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhaybraja%2Fecommerce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhaybraja%2Fecommerce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhaybraja%2Fecommerce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abhaybraja","download_url":"https://codeload.github.com/abhaybraja/ecommerce/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhaybraja%2Fecommerce/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259518828,"owners_count":22870304,"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":["django","ecommerce","jwt","rbac","reactjs"],"created_at":"2025-06-12T18:10:12.583Z","updated_at":"2026-05-06T11:34:27.823Z","avatar_url":"https://github.com/abhaybraja.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🛒 eCommerce API with JWT \u0026 Discounts\nA Django-React based eCommerce platform with JWT authentication, supporting user-specific cart, order checkout, and conditional discount codes. Includes admin analytics and unit tests for a robust backend system.\n\n---\n\n## 🚀 Features\n\n- User authentication via JWT\n- Add to cart, view cart, checkout\n- Automatic discount code generation for every nth order\n- Admin-only endpoints for (RBAC)\n- Role-based permissions (`is_customer`, `is_admin_user`)\n- Unit tests included\n\n---\n\n## ⚙️ Installation\n\n```bash\n# Clone the repo\ngit clone https://github.com/abhaybraja/ecommerce.git\ncd ecommerce\n\n# Create and activate virtual environment\npython -m venv venv\nsource venv/bin/activate\n\n# Install dependencies\npip install -r requirements.txt\n\n# Apply migrations\npython manage.py makemigrations\npython manage.py migrate\n\n# Create superuser\npython manage.py createsuperuser\n\n# Run development server\npython manage.py runserver\n\n# Create tow users with role is_customer and is_admin_user\n```\n\n## 🔐 Authentication\nObtain token:\n```bash\n\nPOST /api/token/\n{\n  \"username\": \"user1\",\n  \"password\": \"Abc@1234\"\n}\n\n\n```\n\n## 🧪 Running Tests\n\n```bash\npython manage.py test\n\n```\n\n\n## 📬 API Endpoints\n\n| Method | Endpoint                              | Description               |\n| ------ | ------------------------------------- | ------------------------- |\n| POST   | `/api/token/`                         | Login and get JWT token   |\n| POST   | `/api/token/refresh/`                 | Refresh access token      |\n| GET    | `/api/inventory/products/`            | List products             |\n| POST   | `/api/store/cart/add/`                | Add item to cart          |\n| GET    | `/api/store/cart/view/`               | View cart                 |\n| POST   | `/api/store/checkout/`                | Checkout and place order  |\n| POST   | `/api/store/admin/generate-discount/` | Generate discount (admin) |\n| GET    | `/api/store/admin/analytics/`         | View analytics (admin)    |\n\n\nNote: Assignment Completed","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhaybraja%2Fecommerce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabhaybraja%2Fecommerce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhaybraja%2Fecommerce/lists"}