{"id":20807094,"url":"https://github.com/pycreater/user-registration","last_synced_at":"2026-04-24T14:36:19.488Z","repository":{"id":244743891,"uuid":"816132138","full_name":"Pycreater/user-registration","owner":"Pycreater","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-17T05:33:24.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-26T03:55:59.202Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Pycreater.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-06-17T05:20:53.000Z","updated_at":"2024-06-17T05:33:27.000Z","dependencies_parsed_at":"2024-06-17T06:51:47.923Z","dependency_job_id":null,"html_url":"https://github.com/Pycreater/user-registration","commit_stats":null,"previous_names":["pycreater/user-registration"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Pycreater/user-registration","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pycreater%2Fuser-registration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pycreater%2Fuser-registration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pycreater%2Fuser-registration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pycreater%2Fuser-registration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pycreater","download_url":"https://codeload.github.com/Pycreater/user-registration/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pycreater%2Fuser-registration/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32227991,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"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":[],"created_at":"2024-11-17T19:30:57.716Z","updated_at":"2026-04-24T14:36:19.463Z","avatar_url":"https://github.com/Pycreater.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# User Registration and Fetch API\n\nThis project provides a RESTful API for user registration and fetching user details using Spring Boot and MySQL.\n\n## Setup Instructions\n\n1. **Clone the Repository**:\n    ```bash\n    git clone https://github.com/Pycreater/user-registration.git\n    cd user-registration\n    ```\n\n2. **Database Setup**:\n    - Ensure you have MySQL installed and running on your machine.\n    - Create a database named `users`:\n        ```sql\n        CREATE DATABASE users;\n        ```\n\n3. **Configure Database Credentials**:\n    - Update the `src/main/resources/application.properties` file with your MySQL credentials:\n        ```properties\n        spring.datasource.url=jdbc:mysql://localhost:3306/users\n        spring.datasource.username=root\n        spring.datasource.password=yourpassword\n        spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver\n\n        spring.jpa.hibernate.ddl-auto=update\n        spring.jpa.show-sql=true\n        spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect\n        ```\n\n4. **Install Lombok Plugin**:\n    - Lombok is used to reduce boilerplate code. Ensure you have the Lombok plugin installed in your IDE:\n        - **IntelliJ IDEA**:\n            1. Go to `File \u003e Settings \u003e Plugins`.\n            2. Search for `Lombok` and install it.\n            3. Enable annotation processing: `File \u003e Settings \u003e Build, Execution, Deployment \u003e Compiler \u003e Annotation Processors` and check `Enable annotation processing`.\n        - **Eclipse**:\n            1. Go to `Help \u003e Eclipse Marketplace`.\n            2. Search for `Lombok` and install it.\n            3. Restart Eclipse.\n            4. Enable annotation processing: `Project \u003e Properties \u003e Java Compiler \u003e Annotation Processing` and check `Enable annotation processing`.\n\n5. **Build and Run the Application**:\n    - Build the application using Maven:\n        ```bash\n        mvn clean install\n        ```\n    - Run the application:\n        ```bash\n        mvn spring-boot:run\n        ```\n\n## API Endpoints\n\n1. **Register User**\n    - **Endpoint**: `/api/user/register`\n    - **Method**: `POST`\n    - **Description**: Registers a new user.\n    - **Request Body**: JSON object containing user details (username, email, password).\n    - **Response**: Returns the registered user object on success, or an error message on failure.\n\n    **Example Request**:\n    ```json\n    {\n        \"username\": \"testuser\",\n        \"email\": \"testuser@example.com\",\n        \"password\": \"password\"\n    }\n    ```\n\n    **Example cURL**:\n    ```bash\n    curl -X POST http://localhost:8080/api/user/register \\\n    -H \"Content-Type: application/json\" \\\n    -d '{\"username\":\"testuser\",\"email\":\"testuser@example.com\",\"password\":\"password\"}'\n    ```\n\n2. **Fetch User**\n    - **Endpoint**: `/api/user/fetch`\n    - **Method**: `GET`\n    - **Description**: Fetches user details by username.\n    - **Query Parameter**: `username` (String) - The username of the user to fetch.\n    - **Response**: Returns the user object on success, or an error message if the user is not found.\n\n    **Example Request**:\n    ```\n    GET /api/user/fetch?username=testuser\n    ```\n\n    **Example cURL**:\n    ```bash\n    curl -X GET \"http://localhost:8080/api/user/fetch?username=testuser\"\n    ```\n\n## Error Handling\n\nThe API uses basic error handling to return appropriate HTTP status codes and messages:\n\n- **Registration Errors**: If there is an error during registration, the API will return a `500 Internal Server Error` with a message detailing the issue.\n- **Fetch Errors**: If the user is not found, the API will return a `404 Not Found` with the message \"User not found\".\n\n## Example Responses\n\n1. **Register User - Success**:\n    ```json\n    {\n        \"id\": 1,\n        \"username\": \"testuser\",\n        \"email\": \"testuser@example.com\",\n        \"password\": \"password\"\n    }\n    ```\n\n2. **Register User - Failure**:\n    ```json\n    {\n        \"message\": \"Error registering user: {error details}\"\n    }\n    ```\n\n3. **Fetch User - Success**:\n    ```json\n    {\n        \"id\": 1,\n        \"username\": \"testuser\",\n        \"email\": \"testuser@example.com\",\n        \"password\": \"password\"\n    }\n    ```\n\n4. **Fetch User - Failure**:\n    ```json\n    {\n        \"message\": \"User not found\"\n    }\n    ```\n\n## PostMan API Testing\n![Screenshot (102)](https://github.com/Pycreater/user-registration/assets/114671066/a4757b73-7f96-4c22-a432-c56b693f0761)\n![Screenshot (103)](https://github.com/Pycreater/user-registration/assets/114671066/c8c23957-c2cd-451b-9097-7f1297f9f591)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpycreater%2Fuser-registration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpycreater%2Fuser-registration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpycreater%2Fuser-registration/lists"}