{"id":24069343,"url":"https://github.com/sugiartofahmi/express-prisma-vercel","last_synced_at":"2026-08-06T19:30:31.556Z","repository":{"id":181096344,"uuid":"658048673","full_name":"sugiartofahmi/express-prisma-vercel","owner":"sugiartofahmi","description":"Learn to build an authentication REST API with prisma","archived":false,"fork":false,"pushed_at":"2023-07-14T01:45:06.000Z","size":44,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T09:11:18.480Z","etag":null,"topics":["express","jwt-authentication","postgresql","prisma","vercel"],"latest_commit_sha":null,"homepage":"https://express-prisma-jwt.vercel.app","language":"JavaScript","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/sugiartofahmi.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}},"created_at":"2023-06-24T15:51:26.000Z","updated_at":"2025-02-28T20:34:08.000Z","dependencies_parsed_at":"2023-07-14T02:43:13.062Z","dependency_job_id":null,"html_url":"https://github.com/sugiartofahmi/express-prisma-vercel","commit_stats":null,"previous_names":["sugiartofahmi/express-prisma-vercel"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sugiartofahmi/express-prisma-vercel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sugiartofahmi%2Fexpress-prisma-vercel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sugiartofahmi%2Fexpress-prisma-vercel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sugiartofahmi%2Fexpress-prisma-vercel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sugiartofahmi%2Fexpress-prisma-vercel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sugiartofahmi","download_url":"https://codeload.github.com/sugiartofahmi/express-prisma-vercel/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sugiartofahmi%2Fexpress-prisma-vercel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36345965,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-08-06T04:43:03.162Z","status":"ssl_error","status_checked_at":"2026-08-06T04:43:02.660Z","response_time":54,"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":["express","jwt-authentication","postgresql","prisma","vercel"],"created_at":"2025-01-09T14:09:15.247Z","updated_at":"2026-08-06T19:30:31.244Z","avatar_url":"https://github.com/sugiartofahmi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Express Prisma JWT\n\nLearn to create authentication with express js\n\n## Installation\n\n### Clone\n\n```bash\n  git clone git@github.com:sugiartofahmi/express-refresh-token.git\n```\n\n### Install\n\n```bash\n  yarn\n```\n\n### Development\n\n```bash\n  yarn dev\n```\n\n## Setup\n\n- ENV\n\n  1. rename .env-example to .env\n  2. change value on env\n     `PORT, DB_URL and JWT_SECRET`\n\n  example :\n\n  ```bash\n    PORT = 9000\n  ```\n\n  ```bash\n    DB_URL = mongodb+srv://\u003cusername\u003e:\u003cpassword\u003e@cluster0.8lcu8fs.mongodb.net/my-db\n  ```\n\n  ```bash\n    JWT_SECRET = jwtscrect\n  ```\n\n# API Spec\n\n## Register\n\nEndpoint : POST /auth/register\n\nRequest Body :\n\n```json\n{\n  \"email\": \"test@gmail.com\",\n  \"password\": \"passwordmu\",\n  \"name\": \"Nama Kamu\"\n}\n```\n\nResponse Body Success :\n\n```json\n{\n  \"status\": \"success\",\n  \"user\": {\n    \"_id\": \"id\",\n    \"name\": \"Nama Kamu\",\n    \"email\": \"test@gmail.com\"\n  }\n}\n```\n\nResponse Body Error :\n\n```json\n{\n  \"status\": \"failed\",\n  \"message\": \"email already exist, please login\"\n}\n```\n\n```json\n{\n  \"status\": \"failed\",\n  \"message\": \"password not match\"\n}\n```\n\n## Login\n\nEndpoint : POST /auth/login\n\nRequest Body :\n\n```json\n{\n  \"email\": \"test@gmail.com\",\n  \"password\": \"passwordmu\"\n}\n```\n\nResponse Body Success :\n\n```json\n{\n  \"status\": \"success\",\n  \"user\": {\n    \"_id\": \"id\",\n    \"name\": \"Nama Kamu\",\n    \"email\": \"test@gmail.com\"\n  },\n  \"token\": {\n    \"access_token\": \"unique-token\",\n    \"refresh_token\": \"unique-token\"\n  }\n}\n```\n\nResponse Body Error :\n\n```json\n{\n  \"status\": \"failed\",\n  \"message\": \"account not found\"\n}\n```\n\n```json\n{\n  \"status\": \"failed\",\n  \"message\": \"Wrong  password\"\n}\n```\n\n## Refresh Token\n\nEndpoint : POST /auth/refresh\n\nRequest Body :\n\n```json\n{\n  \"refresh_token\": \"unique-token\"\n}\n```\n\nResponse Body Success :\n\n```json\n{\n  \"status\": \"success\",\n  \"access_token\": \"unique-token\"\n}\n```\n\nResponse Body Error :\n\n```json\n{\n  \"status\": \"failed\",\n  \"message\": \"Token is not valid\"\n}\n```\n\n## Get User\n\nEndpoint : GET /user/me\n\nHeaders :\n\n- Authorization :Bearer token\n\nResponse Body Success:\n\n```json\n{\n  \"status\": \"success\",\n  \"user\": {\n    \"_id\": \"id\",\n    \"name\": \"Nama Kamu\",\n    \"email\": \"test@gmail.com\"\n  }\n}\n```\n\nResponse Body Error :\n\n```json\n{\n  \"status\": \"failed\",\n  \"message\": \"Token is not valid\"\n}\n```\n\n## Logout\n\nEndpoint : POST /auth/logout\n\nRequest Body :\n\n```json\n{\n  \"refresh_token\": \"unique-token\"\n}\n```\n\nResponse Body Success:\n\n```json\n{\n  \"status\": \"success\",\n  \"message\": \"Logged Out Sucessfully\"\n}\n```\n\nResponse Body Error :\n\n```json\n{\n  \"status\": \"failed\",\n  \"message\": \"Invalid token\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsugiartofahmi%2Fexpress-prisma-vercel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsugiartofahmi%2Fexpress-prisma-vercel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsugiartofahmi%2Fexpress-prisma-vercel/lists"}