{"id":21445984,"url":"https://github.com/bourgui07/ecommercerest","last_synced_at":"2025-06-24T08:03:17.794Z","repository":{"id":245309571,"uuid":"817744727","full_name":"BOURGUI07/eCommerceREST","owner":"BOURGUI07","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-27T11:31:50.000Z","size":106,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T01:23:48.914Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/BOURGUI07.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":"2024-06-20T10:56:51.000Z","updated_at":"2024-06-27T11:31:53.000Z","dependencies_parsed_at":"2024-06-24T12:59:55.857Z","dependency_job_id":"44eca848-1526-401e-b064-e6c7b978258f","html_url":"https://github.com/BOURGUI07/eCommerceREST","commit_stats":null,"previous_names":["bourgui07/ecommercerest"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BOURGUI07/eCommerceREST","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BOURGUI07%2FeCommerceREST","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BOURGUI07%2FeCommerceREST/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BOURGUI07%2FeCommerceREST/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BOURGUI07%2FeCommerceREST/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BOURGUI07","download_url":"https://codeload.github.com/BOURGUI07/eCommerceREST/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BOURGUI07%2FeCommerceREST/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261632034,"owners_count":23187268,"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":[],"created_at":"2024-11-23T02:40:33.943Z","updated_at":"2025-06-24T08:03:17.753Z","avatar_url":"https://github.com/BOURGUI07.png","language":"Java","readme":"Here's the updated `README.md` description for your project, incorporating the latest additions:\n\n```markdown\n### User Requirement Story\n\n#### Overview\nAs a client, I require a RESTful service for managing an e-commerce platform. The service should be developed using MySQL as the database and Spring Boot for the backend. The system must support complex entity relationships and enable advanced querying capabilities.\n\n## Technologies Used\n\tSpring Boot: For application configuration and setup.\n\tSpring Web: To define REST endpoints.\n\tSpring Data JPA: For database interactions.\n\tSpring Security: To handle authentication and authorization.\n\tMySQL: For the relational database management system.\n\tMaven: For managing project dependencies.\n\tPostman: For testing the API endpoints.\n\tJUnit: For writing and running unit tests.\n\tMockito: For mocking dependencies in unit tests.\n\n#### Entities and Relationships\n\n1. **User**\n    - Attributes: `user_id`, `user_name`, `profile_id`, `createdBy`, `createdAt`\n    - Relationships: \n        - One-to-One with `UserProfile`\n        - One-to-Many with `Order_Items`\n\n2. **UserProfile**\n    - Attributes: `profile_id`, `email`, `address`, `phone_number`, `createdBy`, `createdAt`\n    - Relationships: \n        - One-to-One with `User`\n\n3. **Product**\n    - Attributes: `product_id`, `name`, `description`, `price`, `stock`, `category_id`, `createdBy`, `createdAt`\n    - Relationships:\n        - Many-to-One with `Category` \n\n4. **Category**\n    - Attributes: `category_id`, `name`, `description`, `createdBy`, `createdAt`\n    - Relationships:\n        - One-to-Many with `Product`\n\n5. **Order**\n    - Attributes: `order_id`, `user_id`, `order_date`, `status`, `createdBy`, `createdAt`\n    - Relationships:\n        - One-to-Many with `OrderItem`\n        - Many-to-One with `User`\n\n6. **OrderItem**\n    - Attributes: `order_item_id`, `order_id`, `product_id`, `quantity`, `price`, `createdBy`, `createdAt`\n    - Relationships:\n        - Many-to-One with `Order`\n        - Many-to-One with `Product`\n\n#### RESTful Service Requirements\n\n1. **User Management**\n    - Create, update, delete, and retrieve user information.\n    - Retrieve user profiles with detailed information (including profile details and orders).\n    - Retrieve users based on complex filters (e.g., users who have placed orders within a date range, users with profiles that match certain criteria).\n\n2. **Product Management**\n    - Create, update, delete, and retrieve product information.\n    - Retrieve products based on complex filters (e.g., products in certain categories, products within a price range, products with low stock).\n    - Implement pagination and sorting in endpoints.\n\n3. **Category Management**\n    - Create, update, delete, and retrieve category information.\n    - Retrieve categories with associated products.\n\n4. **Order Management**\n    - Create, update, delete, and retrieve order information.\n    - Retrieve orders with detailed information (including order items and user details).\n    - Retrieve orders based on complex filters (e.g., orders by status, orders within a date range, orders containing specific products).\n    - Implement pagination and sorting in endpoints.\n\n5. **Advanced Queries**\n    - Retrieve users who have spent more than a specified amount in a given time period.\n    - Retrieve products that have been ordered a certain number of times within a date range.\n    - Retrieve categories with the highest number of products.\n    - Generate reports on sales (total sales by product, total sales by category, total sales by user).\n\n6. **Authentication and Authorization**\n    - Implement user authentication using JWT.\n    - Ensure certain endpoints are protected and require appropriate user roles/permissions.\n\n7. **Performance and Scalability**\n    - Ensure the service is optimized for performance, especially for complex queries.\n    - Implement pagination for large datasets.\n\n8. **Documentation and Testing**\n    - Provide comprehensive API documentation.\n    - Include unit tests and integration tests to ensure the reliability of the service.\n\n#### Expected Outcomes\n\n- A fully functional RESTful service supporting complex relationships and advanced querying capabilities.\n- Efficient and scalable service suitable for an e-commerce platform.\n- Secure endpoints with role-based access control.\n- Thoroughly documented and tested application.\n\n\n### Roles and Authorities\n\n#### Roles\n\n1. **Admin**\n    - Description: Administrators have the highest level of access. They can manage all aspects of the system, including user management, product management, category management, and order management.\n    - Authorities:\n        - `MANAGE_USERS`\n        - `MANAGE_PRODUCTS`\n        - `MANAGE_CATEGORIES`\n        - `MANAGE_ORDERS`\n        - `VIEW_REPORTS`\n\n2. **Vendor**\n    - Description: Vendors can manage products and view orders related to their products. They have limited access compared to administrators and cannot manage users.\n    - Authorities:\n        - `MANAGE_PRODUCTS`\n        - `VIEW_ORDERS`\n\n\n3. **Guest**\n    - Description: Guests can browse products and view limited information. They must register to place orders or view detailed product information.\n    - Authorities:\n        - `VIEW_PRODUCTS`\n\n#### Authorities\n\n1. **MANAGE_USERS**\n    - Description: Allows the role to create, update, delete, and retrieve user information, including user profiles and associated details.\n    - Applicable Roles: Admin\n\n2. **MANAGE_PRODUCTS**\n    - Description: Allows the role to create, update, delete, and retrieve product information.\n    - Applicable Roles: Admin, Vendor\n\n3. **MANAGE_CATEGORIES**\n    - Description: Allows the role to create, update, delete, and retrieve category information.\n    - Applicable Roles: Admin\n\n4. **MANAGE_ORDERS**\n    - Description: Allows the role to create, update, delete, and retrieve order information.\n    - Applicable Roles: Admin\n\n5. **VIEW_REPORTS**\n    - Description: Allows the role to generate and view sales reports and other analytical data.\n    - Applicable Roles: Admin\n\n6. **VIEW_ORDERS**\n    - Description: Allows the role to view order information, including detailed order items and associated user details.\n    - Applicable Roles: Admin, Vendor\n\n7. **VIEW_PRODUCTS**\n    - Description: Allows the role to view product information.\n    - Applicable Roles: Admin, Vendor, Customer, Guest\n\n\n#### Role-Based Access Control (RBAC)\n\n- **Admin**\n    - Full access to all endpoints and functionalities.\n- **Vendor**\n    - Access to endpoints related to product management and order viewing.\n- **Guest**\n    - Access to endpoints for viewing products only. Registration is required for further access.\n\n#### Implementation Notes\n\n- **Endpoint Protection**: Ensure that endpoints are protected using Spring Security to enforce role-based access control.\n- **Token-Based Authentication**: Implement JWT (JSON Web Token) for secure and stateless authentication.\n- **Role Hierarchies**: Consider defining role hierarchies in Spring Security to simplify the assignment of authorities (e.g., `Admin` implicitly has all authorities granted to `Vendor`).\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbourgui07%2Fecommercerest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbourgui07%2Fecommercerest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbourgui07%2Fecommercerest/lists"}