{"id":18866732,"url":"https://github.com/manavalan2517/login-and-register-system-using-python","last_synced_at":"2026-05-04T13:31:30.699Z","repository":{"id":232044969,"uuid":"782405256","full_name":"Manavalan2517/Login-and-Register-System-Using-Python","owner":"Manavalan2517","description":"This Python script includes both registration and login functionalities. It utilizes a local JSON file to store user credentials.","archived":false,"fork":false,"pushed_at":"2024-04-08T01:32:14.000Z","size":3299,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-30T14:36:24.817Z","etag":null,"topics":["json","login","python","register"],"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/Manavalan2517.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-04-05T08:30:53.000Z","updated_at":"2024-05-14T05:44:25.000Z","dependencies_parsed_at":"2024-05-11T17:52:03.776Z","dependency_job_id":null,"html_url":"https://github.com/Manavalan2517/Login-and-Register-System-Using-Python","commit_stats":null,"previous_names":["manavalan2517/login-and-register-system-using-python","manavalan-v/login-and-register-system-using-python"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Manavalan2517/Login-and-Register-System-Using-Python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Manavalan2517%2FLogin-and-Register-System-Using-Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Manavalan2517%2FLogin-and-Register-System-Using-Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Manavalan2517%2FLogin-and-Register-System-Using-Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Manavalan2517%2FLogin-and-Register-System-Using-Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Manavalan2517","download_url":"https://codeload.github.com/Manavalan2517/Login-and-Register-System-Using-Python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Manavalan2517%2FLogin-and-Register-System-Using-Python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32609372,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"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":["json","login","python","register"],"created_at":"2024-11-08T05:07:22.435Z","updated_at":"2026-05-04T13:31:30.677Z","avatar_url":"https://github.com/Manavalan2517.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Login-and-Register-System-Using-Python\n\n\n\nhttps://github.com/Manavalan2517/Login-and-Register-System-Using-Python/assets/112639423/960b4632-8146-4633-8835-40dcf369d781\n\n\n\n## Summary\nThe code snippet is a class called `Validate` that provides methods for validating and managing user registration, login, and account deletion. It uses the `bcrypt` library for password hashing and the `re` library for email validation. The class also includes methods for updating a JSON file with user data and checking if a username already exists.\n\n## Example Usage\n```python\nvalidateObj = Validate()\nvalidateObj.register_user(\"john\", \"password123\", \"john@example.com\")\nvalidateObj.login_user(\"john\", \"password123\")\nvalidateObj.delete_account(\"john\")\n```\n\n## Modules Used\n- `questionary`----\u003e `for creating interactive prompts and questionnaires`\n- `json`--------------\u003e `Used for parsing and generating JSON data`\n- `rich.console`---\u003e `enables rich text and beautiful formatting in the terminal`\n- `time.sleep`------\u003e `used to pause the execution of the script for a specified number of seconds.`\n- `bcrypt`------------\u003e `to build a cryptographic hash of passwords`\n- `re`------------------\u003e `used for searching, matching, and manipulating strings based on specific patterns`\n  \n## Code Analysis\n### Inputs\n- `username` (string): The username entered by the user.\n- `password` (string): The password entered by the user.\n- `email` (string): The email entered by the user.\n___\n### Flow\n1. The `Validate` class checks if the JSON file \"data.json\" exists. If not, it creates a new file with an empty \"gamedata\" dictionary.\n2. The `hash_password` method takes a password as input, generates a salt, and hashes the password using bcrypt.\n3. The `update_json` method updates the \"gamedata\" dictionary in the JSON file with the username, hashed password, and email.\n4. The `validate_username` method checks if the username is valid (not empty and contains only lowercase letters) and if it already exists in the JSON file.\n5. The `validate_password` method checks if the password meets certain criteria (minimum length, contains a number, lowercase letter, and uppercase letter).\n6. The `validate_email` method uses a regular expression to validate the email format.\n7. The `register_user` method validates the username, password, and email, hashes the password, and updates the JSON file with the user data.\n8. The `login_user` method checks if the username exists in the JSON file, retrieves the hashed password, and compares it with the entered password using bcrypt.\n9. The `delete_account` method checks if the username exists in the JSON file, deletes the user data from the \"gamedata\" dictionary, and updates the JSON file.\n10. The `register` function prompts the user to enter a username, password, and email, validates the inputs, and calls the `register_user` method.\n11. The `login` function prompts the user to enter a username and password, calls the `login_user` method, and displays a welcome message if successful.\n12. The `delete_account` function prompts the user to enter a username and password, calls the `login_user` method to validate the credentials, and calls the `delete_account` method to delete the user account.\n___\n### Outputs\n- The `register_user` method returns `True` if the registration is successful, and `False` if any validation error occurs.\n- The `login_user` method returns `True` if the login is successful, and `False` if the username or password is incorrect.\n- The `delete_account` method returns `True` if the account is successfully deleted, and `False` if the username is not found in the JSON file.\n___\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanavalan2517%2Flogin-and-register-system-using-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanavalan2517%2Flogin-and-register-system-using-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanavalan2517%2Flogin-and-register-system-using-python/lists"}