{"id":24117344,"url":"https://github.com/maarceloluiz/springboot-dscommerce","last_synced_at":"2026-04-07T09:32:08.286Z","repository":{"id":263198256,"uuid":"889622765","full_name":"MaarceloLuiz/springboot-dscommerce","owner":"MaarceloLuiz","description":"Full Stack E-Commerce app using Spring Boot (Java) \u0026 React. Features authentication (JWT), product \u0026 order management, and REST API.","archived":false,"fork":false,"pushed_at":"2025-06-15T15:20:26.000Z","size":1210,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-15T16:31:22.254Z","etag":null,"topics":["ecommerce","fullstack","java","jwt-authentication","maven","react","rest-api","spring-boot"],"latest_commit_sha":null,"homepage":"https://github.com/MaarceloLuiz/springboot-dscommerce","language":"JavaScript","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/MaarceloLuiz.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":"2024-11-16T19:48:16.000Z","updated_at":"2025-06-15T15:20:10.000Z","dependencies_parsed_at":"2025-02-28T14:24:05.393Z","dependency_job_id":"76d093b1-009a-4964-85ba-7ade564b016f","html_url":"https://github.com/MaarceloLuiz/springboot-dscommerce","commit_stats":null,"previous_names":["maarceloluiz/springboot-dscommerce"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MaarceloLuiz/springboot-dscommerce","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaarceloLuiz%2Fspringboot-dscommerce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaarceloLuiz%2Fspringboot-dscommerce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaarceloLuiz%2Fspringboot-dscommerce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaarceloLuiz%2Fspringboot-dscommerce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MaarceloLuiz","download_url":"https://codeload.github.com/MaarceloLuiz/springboot-dscommerce/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaarceloLuiz%2Fspringboot-dscommerce/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31508021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["ecommerce","fullstack","java","jwt-authentication","maven","react","rest-api","spring-boot"],"created_at":"2025-01-11T07:39:22.167Z","updated_at":"2026-04-07T09:32:08.281Z","avatar_url":"https://github.com/MaarceloLuiz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Full Stack E-Commerce Application\n[![NPM](https://img.shields.io/npm/l/react)](https://github.com/MaarceloLuiz/B8IS133/blob/main/LICENSE) \n\n## Objective\nThis full-stack E-Commerce application features a robust backend built with Spring Boot (Java, Maven), utilizing JWT (JSON Web Tokens) for secure authentication and authorization.\n\n## Features\n- User Management\n  - Register new users\n  - Login with authentication\n  - Role-based authorization (Client and Admin)\n  - Admin can manage users\n- Product \u0026 Category Management\n  - CRUD operations for products and categories (Admin only)\n  - Paginated product catalog\n  - Product filtering by name\n- Shopping Cart \u0026 Order Processing\n  - Add and remove products from the cart\n  - Update item quantities in the cart\n  - Save orders with status tracking\n  - View order history (clients)\n  - Admin can manage and report orders\n- Security \u0026 Error Handling\n  - JWT-based authentication\n  - Exception handling for:\n    - Resource not found (404)\n    - Validation errors (422)\n    - Unauthorized access (403)\n\n## Domain Model\n## **Domain Model**\n- **User**: Contains fields for `id`, `name`, `email`, `phone`, `birthDate`, `password`, and `roles`. A user can place multiple orders.\n\n- **Product**: Represents a product in the system with fields `id`, `name`, `description`, `price`, and `imgUrl`. A product belongs to one or more categories.\n\n- **Category**: Represents product categories, containing `id` and `name`. A category can have multiple products.\n\n- **Order**: Represents a purchase made by a user. Fields include `id`, `moment` (timestamp of order), and `status` (defined by the `OrderStatus` enum). A user can have multiple orders.\n\n- **OrderItem**: Represents an item within an order, containing `quantity` and `price`. Links products to orders.\n\n- **Payment**: Represents a payment made for an order. Contains `id` and `moment`. Each order can have at most one payment.\n\n- **OrderStatus**: An enumeration defining order statuses:\n  - `WAITING_PAYMENT`\n  - `PAID`\n  - `SHIPPED`\n  - `DELIVERED`\n  - `CANCELED`\n\n---\n\n![dscommercedomainmodel](https://github.com/user-attachments/assets/4830f360-92c8-4269-b550-775a81781c7c)\n\n---\n\n## Tech \u0026\u0026 Frameworks\n- **Spring Boot**: Framework for building the REST API.\n- **JPA/Hibernate**: ORM for database management.\n- **H2 Database**: In-memory database for testing.\n- **JWT Authentication**: Secure login \u0026 authorization\n- **Postman**: For testing the API endpoints.\n- **Maven**: Build automation.\n- **Yarn**: Frontend package management\n\n## How to Run\n## First Option (Recommended):\n### Dockerfile\n### Steps\n#### 1. Clone the repository:\n```bash\ngit clone https://github.com/MaarceloLuiz/springboot-dscommerce.git\ncd springboot-dscommerce\n```\n- Choose a method to start the application\n  - You can run the app in two ways:\n    - Simply using Docker-Compose\n    - Using detached Docker-Compose\n\n#### 2. Option 1: Using Docker-Compose:\n- `docker-compose up`\n\n#### 3. To stop\n- CTRL + C\n\n#### 2. Option 2: Detached Docker-Compose:\n- `docker-compose up -d`\n\n#### 3. To stop\n- `docker-compose down`\n\n---\n\n## Second Option:\n### Command Line:\n### Prerequisites\n- Java 17 or higher\n- Maven\n- Node.js and Yarn\n\n#### Check Installed Versions:\n```bash\njava -version\nmvn -version\nyarn -v\n```\nIf any command fails, install the missing dependency before proceeding.\n\n### Steps\n#### 1. Clone the repository:\n```bash\ngit clone https://github.com/MaarceloLuiz/springboot-dscommerce.git\ncd springboot-dscommerce\n```\n- Choose a method to start the application\n  - You can run the app in two ways:\n    - Using the Bash script (run.sh)\n    - Using a single command\n\n#### 2. Option 1: Using the Bash Script\n```bash\nchmod +x run.sh\n./run.sh\n```\n\n#### 2. Option 2: Using a Single Command\n```bash\n(cd backend \u0026\u0026 mvn clean install \u0026\u0026 mvn spring-boot:run) \u0026 (cd frontend \u0026\u0026 yarn install \u0026\u0026 yarn dev)\n```\n\n#### 3. Accessing the Application\n```bash\nhttp://localhost:5173\n```\n\n#### 4. Open Postman (or any API testing tool) and use the following base URL to access the API endpoints\n\n- Base URL:\n```bash\nhttp://localhost:8080\n```\n\n- The available endpoints include the following:\n\n---\n\n| Method | Endpoint               | Description                          | Access  |\n|--------|------------------------|--------------------------------------|---------|\n| POST   | `/oauth2/token`        | Authenticate user and generate JWT Bearer Token | All  |\n| GET    | `/users/me`            | Retrieve information of the logged-in user | Admin, Client  |\n| GET    | `/products`            | List paginated products              | Public  |\n| GET    | `/products/{id}`       | Get product details by ID            | Public  |\n| POST   | `/products`            | Add new product                      | Admin   |\n| PUT    | `/products/{id}`       | Update product by ID                 | Admin   |\n| DELETE | `/products/{id}`       | Delete product by ID                 | Admin   |\n| GET    | `/categories`          | List product categories              | Public  |\n| GET    | `/orders`              | View user orders (client)            | Client  |\n| POST   | `/orders`              | Create a new order                   | Client  |\n\n---\n\n- For example, you can test the GET /products endpoint in Postman by sending a request to:\n```bash\nhttp://localhost:8080/products\n```\n\n#### 5. To stop the application, simply press the following in the terminal:\n```bash\nCtrl + C\n```\n\n- If port 8080 is still in use after pressing Ctrl + C, check and kill the process manually to release it.\n\n## Author\nMarcelo Luiz Guimarães Pereira\n\n\u003ca href=\"https://www.linkedin.com/in/marcelo-luiz-guimar%C3%A3es-pereira-613933269/\"\u003e\u003cimg src=\"https://img.shields.io/badge/linkedin%20-%230077B5.svg?\u0026style=for-the-badge\u0026logo=linkedin\u0026logoColor=white\" alt=\"LinkedIn\"/\u003e\u003c/a\u003e\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaarceloluiz%2Fspringboot-dscommerce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaarceloluiz%2Fspringboot-dscommerce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaarceloluiz%2Fspringboot-dscommerce/lists"}