{"id":26697395,"url":"https://github.com/athrocks/ecommerce-website-backend","last_synced_at":"2026-04-17T01:31:47.802Z","repository":{"id":282406983,"uuid":"948440561","full_name":"athrocks/Ecommerce-Website-Backend","owner":"athrocks","description":"Eccomerce Website Backend","archived":false,"fork":false,"pushed_at":"2025-03-24T20:02:37.000Z","size":57,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T21:21:56.016Z","etag":null,"topics":["cors","rest-api","restful-api","spring","spring-boot","spring-data-jpa","spring-mvc","spring-security"],"latest_commit_sha":null,"homepage":"","language":"Java","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/athrocks.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}},"created_at":"2025-03-14T10:44:14.000Z","updated_at":"2025-03-16T16:03:02.000Z","dependencies_parsed_at":"2025-03-18T21:15:14.291Z","dependency_job_id":null,"html_url":"https://github.com/athrocks/Ecommerce-Website-Backend","commit_stats":null,"previous_names":["athrocks/ecommerce-website-backend"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athrocks%2FEcommerce-Website-Backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athrocks%2FEcommerce-Website-Backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athrocks%2FEcommerce-Website-Backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athrocks%2FEcommerce-Website-Backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/athrocks","download_url":"https://codeload.github.com/athrocks/Ecommerce-Website-Backend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245735887,"owners_count":20663807,"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":["cors","rest-api","restful-api","spring","spring-boot","spring-data-jpa","spring-mvc","spring-security"],"created_at":"2025-03-26T21:19:06.807Z","updated_at":"2026-04-17T01:31:47.785Z","avatar_url":"https://github.com/athrocks.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# E-Commerce Backend (Spring Boot)\n\n## Overview\nThis project is a backend service for an e-commerce application built using **Spring Boot** and **MySQL**. It provides RESTful APIs for managing products, categories, and associated resources.\n\n## Technologies Used\n- **Spring Boot** (Java 21)\n- **Spring Data JPA** (Hibernate)\n- **MySQL**\n- **Lombok**\n- **Jackson (for JSON serialization/deserialization)**\n\n## Entities and Relationships\n\n### 1. **Product**\nRepresents an item available for purchase.\n\n| Field         | Type              | Constraints                  |\n|--------------|-----------------|-----------------------------|\n| `id`         | UUID            | Primary Key, Auto-generated |\n| `name`       | String          | Not Null                     |\n| `description`| String (TEXT)   | Optional                      |\n| `price`      | BigDecimal      | Not Null                     |\n| `brand`      | String          | Not Null                     |\n| `rating`     | Float           | Optional                      |\n| `isNewArrival` | Boolean       | Not Null                     |\n| `createdAt`  | LocalDateTime   | Auto-generated on create    |\n| `updatedAt`  | LocalDateTime   | Auto-updated on change      |\n| `productVariants` | List\u003cProductVariant\u003e | One-to-Many Relationship |\n| `resources`  | List\u003cResources\u003e | One-to-Many Relationship    |\n\n### 2. **ProductVariant**\nRepresents different variants (color, size, stock) of a product.\n\n| Field         | Type       | Constraints                  |\n|--------------|-----------|-----------------------------|\n| `id`         | UUID      | Primary Key, Auto-generated |\n| `color`      | String    | Not Null                     |\n| `size`       | String    | Not Null                     |\n| `stockQuantity` | Integer | Not Null                     |\n| `product`    | Product   | Foreign Key (Many-to-One)    |\n\n### 3. **Category**\nRepresents product categories.\n\n| Field         | Type      | Constraints                  |\n|--------------|----------|-----------------------------|\n| `id`         | UUID     | Primary Key, Auto-generated |\n| `name`       | String   | Not Null                     |\n| `code`       | String   | Not Null                     |\n| `description`| String   | Not Null                     |\n| `categoryTypes` | List\u003cCategoryType\u003e | One-to-Many Relationship |\n\n### 4. **CategoryType**\nRepresents subcategories within a category.\n\n| Field         | Type      | Constraints                  |\n|--------------|----------|-----------------------------|\n| `id`         | UUID     | Primary Key, Auto-generated |\n| `name`       | String   | Not Null                     |\n| `code`       | String   | Not Null                     |\n| `description`| String   | Not Null                     |\n| `category`   | Category | Foreign Key (Many-to-One)    |\n\n### 5. **Resources**\nRepresents images or files related to a product.\n\n| Field         | Type      | Constraints                  |\n|--------------|----------|-----------------------------|\n| `id`         | UUID     | Primary Key, Auto-generated |\n| `name`       | String   | Not Null                     |\n| `url`        | String   | Not Null                     |\n| `isPrimary`  | Boolean  | Not Null                     |\n| `type`       | String   | Not Null (e.g., Image, Video) |\n| `product`    | Product  | Foreign Key (Many-to-One)    |\n\n## Database Relationships\n- **Product ↔ ProductVariant**: One-to-Many (A product can have multiple variants.)\n- **Product ↔ Resources**: One-to-Many (A product can have multiple resources.)\n- **Category ↔ CategoryType**: One-to-Many (A category can have multiple types.)\n- **CategoryType ↔ Category**: Many-to-One (Each category type belongs to one category.)\n- **Resources ↔ Product**: Many-to-One (Each resource belongs to one product.)\n\n## Setup \u0026 Run Instructions\n### **1. Database Setup**\n- Create a MySQL database:\n```sql\nCREATE DATABASE ecommerce_db;\n```\n\n### **2. Configure `application.properties`**\nSet up database connection details in `src/main/resources/application.properties`:\n```properties\nspring.datasource.url=jdbc:mysql://localhost:3306/ecommerce_db\nspring.datasource.username=root\nspring.datasource.password=rootpassword\nspring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver\n\nspring.jpa.hibernate.ddl-auto=update\nspring.jpa.show-sql=true\nspring.jpa.properties.hibernate.format_sql=true\n```\n\n### **3. Run the Application**\nUse the following command to start the Spring Boot application:\n```bash\n./mvnw spring-boot:run\n```\nOr, if using Maven:\n```bash\nmvn spring-boot:run\n```\n\n## API Endpoints\n### **Product Controller**\n| Method | Endpoint | Description |\n|--------|---------|-------------|\n| `GET` | `/products` | Get all products |\n| `GET` | `/products/{id}` | Get product by ID |\n| `POST` | `/products` | Create a new product |\n| `PUT` | `/products` | Update a product |\n| `DELETE` | `/products/{id}` | Delete a product |\n\n### **Category Controller**\n| Method | Endpoint | Description |\n|--------|---------|-------------|\n| `GET` | `/categories` | Get all categories |\n| `GET` | `/categories/{id}` | Get category by ID |\n| `POST` | `/categories` | Create a new category |\n| `PUT` | `/categories/{id}` | Update a category |\n| `DELETE` | `/categories/{id}` | Delete a category |\n\n## Contributing\n1. Fork the repository\n2. Create a new branch (`git checkout -b feature-branch`)\n3. Commit your changes (`git commit -m 'Add new feature'`)\n4. Push to the branch (`git push origin feature-branch`)\n5. Open a Pull Request\n\n## License\nThis project is licensed under the **MIT License**.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fathrocks%2Fecommerce-website-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fathrocks%2Fecommerce-website-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fathrocks%2Fecommerce-website-backend/lists"}