{"id":25563499,"url":"https://github.com/shimbhu77/greenstitch_backend_assignment","last_synced_at":"2026-05-07T01:32:26.110Z","repository":{"id":193423512,"uuid":"688512324","full_name":"Shimbhu77/GreenStitch_Backend_Assignment","owner":"Shimbhu77","description":"This backend project implements a secure login and signup REST API using Java, Spring Boot, and H2 database. It includes endpoints for user registration, authentication, and retrieving user details with JWT tokens.","archived":false,"fork":false,"pushed_at":"2023-09-08T04:38:58.000Z","size":47,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-19T11:10:17.439Z","etag":null,"topics":["h2-database","hibernate","java-8","lombok","maven","spring-security","springboot","springdata-jpa"],"latest_commit_sha":null,"homepage":"http://localhost:8888/","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/Shimbhu77.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}},"created_at":"2023-09-07T13:54:40.000Z","updated_at":"2025-05-12T04:23:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"bcd4b2f1-a900-40f3-a9bd-24888c889bbc","html_url":"https://github.com/Shimbhu77/GreenStitch_Backend_Assignment","commit_stats":null,"previous_names":["shimbhu77/greenstitch_backend_assignment"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Shimbhu77/GreenStitch_Backend_Assignment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shimbhu77%2FGreenStitch_Backend_Assignment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shimbhu77%2FGreenStitch_Backend_Assignment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shimbhu77%2FGreenStitch_Backend_Assignment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shimbhu77%2FGreenStitch_Backend_Assignment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shimbhu77","download_url":"https://codeload.github.com/Shimbhu77/GreenStitch_Backend_Assignment/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shimbhu77%2FGreenStitch_Backend_Assignment/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32719497,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T00:29:05.620Z","status":"ssl_error","status_checked_at":"2026-05-07T00:28:57.074Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["h2-database","hibernate","java-8","lombok","maven","spring-security","springboot","springdata-jpa"],"created_at":"2025-02-20T20:20:11.748Z","updated_at":"2026-05-07T01:32:26.084Z","avatar_url":"https://github.com/Shimbhu77.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GreenStitch Backend Assignment\n# Login and Signup Backend API with Spring Security and JWT Tokens\n\nThis project is a backend implementation of a login and signup REST API with security and JWT tokens. It is built using Java, and Spring Boot, and utilizes the H2 database for data storage. The API endpoints provided below demonstrate the functionality of the application.\n\n## Installation and Setup\n\n```\n### Prerequisites\n- Java Development Kit (JDK) 8 or later\n- Maven\n- Postman (for testing the API)\n```\n\n### 1. Clone the Repository\n\n```\ngit clone https://github.com/Shimbhu77/GreenStitch_Backend_Assignment.git\n```\n\n### 2. Go the Project\n\n```\ncd GreenStitch_Backend_Assignment/GreenStitch_Assignment\n\n```\n\n### 3. Run the Application\n- For GitBash\n```\n./mvnw spring-boot:run\n\n```\n**The application will start running on [http://localhost:8888](http://localhost:8888)**\n\n### **API Endpoints**\n\n### User Signup\n\n- Method: POST\n- Path: `http://localhost:8888/app/sign-up`\n- Description: Register a new user.\n- Request Body: User data in the JSON format (e.g., name, email, password).\n\n```\n\n{\n  \"fullName\": \"Shimbhu Kumawat\",\n  \"password\": \"Shimbhu@123\",\n  \"email\": \"sk@gmail.com\"\n}\n```\n\n- Response:\n\n```\n{\n    \"id\": 1,\n    \"fullName\": \"Shimbhu Kumawat\",\n    \"password\": \"$2a$10$KVzpEHKFpX2ephA7RXLgqumnZKFy3bT8wdJMW3tYH2yqUJcpZPGSG\",\n    \"email\": \"sk@gmail.com\",\n    \"role\": \"ROLE_USER\"\n}\n\n```\n\n### User Login\n\n- Method: GET\n- Path: `http://localhost:8888/app/sign-in`\n- Description: Authenticate a user and retrieve their details and JWT token.\n- Authentication: Basic Authentication (Username and Password)\n    - Username: [sk@gmail.com](mailto:sk@gmail.com)\n    - Password: Shimbhu@123\n- Response:\n\n```\n{\n    \"id\": 1,\n    \"fullName\": \"Shimbhu Kumawat\",\n    \"password\": \"$2a$10$KVzpEHKFpX2ephA7RXLgqumnZKFy3bT8wdJMW3tYH2yqUJcpZPGSG\",\n    \"email\": \"sk@gmail.com\",\n    \"role\": \"ROLE_USER\"\n}\n\n```\n\n### Welcome Endpoint (Requires Authentication)\n\n- Method: GET\n- Path: `http://localhost:8888/app/logged-in/user`\n- Description: A protected endpoint that requires authentication to access.\n- Authentication: Bearer Token\n- Request Header:\n    - Authorization: Bearer \u003ctoken\u003e\n- Response: A welcome message string.\n- Example:\n    - Bearer Token: eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJTaGltYmh1Iiwic3ViIjoiSldUIFRva2VuIiwidXNlcm5hbWUiOiJza0BnbWFpbC5jb20iLCJyb2xlIjoiUk9MRV9VU0VSIiwiaWF0IjoxNjg1Njc3Mzg3LCJleHAiOjE2ODU3MDczODd9.VwM2IGD1fABjEcnNoMb4uIyBnYe3_BmZGx33dElaD-E\n    - Response: Hello from GreenStitch\n\n### Tech Stack\n\n- Java\n- Spring Boot\n- H2 Database\n- Spring Security\n- JWT Token\n- Lombok\n- Maven\n- Swagger-UI\n\n### Validation Rules\n\nThe following validation rules are applied to the user entity:\n\n- Full Name:\n    - Minimum length: 3 characters\n    - Maximum length: 20 characters\n- Password:\n    - At least 8 characters\n    - Contains at least one digit\n    - Contains at least one lowercase letter\n    - Contains at least one uppercase letter\n    - Contains at least one special character\n- Email:\n    - Valid email format\n\n### Development\n\nThe project can be imported and run using an IDE like Eclipse.\n\n### Test API\n\nYou can use Postman and Swagger-UI to test the API endpoints.\n\n## H2 Database Configuration\n\nThe project uses the H2 in-memory database by default.\n\nThe application is configured to use the H2 database. The configuration can be found in the `application.properties` file:\n\n```\n# Server Port Configuration\nserver.port=8888\n\n# H2 Database Configuration\nspring.datasource.url=jdbc:h2:mem:testdb\nspring.datasource.driverClassName=org.h2.Driver\nspring.datasource.username=sa\nspring.datasource.password=\nspring.jpa.database-platform=org.hibernate.dialect.H2Dialect\nspring.h2.console.enabled=true\nspring.h2.console.path=/h2-console\n\n```\n\n## **Contributors**\n\n- **[Shimbhu Kumawat](https://github.com/Shimbhu77)**\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshimbhu77%2Fgreenstitch_backend_assignment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshimbhu77%2Fgreenstitch_backend_assignment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshimbhu77%2Fgreenstitch_backend_assignment/lists"}