{"id":21888292,"url":"https://github.com/martincantillo/technical-test-backend-hypersoft","last_synced_at":"2026-04-13T18:01:50.285Z","repository":{"id":257910689,"uuid":"873140795","full_name":"MartinCantillo/Technical-test-Backend-Hypersoft","owner":"MartinCantillo","description":"Technical-test backend  involving Springboot , JUnit , Mockito  and Mysql for db","archived":false,"fork":false,"pushed_at":"2024-10-16T20:57:50.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-28T12:44:46.314Z","etag":null,"topics":["junit5","jwt","mockito","mysql","rest-api","spring-boot","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MartinCantillo.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-10-15T17:05:10.000Z","updated_at":"2024-10-16T20:57:54.000Z","dependencies_parsed_at":"2024-10-18T01:17:42.658Z","dependency_job_id":null,"html_url":"https://github.com/MartinCantillo/Technical-test-Backend-Hypersoft","commit_stats":null,"previous_names":["martincantillo/technical-test-backend-hypersoft"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MartinCantillo/Technical-test-Backend-Hypersoft","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinCantillo%2FTechnical-test-Backend-Hypersoft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinCantillo%2FTechnical-test-Backend-Hypersoft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinCantillo%2FTechnical-test-Backend-Hypersoft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinCantillo%2FTechnical-test-Backend-Hypersoft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MartinCantillo","download_url":"https://codeload.github.com/MartinCantillo/Technical-test-Backend-Hypersoft/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinCantillo%2FTechnical-test-Backend-Hypersoft/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31764317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T15:25:13.801Z","status":"ssl_error","status_checked_at":"2026-04-13T15:25:09.162Z","response_time":93,"last_error":"SSL_read: 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":["junit5","jwt","mockito","mysql","rest-api","spring-boot","spring-security"],"created_at":"2024-11-28T11:14:49.666Z","updated_at":"2026-04-13T18:01:50.268Z","avatar_url":"https://github.com/MartinCantillo.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🛠️ Backend API - Spring Boot\n\nThis project is a **backend API** developed in **Spring Boot**. It allows for user and product management with JWT authentication and specific roles.\n\n## 🚀 Project Features\n\n- **Authentication** with JWT.\n- **User roles**: Admin, User.\n- **Product CRUD**: Add, Read, Update, Delete products.\n- **Database**: MySQL.\n- **Spring Security** for route protection.\n\n## 📝 API Endpoints\n\n### 📦 Users\n\n#### Register a user\n- `POST /user/register`\n- Request body:\n    ```json\n    {\n      \"username\": \"user\",\n      \"password\": \"password\",\n      \"role\": \"ROLE_USER\" // Or ROLE_ADMIN\n    }\n    ```\n  - **Response**: `User registered successfully`\n\n#### Login (Generate JWT)\n- `POST /user/login`\n- Request body:\n    ```json\n    {\n      \"username\": \"user\",\n      \"password\": \"password\"\n    }\n    ```\n  - **Response**: JWT token\n\n### 🛒 Products\n\n#### Create product (Admin only)\n- `POST /api/addProduct`\n- Request body:\n    ```json\n    {\n      \"name\": \"Product A\",\n      \"price\": 100.0,\n      \"quantity\": 10\n    }\n    ```\n  - **Response**: `Product created successfully`\n\n#### Get all products (User and Admin)\n- `GET /api/getAll`\n  - **Response**: List of products in JSON format\n\n#### Get product by ID (User and Admin)\n- `GET /api/getById/{id}`\n  - **Response**: Product with the specified ID.\n\n#### Update product (Admin only)\n- `PUT /api/update/{id}`\n- Request body:\n    ```json\n    {\n      \"name\": \"Updated Product\",\n      \"price\": 200.0,\n      \"quantity\": 50\n    }\n    ```\n  - **Response**: `Product updated successfully`\n\n#### Delete product (Admin only)\n- `DELETE /api/delete/{id}`\n  - **Response**: `No content` if deleted successfully.\n\n## ⚙️ Configuration\n\n### Database\nThe backend connects to a MySQL database. Make sure MySQL is installed and running.\n\n```properties\nspring.application.name=Backend\nspring.datasource.url=jdbc:mysql://localhost:3306/bdcrud\nspring.datasource.username=root\nspring.datasource.password=your_password\nspring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL8Dialect\nspring.jpa.properties.hibernate.format_sql=true\nserver.port=8020\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartincantillo%2Ftechnical-test-backend-hypersoft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartincantillo%2Ftechnical-test-backend-hypersoft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartincantillo%2Ftechnical-test-backend-hypersoft/lists"}