{"id":26329081,"url":"https://github.com/adrianmdeiros/jwt-auth-api-example","last_synced_at":"2026-04-10T02:40:13.484Z","repository":{"id":235647562,"uuid":"791023315","full_name":"adrianmdeiros/jwt-auth-api-example","owner":"adrianmdeiros","description":"Exemplo de autenticação JWT feita com TypeScript, Node.js, Express.js, Prisma ORM e PostgreSQL","archived":false,"fork":false,"pushed_at":"2025-05-25T15:50:52.000Z","size":153,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"development","last_synced_at":"2025-07-10T23:11:08.651Z","etag":null,"topics":["docker","express","jwt","nodejs","postgresql","prisma-orm","tyepscript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/adrianmdeiros.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":"2024-04-24T00:35:12.000Z","updated_at":"2025-06-02T13:21:12.000Z","dependencies_parsed_at":"2025-05-08T13:43:35.014Z","dependency_job_id":"9787bf33-d5c3-4c93-9193-141ab0b87e7d","html_url":"https://github.com/adrianmdeiros/jwt-auth-api-example","commit_stats":null,"previous_names":["adrianmedeirosdev/jwt-auth-api-exemple","adrianmedeirosdev/jwt-auth-api-example","adrianmdeiros/jwt-auth-api-example","adrianmdeiros/jwt-auth-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/adrianmdeiros/jwt-auth-api-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianmdeiros%2Fjwt-auth-api-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianmdeiros%2Fjwt-auth-api-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianmdeiros%2Fjwt-auth-api-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianmdeiros%2Fjwt-auth-api-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adrianmdeiros","download_url":"https://codeload.github.com/adrianmdeiros/jwt-auth-api-example/tar.gz/refs/heads/development","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianmdeiros%2Fjwt-auth-api-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273842869,"owners_count":25177921,"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","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["docker","express","jwt","nodejs","postgresql","prisma-orm","tyepscript"],"created_at":"2025-03-15T21:19:26.732Z","updated_at":"2025-12-30T20:06:31.357Z","avatar_url":"https://github.com/adrianmdeiros.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔐 jwt-auth-api-example\n\n\u003ca href=\"https://opensource.org/license/mit/\" target=\"_blank\"\u003e\n  \u003cimg alt=\"License\" src=\"https://img.shields.io/static/v1?label=license\u0026message=MIT\u0026color=49AA26\u0026labelColor=000000\" \u003e\n\u003c/a\u003e\n\n\u003cbr/\u003e\n\u003cbr/\u003e\n\nAPI de autenticação JWT feita com TypeScript e Prisma ORM\n\n## Como testar\n\nClone o repositório:\n\n```console\ngit clone https://github.com/adrianmedeirosdev/jwt-auth-api-example.git\n```\n\n\u003cbr\u003e\n\nO docker compose irá subir os containers da aplicação Node e banco de dados postgreSQL:\n\n```console\ndocker compose up -d\n```\n\nO container da aplicação deve estar disponível em:\n\n```console\nhttp://localhost:3000\n```\n\nUtilize um REST API Client de sua preferência para testar.\nSe você usa VSCode, recomendo a extensão Thunder Client:\n\n\u003cimg src=\".github/assets/thunder-client.png\" \u003e\n\n\u003cbr\u003e \nExemplo:\n\u003cimg src=\".github/assets/thunder-client-example.png\" \u003e\n\n\u003cbr\u003e\n\n## Endpoints\n\nPOST /api/users\n\n_Request_\n\n```json\n{\n    \"email\": \"email@example.com\",\n    \"password\": \"senha_secreta\"\n}\n```\n\n_Response_\n\n```json\n{\n    \"id\": \"d06ef51a-1dbb-464b-ae64-bd0263eef1b6\",\n    \"email\": \"email@example.com\"\n}\n```\n\n\u003cbr/\u003e\n\nPOST /api/auth\n\n_Request_\n\n```json\n{\n    \"email\": \"email@example.com\",\n    \"password\": \"senha_secreta\"\n}\n```\n\n_Response_\n\n```json\n{\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6Ijk2MmRkYTU2LWY2MDgtNDk5Zi05Y2M3LTIxZmM2MjRmOTY1OSIsImlhdCI6MTcxMzkyNTA0NywiZXhwIjoxNzE0MDExNDQ3fQ.xBiNAfMJrjk9tpicpIYr4Y7wdD93d2RlZRFT3W5m9dw\"\n}\n```\n\n_Token Payload_\n```json\n{\n  \"user\": {\n    \"id\": \"d06ef51a-1dbb-464b-ae64-bd0263eef1b6\",\n    \"email\": \"email@example.com\"\n  },\n  \"iat\": \"1615462547\",\n  \"exp\": \"1615462547\"\n}\n```\n\n\u003cbr/\u003e\n\nGET /api/users 🔒\n\n_Request_\n\n```javascript\n// Exemplo com JavaScript\n\nconst response = await fetch('/api/users', {\n    headers: {\n        'Content-Type': 'application/json'\n        'Authorization': 'Bearer ' + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6Ijk2MmRkYTU2LWY2MDgtNDk5Zi05Y2M3LTIxZmM2MjRmOTY1OSIsImlhdCI6MTcxMzkyNTA0NywiZXhwIjoxNzE0MDExNDQ3fQ.xBiNAfMJrjk9tpicpIYr4Y7wdD93d2RlZRFT3W5m9dw'\n    }\n})\n```\n\n_Response_\n\n```json\n{\n    \"message\": \"You are allowed to see this only because you have a token\"\n}\n```\n\n### 🚀 Tecnologias\n\nEsse projeto foi desenvolvido com essas tecnologias:\n\n- TypeScript, Node.js, Express.js e Prisma ORM\n- Git and Github\n- bcryptjs, jsonwebtoken, vitest, cors, http-status-codes, tsx e tsup\n\n### ⚖ Licença\n\n\u003cp\u003e Este projeto está sobre \u003ca href=\"https://opensource.org/license/mit/\" target=\"_blank\"\u003eThe MIT License\u003c/a\u003e \u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrianmdeiros%2Fjwt-auth-api-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadrianmdeiros%2Fjwt-auth-api-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrianmdeiros%2Fjwt-auth-api-example/lists"}