{"id":26305608,"url":"https://github.com/yotsuba1022/the-crud","last_synced_at":"2025-05-12T21:03:14.264Z","repository":{"id":52539057,"uuid":"152856136","full_name":"yotsuba1022/the-crud","owner":"yotsuba1022","description":"Just CRUD","archived":false,"fork":false,"pushed_at":"2025-01-25T13:39:41.000Z","size":126,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T03:35:33.580Z","etag":null,"topics":["crud","docker-compose","h2-database","jasypt","java","junit","maven","mybatis","mysql","spring-boot","swagger2","tdd","travis-ci"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yotsuba1022.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2018-10-13T09:27:36.000Z","updated_at":"2025-01-25T13:39:45.000Z","dependencies_parsed_at":"2024-09-05T19:29:55.001Z","dependency_job_id":"cdb72f83-732e-4332-bede-9e3246d386e6","html_url":"https://github.com/yotsuba1022/the-crud","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yotsuba1022%2Fthe-crud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yotsuba1022%2Fthe-crud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yotsuba1022%2Fthe-crud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yotsuba1022%2Fthe-crud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yotsuba1022","download_url":"https://codeload.github.com/yotsuba1022/the-crud/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253823412,"owners_count":21969846,"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":["crud","docker-compose","h2-database","jasypt","java","junit","maven","mybatis","mysql","spring-boot","swagger2","tdd","travis-ci"],"created_at":"2025-03-15T09:16:25.105Z","updated_at":"2025-05-12T21:03:14.159Z","avatar_url":"https://github.com/yotsuba1022.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The CRUD\n[![Hex.pm](https://img.shields.io/badge/language-java-blue.svg)]()\n[![Hex.pm](https://img.shields.io/hexpm/l/plug.svg)]()\n\nThe general lifestyle of the web developer. No matter how professional/hard the techniques you used. You're still doing the CRUD, this repository is just a side project which wants to demo the technical diversity of CRUD in Java ecosystem. You can CRUD this way, CRUD that way. It's just the CRUD, which gives us a job and money.\n\n## Modules\n\nThis side project contains the following modules:\n- User module: Dealing with user related business logic.\n\n## Environment, Technical Stack and Components\n- Operating System: macOS (Mojave)\n- Container Platform: Docker (18.09.2)\n- Development Language: Java (Amazon Corretto - 17)\n  - [Download Link](https://docs.aws.amazon.com/corretto/latest/corretto-11-ug/downloads-list.html)\n- Web Container: Tomcat (Spring-boot embedded)\n- Application Framework: Spring Boot (3.0.5 RELEASE)\n- Database:\n    - MySQL (8.0.20)\n    - H2 (For test purpose only)\n- Persistence layer: [MyBatis](http://www.mybatis.org/mybatis-3/) (3.5.17)\n- Cryptography: [Jasypt](http://www.jasypt.org/) (3.0.5)\n- Unit Test: [JUnit](https://junit.org/junit5/) (jupiter)\n- Build Tool: [Maven](https://maven.apache.org/) (3.9.9)\n- API Documentation: [Swagger](https://swagger.io/)\n\n## Setup Commands for Docker Environment\nBefore executing the commands in this block, please ensure that you already installed docker on your local machine.\n\n1. Clone this repository with the following command:\n    ```\n    https://github.com/yotsuba1022/the-crud.git\n    ``` \n2. Move into the root path of the project you cloned.\n\n3. Execute the following command to build image then start all containers as daemon process.\n    ```\n     $ docker-compose down; docker-compose up --build -d; docker rmi $(docker images -q -f \"dangling=true\" -f \"label=autodelete=true\");\n    ```\n       \n    3.1 The last part of the preceding command:\n    ```\n     $ docker rmi $(docker images -q -f \"dangling=true\" -f \"label=autodelete=true\") \n    ```\n      - Means that to remove all intermediate/dangling images.\n4. Fnish all containers by the following command when you want to shut down all of them:\n        \n    ```\n     $ docker-compose down\n    ```\n5. Remember to clean up the MySQL data folder with cleanup-mysql-data.sh (not mandatory)\n\n    ```\n     $ sh cleanup-mysql-data.sh\n    ```\n\n## Setup Commands for Local Environment\n1. Compile, build, and test the Spring Boot app:\n    ```\n    $ mvn clean test package\n    ```\n\n2. Launch the service:\n    ```\n    $ mvn spring-boot:run\n    ```\n\n## Sample CURL Commands\n###### Create User\n```\n$ curl -v -H \"Content-Type:application/json\" -X POST \"http://localhost:8080/the-crud/api/v1/users\" -d '{\"username\":\"rabido1022\",\"password\":\"!QAZ2wsx\",\"firstName\":\"Rabido\",\"lastName\":\"JOJO\",\"birthday\":\"1988-10-22T09:15:01\",\"age\":30,\"gender\":\"MALE\",\"registrationDate\":\"2019-01-03T23:15:01\",\"test\":false,\"admin\":true,\"suspended\":false,\"vip\":true}'\n```\n###### Update User\n```\n$ curl -v -H \"Content-Type:application/json\" -X PUT \"http://localhost:8080/the-crud/api/v1/users/26\" -d '{\"firstName\":\"JOJO\", \"lastName\":\"Lue\", \"birthday\":\"1988-10-22T23:15:15\", \"age\":30, \"gender\":\"MALE\", \"admin\":true, \"vip\":true, \"test\":true, \"suspended\":true}'\n```\n###### Get User\n```\n$ curl -v -X GET \"http://localhost:8080/the-crud/api/v1/users/1\"\n```\n###### Query Users\n```\n$ curl -v -X GET \"http://localhost:8080/the-crud/api/v1/users?id=1\"\n$ curl -v -X GET \"http://localhost:8080/the-crud/api/v1/users?isVip=true\u0026firstName=Rabido\"\n```\n###### Delete User\n```\n$ curl -v -X DELETE \"http://localhost:8080/the-crud/api/v1/users/23\"\n```\n\n## Automation Test Scripts\n### Bruno Collections\n- Please refer to the Bruno collection under `the-crud/client-scripts/bruno` folder, the RESTful collections will be arranged by modules.\n### Current modules\n  | Module Name |\n  |-------------|\n  | user_module |\n\n### How to Perform the Automation Test?\n- Launch the whole app environment via docker compose and make sure it works as expected.\n- Download bruno from the [official site](https://www.usebruno.com/) (It's free and will not expose your data in the could).\n- Import the test module you want to try.\n- Move to the automation test folder under the bruno module, click the option menu of the test, then choose \"Run\".\n  - \u003cimg src=\"https://github.com/user-attachments/assets/38b95564-d085-4464-aa0b-c44feb196e0a\" width=30% height=30%\u003e\n- Adjust the test parameters according to your needs, then click \"Run\".\n  - \u003cimg src=\"https://github.com/user-attachments/assets/e57f3a9d-3a59-4c01-a391-9e6f9fd9a428\" width=70% height=70%\u003e\n- Then, you should be able to see the result.\n\n## Swagger UI Links\n- [Default Link](http://localhost:8080/the-crud/swagger-ui.html#/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyotsuba1022%2Fthe-crud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyotsuba1022%2Fthe-crud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyotsuba1022%2Fthe-crud/lists"}