{"id":24200310,"url":"https://github.com/joaooliveirapro/app-flask-api","last_synced_at":"2025-07-16T19:34:52.855Z","repository":{"id":97160572,"uuid":"208435774","full_name":"joaooliveirapro/app-flask-api","owner":"joaooliveirapro","description":"Boilerplate Auth and User Registration Flask API","archived":false,"fork":false,"pushed_at":"2019-09-14T21:49:31.000Z","size":117,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-03T09:31:43.755Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joaooliveirapro.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}},"created_at":"2019-09-14T12:14:31.000Z","updated_at":"2024-02-05T18:37:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"e0d0971d-49f2-4270-ae89-9197430bf074","html_url":"https://github.com/joaooliveirapro/app-flask-api","commit_stats":null,"previous_names":["joaooliveirapro/app-flask-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/joaooliveirapro/app-flask-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaooliveirapro%2Fapp-flask-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaooliveirapro%2Fapp-flask-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaooliveirapro%2Fapp-flask-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaooliveirapro%2Fapp-flask-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joaooliveirapro","download_url":"https://codeload.github.com/joaooliveirapro/app-flask-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaooliveirapro%2Fapp-flask-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265534802,"owners_count":23783891,"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":"2025-01-13T20:41:54.120Z","updated_at":"2025-07-16T19:34:52.836Z","avatar_url":"https://github.com/joaooliveirapro.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Boilerplate Auth and User Registration Flask API\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/j-000/ezresbackend/blob/master/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/apm/l/vim-mode?color=blue\u0026style=flat-square\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.python.org/\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/built%20with-Python-blue.svg?style=flat-square\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://docs.pytest.org/en/latest/\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/tested%20with-Pytest-green.svg?style=flat-square\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nThis project contains a boilerplate backend Authentication module with Login, Logout and Refresh session capabilities base on JWT technology. For the JWT this project uses [PyJWT](https://pyjwt.readthedocs.io/en/latest/).\n\nIt has been implemented using [Flask-RESTful](https://flask-restful.readthedocs.io/en/latest/) and has been rigourously tested using [pytest](https://docs.pytest.org/en/latest/).\n\nThis project also uses [marshmallow](https://marshmallow.readthedocs.io/en/stable/) as a Schema serializer to easily provide JSON-formatted output for all API endpoints. Data models use [Flask-SQLAlchemy](https://flask-sqlalchemy.palletsprojects.com/en/2.x/) as the [ORM](https://en.wikipedia.org/wiki/Object-relational_mapping). A [custom decorator](https://github.com/j-000/ezresbackend/blob/master/decorators.py) has been added to protect API routes that require authentication.\n\nThis project can be further customisable to attend to your individual project needs. It can be used in conjuction with any frontend framework like [Vue.js](https://vuejs.org/) to create full-stack applications.\n\n## Clone and run tests\nClone the repo, create a virtual environment and activate it. Install the dependencies necessary and run the tests.\n```\ngit clone git@github.com:j-000/ezresbackend.git\ncd ezresbackend\nvirtualenv venv\nsource venv/bin/activate\npip install -r requirements.txt\npytest -v\n```\n\u003cimg src=\"https://github.com/j-000/ezresbackend/blob/master/repo/tests.png\" height=\"300\"/\u003e\n\n:warning: Make sure you change the applicationsecrets.py details, expecially the `SECRET_KEY` and `SECURITY_PASSWORD_SALT` :warning:\n\n## Try it\nCurrent API routes are:\n\nRegister a user.\n```\nPOST /api/user\n\npayload={'email':'joao@example.com', 'name':'Joao', 'password':'test123'}\n\n# response\n{\n  \"message\": \"User created.\",\n  \"success\": true,\n  \"user\": {\n    \"email\": \"joao@example.com\",\n    \"id\": 1,\n    \"is_admin\": false,\n    \"name\": \"Joao\"\n  }\n}\n```\n\nGet total users registered.\n```\nGET /api/user\n\n# response\n{\n  \"usersRegistered\": 1\n}\n```\n\nLogin.\n```\nPOST /api/auth\nheaders = {'content-type':'application/json'}\npayload = {'email':'joao@example.com', 'password':'test123'}\n\n# response\n{\n  \"expires\": 3600,\n  \"success\": true,\n  \"token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1Ni...AC8z71WOuvMToh2IbqdqHDAX_mcJSnlWevKONqAJp4\"\n}\n```\n\nRefresh Token.\n```\nPUT /api/auth\nheaders = {'Authorization':f'Bearer {token}'}\n\n# response\n{\n  \"success\": \"New token.\",\n  \"token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1...hZ4ptK5KdrdgqMLK-cx11f-Qc_E-yw-8WuNggvOF13rwg\"\n}\n```\n\nLogout.\n```\nDELETE /api/auth\nheaders = {'Authorization':f'Bearer {token}'}\n\n# response\n{\n  \"success\": \"Logged out.\"\n}\n```\n\nLicence MIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoaooliveirapro%2Fapp-flask-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoaooliveirapro%2Fapp-flask-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoaooliveirapro%2Fapp-flask-api/lists"}