{"id":24774379,"url":"https://github.com/pabvald/fast-api-test","last_synced_at":"2026-05-17T11:32:00.078Z","repository":{"id":292833934,"uuid":"533373445","full_name":"pabvald/fast-api-test","owner":"pabvald","description":"Minimal API with FastAPI to manage users","archived":false,"fork":false,"pushed_at":"2023-06-09T09:50:32.000Z","size":39,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-28T00:58:54.430Z","etag":null,"topics":["fastapi","python","testing","try-out"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pabvald.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2022-09-06T14:54:30.000Z","updated_at":"2025-05-08T14:40:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"37ebd29a-a0b6-459c-989d-2178e673237d","html_url":"https://github.com/pabvald/fast-api-test","commit_stats":null,"previous_names":["pabvald/fast-api-test"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pabvald/fast-api-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabvald%2Ffast-api-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabvald%2Ffast-api-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabvald%2Ffast-api-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabvald%2Ffast-api-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pabvald","download_url":"https://codeload.github.com/pabvald/fast-api-test/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabvald%2Ffast-api-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33136693,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["fastapi","python","testing","try-out"],"created_at":"2025-01-29T05:48:44.668Z","updated_at":"2026-05-17T11:32:00.072Z","avatar_url":"https://github.com/pabvald.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Small API \n\nAuthor: Pablo Valdunciel\n\nDate:  07/09/2022\n\n## Comments on implementation decisions\n\n1. Uniqueness of the username: the inclusion of the `UNIQUE` constraint for the username does not seem appropriate, since two people can easily have the same name, especially if it is a common name. In a real scenario, the `UNIQUE` constraint should be applied to the `username` in any case, since the username is usually used as an alternate primary key. \n\n2. Including the `TVShow` table. When it comes to representing *Enums* in databases, there are two possibilities:\n\n    - Inserting a table containing the possible values of the *Enum* and adding a *foreign key* in the main table.\n    - Inserting a *string* column in the main table\n\n    The decision can be made based on how much space each of the two approaches takes up. In general, it is better to insert an additional table if the *enum* has few values, so the *string* column would have many repetitions. \n\n    In this task, I chose the fastest to implement option, which is to simply insert a *string* column, and ignored the space complexity issue.\n\n## Execution\n\n### Command prompt\n\nFirst, create a virtual environment and activate it.\n```bash\npython -m venv .venv\nsource .venv/bin/activate # (Linux) .venv/Scripts/activate (Windows)\n```\n\nSecond, install the dependencies.\n\n```bash\npip install -r api/requirements.txt\n```\n\nFinally, start the FastAPI app.\n\n```bash\ncd api\npython run.py\n```\n\nThe API is available at [localhost:8080/](http://localhost:8080/).\n\n### Docker \n\nExecute the following commands. To do so, it is necessary to have Docker and Docker Compose installed.\n\n```bash\ndocker-compose build \ndocker-compose up\n```\n\nThe API is available at [localhost:8080/](http://localhost:8080/).\n\n## Testing \n\nThe tests can be found in the `test/` folder. To run the tests, execute the following commands:\n\n```bash\ncd api\npython -m pytest ./test/\n```\n\n## Documentation \nOnce the FastAPI app is running, the documentation is available under [localhost/8080/redoc](http://localhost:8080/redoc)\n\n\n## Resources \n\n- [FastAPI Tutorial - User Guide](https://fastapi.tiangolo.com/tutorial/)\n- [GUID type with SQLAlchemy](https://fastapi-utils.davidmontague.xyz/user-guide/basics/guid-type/)\n- [Pydantic - Usage - Models](https://pydantic-docs.helpmanual.io/usage/models/)\n- [DB configuration for testing](https://stackoverflow.com/questions/67255653/how-to-set-up-and-tear-down-a-database-between-tests-in-fastapi)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpabvald%2Ffast-api-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpabvald%2Ffast-api-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpabvald%2Ffast-api-test/lists"}