{"id":25027063,"url":"https://github.com/sonwayr/e_shop","last_synced_at":"2026-05-06T20:35:11.274Z","repository":{"id":275440313,"uuid":"926076928","full_name":"Sonwayr/e_shop","owner":"Sonwayr","description":"There is an e_shop. I made it by myself. For more info you can read README file","archived":false,"fork":false,"pushed_at":"2025-02-02T14:32:54.000Z","size":541,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T15:28:24.748Z","etag":null,"topics":["backend","django","django-rest-framework","html-css-javascript","pyjwt-django","pytest","python","selfmade","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/Sonwayr.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":"2025-02-02T13:56:48.000Z","updated_at":"2025-02-02T14:38:34.000Z","dependencies_parsed_at":"2025-02-02T15:40:09.780Z","dependency_job_id":null,"html_url":"https://github.com/Sonwayr/e_shop","commit_stats":null,"previous_names":["sonwayr/e_shop"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sonwayr%2Fe_shop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sonwayr%2Fe_shop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sonwayr%2Fe_shop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sonwayr%2Fe_shop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sonwayr","download_url":"https://codeload.github.com/Sonwayr/e_shop/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246350815,"owners_count":20763225,"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":["backend","django","django-rest-framework","html-css-javascript","pyjwt-django","pytest","python","selfmade","sqlite"],"created_at":"2025-02-05T18:28:21.917Z","updated_at":"2026-05-06T20:35:11.200Z","avatar_url":"https://github.com/Sonwayr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# My EShop\n\nThis project is an e-commerce platform built with Django. It includes product management, user authentication, and shopping cart functionality.\n\n## 🚀 Features\n\n- User registration and authentication\n- Product and category management\n- Shopping cart system\n- API support with Django REST Framework\n- Extensive test coverage with pytest\n- Advanced filtering options for product search\n\n## 🌟 Advantages\n\n- **Scalability** – The project is built with Django, making it easy to scale as needed.\n- **Modular Structure** – The application follows Django’s best practices, making it easy to extend and maintain.\n- **API Ready** – Fully integrated with Django REST Framework, allowing easy API expansion.\n- **Secure Authentication** – Implements Django’s built-in authentication system for secure user management.\n- **Customizable** – Can be modified to fit specific business needs.\n- **Well-Tested** – Includes numerous automated tests using pytest to ensure reliability and stability.\n- **Advanced Filtering** – Products can be filtered based on multiple parameters, improving the user experience.\n\n## 🏗️ Architecture Overview\n\n### Applications\n\nThe project is divided into three main Django applications:\n\n1. **Users App** – Handles user authentication, registration, and profile management.\n2. **Products App** – Manages product listings and categories.\n3. **Cart App** – Manages the shopping cart functionality.\n\n---\n## 📂 Users App\n\n### API Endpoints\n\n#### **User Registration**\n- **Endpoint:** `POST /api/auth/register/`\n- **Description:** Registers a new user.\n- **Request Body:**\n  ```json\n  {\n    \"username\": \"testuser\",\n    \"email\": \"test@example.com\",\n    \"password\": \"securepassword\"\n  }\n  ```\n- **Response:**\n  ```json\n  {\n    \"id\": 1,\n    \"username\": \"testuser\",\n    \"email\": \"test@example.com\"\n  }\n  ```\n\n#### **User Login**\n- **Endpoint:** `POST /api/auth/login/`\n- **Description:** Authenticates a user and returns a token.\n- **Request Body:**\n  ```json\n  {\n    \"username\": \"testuser\",\n    \"password\": \"securepassword\"\n  }\n  ```\n- **Response:**\n  ```json\n  {\n    \"token\": \"abcdef123456\"\n  }\n  ```\n\n#### **User Profile**\n- **Endpoint:** `GET /api/auth/profile/`\n- **Description:** Retrieves or updates the user profile.\n- **Response:**\n  ```json\n  {\n    \"id\": 1,\n    \"username\": \"testuser\",\n    \"email\": \"test@example.com\"\n  }\n  ```\n\n---\n## 🛍️ Products App\n\n### API Endpoints\n\n#### **Get All Products**\n- **Endpoint:** `GET /api/products/`\n- **Description:** Retrieves a paginated list of all products.\n- **Response:**\n  ```json\n  [\n    {\n      \"id\": 1,\n      \"name\": \"Laptop\",\n      \"brand\": \"Asus\",\n      \"description\": \"A high-performance laptop\",\n      \"price\": 1200.99,\n      \"category\": 1\n    }\n  ]\n  ```\n\n#### **Create a New Product**\n- **Endpoint:** `POST /api/products/`\n- **Description:** Creates a new product.\n- **Request Body:**\n  ```json\n  {\n    \"name\": \"Smartphone\",\n    \"brand\": \"Apple\",\n    \"description\": \"Latest model with great features\",\n    \"price\": 899.99,\n    \"category\": \"Electronics\"\n  }\n  ```\n- **Response:**\n  ```json\n  {\n    \"id\": 2,\n    \"name\": \"Smartphone\",\n    \"brand\": \"Apple\",\n    \"description\": \"Latest model with great features\",\n    \"price\": 899.99,\n    \"category\": \"Electronics\"\n\n  }\n  ```\n\n#### **Filter Products**\n- **Endpoint:** `GET /api/products/?category=\u003ccategory_name\u003e\u0026price_min=\u003cmin\u003e\u0026price_max=\u003cmax\u003e`\n- **Description:** Filters products by category, price range, and other attributes.\n\n---\n## 🛒 Cart App\n\n### API Endpoints\n\n#### **Add Product to Cart**\n- **Endpoint:** `POST /api/cart/add/`\n- **Description:** Adds a product to the user’s cart.\n- **Request Body:**\n  ```json\n  {\n    \"product_id\": 1,\n    \"quantity\": 2\n  }\n  ```\n- **Response:**\n  ```json\n  {\n    \"message\": \"Product added to cart\"\n  }\n  ```\n\n#### **View Cart**\n- **Endpoint:** `GET /api/cart/`\n- **Description:** Retrieves the current contents of the user's cart.\n\n#### **Remove Product from Cart**\n- **Endpoint:** `DELETE /api/cart/remove/\u003cid\u003e/`\n- **Description:** Removes a product from the cart.\n\n---\n## 🧪 Testing\n\nThis project is thoroughly tested using **pytest** to ensure high reliability and prevent regressions. The test suite includes:\n\n- Unit tests for models, views, and serializers\n- Integration tests for API endpoints\n- Functional tests for core user interactions\n- Performance testing to optimize response times\n\nRun the test suite with:\n```bash\npytest\n```\n\n## 🛠 Installation\n\n1. **Clone the repository**\n   ```bash\n   git clone https://github.com/sonwayr/e_shop.git\n   cd shop_pr\n   ```\n2. **Create a virtual environment and install dependencies**\n   ```bash\n   python -m venv venv\n   source venv/bin/activate  # For Linux/Mac\n   venv\\Scripts\\activate  # For Windows\n   pip install -r requirements.txt\n   ```\n3. **Apply migrations and create a superuser**\n   ```bash\n   python manage.py migrate\n   python manage.py createsuperuser\n   ```\n4. **Run the server**\n   ```bash\n   python manage.py runserver\n   ```\n\n## ⚙️ Technologies Used\n\n- Python, Django, Django REST Framework\n- PyJWT for authentication\n- Django extensions\n- Django Filters for advanced product filtering\n- HTML, CSS, JavaScript, Bootstrap\n- Pytest for automated testing\n- SQLite (can be replaced with PostgreSQL)\n\n## 📜 License\n\nThis project is licensed under the MIT License.\n\n---\n\n✉️ Contact me: [GitHub](https://github.com/sonwayr), [LinkedIn](https://www.linkedin.com/in/vitalii-lypovetskyi-81233b281/), [Insta](https://www.instagram.com/vetal_l4/), [Telegram](https://t.me/sonwayr)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonwayr%2Fe_shop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsonwayr%2Fe_shop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonwayr%2Fe_shop/lists"}