{"id":22666878,"url":"https://github.com/softcodenet/python_backend_test_project","last_synced_at":"2025-03-29T10:27:49.269Z","repository":{"id":257793230,"uuid":"811581903","full_name":"softcodenet/python_backend_test_project","owner":"softcodenet","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-06T22:26:03.000Z","size":32251,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-04T04:25:31.956Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/softcodenet.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-06T22:08:40.000Z","updated_at":"2024-06-06T22:26:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"d136fc92-02df-4c9f-b98d-2bb54ba842e4","html_url":"https://github.com/softcodenet/python_backend_test_project","commit_stats":null,"previous_names":["softcodenet/python_backend_test_project"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softcodenet%2Fpython_backend_test_project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softcodenet%2Fpython_backend_test_project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softcodenet%2Fpython_backend_test_project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softcodenet%2Fpython_backend_test_project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/softcodenet","download_url":"https://codeload.github.com/softcodenet/python_backend_test_project/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246170466,"owners_count":20734831,"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","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-12-09T14:32:07.928Z","updated_at":"2025-03-29T10:27:49.246Z","avatar_url":"https://github.com/softcodenet.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastAPI Web Application\n\nThis is a FastAPI web application following the MVC design pattern with SQLAlchemy for ORM and Pydantic for validation.\n\n## Endpoints\n\n- **Signup Endpoint**: `/auth/signup`\n  - Accepts `email` and `password`.\n  - Returns a token (JWT or randomly generated string).\n\n- **Login Endpoint**: `/auth/login`\n  - Accepts `email` and `password`.\n  - Returns a token upon successful login; error response if login fails.\n\n- **AddPost Endpoint**: `/posts/`\n  - Accepts `text` and a `token` for authentication.\n  - Validates payload size (limit to 1 MB), saves the post in memory, returning `postID`.\n  - Returns an error for invalid or missing token.\n  - Dependency injection for token authentication.\n\n- **GetPosts Endpoint**: `/posts/`\n  - Requires a token for authentication.\n  - Returns all user's posts.\n  - Implements response caching for up to 5 minutes for the same user.\n  - Returns an error for invalid or missing token.\n  - Dependency injection for token authentication.\n\n- **DeletePost Endpoint**: `/posts/{post_id}`\n  - Accepts `postID` and a `token` for authentication.\n  - Deletes the corresponding post from memory.\n  - Returns an error for invalid or missing token.\n  - Dependency injection for token authentication.\n\n## Installation\n\n1. Clone the repository.\n2. Create a virtual environment and activate it.\n3. Install the required dependencies using `pip install -r requirements.txt`.\n4. Set up your MySQL database and update the `SQLALCHEMY_DATABASE_URL` in `database.py`.\n5. Run the application using `uvicorn main:app --reload`.\n\n## Usage\n\n- Use the `/auth/signup` endpoint to create a new user.\n- Use the `/auth/login` endpoint to log in and obtain a token.\n- Use the token to authenticate requests to the `/posts/` endpoints.\n\n## Contributing\n\nContributions are welcome. Please create a pull request or open an issue for any changes or enhancements.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftcodenet%2Fpython_backend_test_project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftcodenet%2Fpython_backend_test_project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftcodenet%2Fpython_backend_test_project/lists"}