{"id":18431096,"url":"https://github.com/sandesh300/user-management-and-data-integration-api","last_synced_at":"2026-05-05T04:04:04.209Z","repository":{"id":254530506,"uuid":"846821427","full_name":"sandesh300/User-Management-and-Data-Integration-API","owner":"sandesh300","description":"User Management and Data Integration API ","archived":false,"fork":false,"pushed_at":"2024-10-14T10:19:08.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T00:50:03.494Z","etag":null,"topics":["fastapi","mongodb","pymongo","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/sandesh300.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-08-24T03:50:26.000Z","updated_at":"2024-11-14T14:40:13.000Z","dependencies_parsed_at":"2024-11-06T05:31:35.378Z","dependency_job_id":"976fd3df-d1a1-41ca-a9e4-58f0e6ddae7b","html_url":"https://github.com/sandesh300/User-Management-and-Data-Integration-API","commit_stats":null,"previous_names":["sandesh300/remotebricks-assignment","sandesh300/user-management-and-data-integration-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sandesh300/User-Management-and-Data-Integration-API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandesh300%2FUser-Management-and-Data-Integration-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandesh300%2FUser-Management-and-Data-Integration-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandesh300%2FUser-Management-and-Data-Integration-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandesh300%2FUser-Management-and-Data-Integration-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sandesh300","download_url":"https://codeload.github.com/sandesh300/User-Management-and-Data-Integration-API/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandesh300%2FUser-Management-and-Data-Integration-API/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274595567,"owners_count":25314018,"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","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"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":["fastapi","mongodb","pymongo","python"],"created_at":"2024-11-06T05:23:31.333Z","updated_at":"2026-05-05T04:04:04.134Z","avatar_url":"https://github.com/sandesh300.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# User Management and Data Integration API \n\n## Objective\n\nDevelop a set of APIs for user registration, login, linking an ID, and implementing joins and chain delete functionality using Python and MongoDB.\n\n-\tDeveloped a comprehensive API using FastAPI and PyMongo for user registration, login, and linking IDs, ensuring secure password hashing and robust error handling.\n-\tImplemented advanced data handling features including joining data from multiple MongoDB collections, enabling efficient retrieval and integration of related user information.\n-\tDesigned and executed chain delete functionality, facilitating the deletion of a user and all associated data across collections, enhancing data management and integrity.\n\n## Requirements\n\n### Framework and Libraries\n\n- **FastAPI**: Web framework for building APIs.\n- **PyMongo**: Library for interacting with MongoDB.\n\n### API Endpoints\n\n1. **Registration API**\n   - **Endpoint**: `http://localhost:8000/users/register`\n   - **Method**: `POST`\n   - **Request Body**:\n     ```json\n     {\n         \"username\": \"sandesh bhujbal\",\n          \"email\": \"sandesh@gmail.com\",\n          \"password\": \"sandesh\"\n     }\n     ```\n   - **Response**:\n     ```json\n     {\n      \"message\": \"User registered successfully\",\n      \"user_id\": \"66c9551c996fee15a88a28e4\"\n     }\n     ```\n\n2. **Login API**\n   - **Endpoint**: `http://localhost:8000/login`\n   - **Method**: `POST`\n   - **Request Body**:\n     ```json\n     {\n      \"email\": \"sandesh@gmail.com\",\n      \"password\": \"sandesh\"\n     }\n     ```\n   - **Response**:\n     ```json\n     {\n        \"message\": \"Login successful\",\n        \"user_id\": \"66c9551c996fee15a88a28e4\"\n     }\n     ```\n\n3. **Link ID API**\n   - **Endpoint**: `http://localhost:8000/users/link_id`\n   - **Method**: `POST`\n   - **Request Body**:\n     ```json\n     {\n        \"user_id\": \"66c9551c996fee15a88a28e4\",\n        \"linked_id\": \"123e4567-e89b-12d3-a456-426614174000\"\n     }\n     ```\n   - **Response**:\n     ```json\n     {\n       \"message\": \"ID linked successfully\",\n       \"linked_id\": \"123e4567-e89b-12d3-a456-426614174000\"\n     }\n     ```\n\n4. **Add User Details**\n   - **Endpoint**: `http://localhost:8000/users/add_details`\n   - **Method**: `POST`\n   - **Request Body**:\n     ```json\n     {\n       \"user_id\": \"66c9551c996fee15a88a28e4\",\n      \"address\": \"Pune, India\",\n      \"phone\": \"+1234567890\",\n      \"preferences\": {\n         \"newsletter\": true,\n         \"notifications\": false\n       }\n     }\n     ```\n   - **Response**:\n     ```json\n     {\n       \"message\": \"Details added/updated successfully\"\n     }\n     ```\n\n5. **Get User with Details**\n   - **Endpoint**: `http://localhost:8000/users/user_with_details/66c9551c996fee15a88a28e4`\n   - **Method**: `GET`\n   - **Response**:\n     ```json\n     {\n     \"user\": {\n        \"_id\": \"66c9551c996fee15a88a28e4\",\n        \"username\": \"sandesh bhujbal\",\n        \"email\": \"sandesh@gmail.com\",\n        \"password\": \"$2b$12$MC0v2olCE9VkElTkrnYWF.VziMU8hN.p/snX1TV.8LStnNx/QJ2Ja\",\n        \"linked_id\": \"123e4567-e89b-12d3-a456-426614174000\"\n     },\n     \"details\": {\n        \"_id\": \"66c9575a47d95a87f4559206\",\n        \"user_id\": \"66c9551c996fee15a88a28e4\",\n        \"address\": \"Pune, India\",\n        \"phone\": \"+1234567890\",\n        \"preferences\": {\n            \"newsletter\": true,\n            \"notifications\": false\n        }\n       }\n     }\n     ```\n\n6. **Delete User**\n   - **Endpoint**: `http://localhost:8000/users/delete_user/66c954f2996fee15a88a28e3`\n   - **Method**: `DELETE`\n   - **Response**:\n     ```json\n     {\n       \"message\": \"User and associated data deleted successfully\"\n     }\n     ```\n\n## Instructions\n\n1. **Setup FASTAPI and PyMongo**\n   - Create a new FastAPI application.\n   - Configure PyMongo to connect to your MongoDB instance.\n\n2. **Registration API**\n   - Create an endpoint to register new users with username, email, and password.\n   - Ensure that passwords are securely hashed before storing them in the database.\n\n3. **Login API**\n   - Create an endpoint to log in users by verifying their credentials (email and password).\n   - Implement appropriate error handling.\n\n4. **Linking ID API**\n   - Create an endpoint to link an ID to a user's account.\n   - Ensure the ID is securely stored and associated with the correct user.\n\n5. **Joins**\n   - Implement functionality to join data from multiple collections.\n\n6. **Chain Delete**\n   - Implement functionality to delete a user and all associated data across collections.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandesh300%2Fuser-management-and-data-integration-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsandesh300%2Fuser-management-and-data-integration-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandesh300%2Fuser-management-and-data-integration-api/lists"}