{"id":22300101,"url":"https://github.com/rohitedathil/user_api","last_synced_at":"2026-04-15T15:32:17.253Z","repository":{"id":138305803,"uuid":"436848229","full_name":"RohitEdathil/user_api","owner":"RohitEdathil","description":"An api for managing users created as a part of IKS Internship selection process.","archived":false,"fork":false,"pushed_at":"2021-12-12T15:09:59.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-23T21:51:53.863Z","etag":null,"topics":["api","fastapi","internship-task","mysql","project","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/RohitEdathil.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":"2021-12-10T04:21:04.000Z","updated_at":"2022-03-22T07:26:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"ba3490b0-2b1c-458f-bac4-0a668f8944e6","html_url":"https://github.com/RohitEdathil/user_api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RohitEdathil/user_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RohitEdathil%2Fuser_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RohitEdathil%2Fuser_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RohitEdathil%2Fuser_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RohitEdathil%2Fuser_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RohitEdathil","download_url":"https://codeload.github.com/RohitEdathil/user_api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RohitEdathil%2Fuser_api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31847634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"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":["api","fastapi","internship-task","mysql","project","python"],"created_at":"2024-12-03T18:09:08.943Z","updated_at":"2026-04-15T15:32:17.229Z","avatar_url":"https://github.com/RohitEdathil.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# user_api\n\nAn api for managing users created as a part of IKS Internship selection process.\n\n![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge\u0026logo=python\u0026logoColor=ffdd54)\n![FastAPI](https://img.shields.io/badge/FastAPI-005571?style=for-the-badge\u0026logo=fastapi)\n![MySQL](https://img.shields.io/badge/mysql-%2300000f.svg?style=for-the-badge\u0026logo=mysql\u0026logoColor=white)\n\n# Installation\n\n- ### Install dependencies using\n\n```\npip install -r requirements.txt\n```\n\n- ### Set up environment variables\n  - `SQL_HOST` : hostname of the database\n  - `SQL_USER` : username of the database\n  - `SQL_PASSWORD` : password of the database\n  - `SQL_DATABASE` : name of the database\n  - `SALT` : salt for password hashing\n- ## Create tables\n  Run the command to create the tables.\n ```\n python rebuild_tables.py\n ```\n# Usage\n\nAll the scripts use the environment variables to connect to the database. So make sure to set them up before running the scripts.\n\n- ### app\u0026#46;py\n  Contains all the main functions of the API.\n\nRun the app using (In development mode)\n\n```\nuvicorn app:app --reload\n```\n\nFor deployment, refer [here.](https://fastapi.tiangolo.com/deployment/)\n\n- ### data_cleanup\u0026#46;py\n  Runs a script to automatically clean up the expired data in the database. Keep it running along with the app.\n\nRun the script using\n\n```\npython data_cleanup.py\n```\n\n- ### rebuild_tables.py\n  Runs a script to automatically rebuild the tables in the database. **It will drop all the tables and creates them again**.\n  This script should only be run when the model is updated.\n\nRun the script using\n\n```\npython rebuild_tables.py\n```\n\n# Routes\n\n- ## **/docs** or **/**\n\nSwagger UI for the api. A simple way to get started with the api. Documentation provided as per openapi specification.\n\n- ## **/invite**\n\n  Creates an invitation for a new user.\n\n  - ### Parameters:\n\n    - `name`: Name of the user (Required, Max Length: 100)\n    - `phone`: Phone number of the user (Required, Max Length: 20)\n    - `email`: Email of the user (Required, Max Length: 100)\n    - `alternate_email`: Alternate email of the user (Optional, Max Length: 100)\n    - `organizations`: [\n\n      { \\\n       `name`: Name of the organization (Required, Max Length: 100) \\\n       `role`: Role of the user in the organization (Required, Max Length: 100) \\\n       `valid_till`: Date when the user will be valid till (Optional) \\\n       } \\\n       . \\\n       . \\\n       ] (Must be inside a List, Optional)\n\n  - ### Returns:\n    - `invite_id`: Unique code to be for signing up\n    - `expires_at`: Date and time when the invitation expires\n\n- ## **/create**\n\n  Signs up a user with an invitation code.\n\n  - ### Parameters:\n\n    - `invite_code`: Invitation code (Required, Max Length: 10)\n    - `password`: Password of the user (Required, Max Length: 100)\n\n  - ### Returns:\n    - `message`: Success message if the user is signed up successfully\n\n- ## **/login**\n\n  Logs in a user.\n\n  - ### Parameters:\n\n    - `email`: Email of the user (Required, Max Length: 100)\n    - `password`: Password of the user (Required, Max Length: 100)\n\n  - ### Returns:\n    - `token`: Token to be used for verifying the user\n    - `expires_at`: Date and time when the token expires\n\n- ## **/logout**\n\n  Logs out a user.\n\n  - ### Parameters:\n\n    - `token`: Token to be used for verifying the user (Required, Max Length: 100)\n\n  - ### Returns:\n    - `message`: Success message if the user is logged out successfully\n\n- ## **/edit**\n\n  Edits the info of the currently logged in user.\n\n  - ### Parameters:\n\n    - `token` : A valid token obtained at the time of login\n    - `name`: Name of the user (Optional, Max Length: 100)\n    - `phone`: Phone number of the user (Optional, Max Length: 20)\n    - `email`: Email of the user (Optional, Max Length: 100)\n    - `alternate_email`: Alternate email of the user (Optional, Max Length: 100)\n    - `profile_pic`: URL to the profile picture of the user (Optional, Max Length: 200)\n    - `organizations`: [\n\n      { \\\n       - `name`: Name of the organization (Required, Max Length: 100) \\\n       - `role`: Role of the user in the organization (Required, Max Length: 100) \\\n       - `valid_till`: Date when the user will be valid till (Optional) \\\n       } \\\n       . \\\n       . \\\n\n      ] (Must be inside a List, Optional, If provided all the existing roles of the user will be overwritten)\n\n  - ### Returns:\n    - `message`: Success message if editted successfully\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frohitedathil%2Fuser_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frohitedathil%2Fuser_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frohitedathil%2Fuser_api/lists"}