{"id":22326124,"url":"https://github.com/jaimayal/java-spring-ecommerce","last_synced_at":"2026-04-15T06:33:38.757Z","repository":{"id":151872859,"uuid":"599792013","full_name":"Jaimayal/java-spring-ecommerce","owner":"Jaimayal","description":"Modern Java + Spring Boot E-Commerce. RESTful + OAuth 2.1 + JWT.","archived":false,"fork":false,"pushed_at":"2023-04-07T19:51:19.000Z","size":138,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-26T06:11:54.151Z","etag":null,"topics":["java","java-11","jwt","oauth2","spring","spring-boot","spring-data","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/Jaimayal.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":"2023-02-09T22:16:43.000Z","updated_at":"2023-03-11T16:41:22.000Z","dependencies_parsed_at":"2023-05-13T07:45:36.925Z","dependency_job_id":null,"html_url":"https://github.com/Jaimayal/java-spring-ecommerce","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Jaimayal/java-spring-ecommerce","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaimayal%2Fjava-spring-ecommerce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaimayal%2Fjava-spring-ecommerce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaimayal%2Fjava-spring-ecommerce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaimayal%2Fjava-spring-ecommerce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jaimayal","download_url":"https://codeload.github.com/Jaimayal/java-spring-ecommerce/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaimayal%2Fjava-spring-ecommerce/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31830080,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"online","status_checked_at":"2026-04-15T02:00:06.175Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["java","java-11","jwt","oauth2","spring","spring-boot","spring-data","spring-security"],"created_at":"2024-12-04T02:15:50.343Z","updated_at":"2026-04-15T06:33:38.734Z","avatar_url":"https://github.com/Jaimayal.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java + Spring Boot E-Commerce | Tarvin Shop Backend\n*Before reading this documentation is advised to read on the basics of OAuth 2 and JWT*\n\n## Auth System\nThis project leverages modern OAuth 2.1 (Resource Server) + JWT in Spring. [No social logins](https://www.webfx.com/blog/web-design/social-logins#616723179a361-20) for now.\n\nThis project uses the new [spring-boot-starter-oauth2-resource-server]((https://docs.spring.io/spring-security/reference/servlet/oauth2/resource-server/index.html)) to avoid all the typical boilerplate\ncode that you will find in most JWT implementations (Filters).\n\nIn this project I'm not using a custom Authorization Server so the tokens are \"self issued\". \nYou can see how this is implemented in the [JWTConfig](src/main/java/com/jaimayal/tarvinshop/AuthSystem/config/JwtConfig.java) class, \nOverriding the default behavior of the Resource Server.\n\nFor further understanding of this mechanism please consult [how to override the default resource server configuration](https://docs.spring.io/spring-security/reference/servlet/oauth2/resource-server/jwt.html#oauth2resourceserver-jwt-sansboot).\n\nIf you want to decouple the Authorization Server, please refer to [this repo](https://github.com/qq253498229/spring-boot-oauth2-example) and to \n[this article](https://www.baeldung.com/keycloak-embedded-in-spring-boot-app). \nAlso now there's an ongoing project to implement an Authorization Server on Spring, please, check [this project](https://spring.io/projects/spring-authorization-server) :).\n\n### JWT Generation\nYou can check how tokens are generated in the [JWTService](src/main/java/com/jaimayal/tarvinshop/AuthSystem/service/JwtService.java) class.\nSince they use the [RSA256 Algorithm](https://stackoverflow.com/questions/38588319/understanding-rsa-signing-for-jwt#answer-44352675), you must generate your own private and public keys. You can use `openssl` for this:\n\n\n#### How to generate my own public.ky and private.ky files\n1. Generate your keypair file (It contains both Private and Public key)\n```Bash\nopenssl genrsa -out keypair.pem 2048\n```\n\n2. Extract your public key into \"public.ky\" file\n```Bash\nopenssl rsa -in keypair.pem -pubout -out public.ky\n```\n\n3. Extract your private key into the \"private.ky\" file\n```Bash\nopenssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in keypair.pem -out private.ky\n```\n\n4. Put these two files inside the [resources](src/main/resources) folder.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaimayal%2Fjava-spring-ecommerce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaimayal%2Fjava-spring-ecommerce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaimayal%2Fjava-spring-ecommerce/lists"}