{"id":23272366,"url":"https://github.com/letsdeepchat/jwt-authentication","last_synced_at":"2025-04-06T09:52:35.931Z","repository":{"id":184423918,"uuid":"671859473","full_name":"letsdeepchat/JWT-Authentication","owner":"letsdeepchat","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-28T10:44:29.000Z","size":167,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-12T15:40:51.559Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/letsdeepchat.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-07-28T09:57:52.000Z","updated_at":"2023-07-28T10:10:07.000Z","dependencies_parsed_at":"2023-07-28T11:27:36.964Z","dependency_job_id":null,"html_url":"https://github.com/letsdeepchat/JWT-Authentication","commit_stats":null,"previous_names":["deepak14ri/jwt-authentication","letsdeepchat/jwt-authentication"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsdeepchat%2FJWT-Authentication","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsdeepchat%2FJWT-Authentication/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsdeepchat%2FJWT-Authentication/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsdeepchat%2FJWT-Authentication/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/letsdeepchat","download_url":"https://codeload.github.com/letsdeepchat/JWT-Authentication/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247463933,"owners_count":20942950,"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-19T19:14:59.982Z","updated_at":"2025-04-06T09:52:35.895Z","avatar_url":"https://github.com/letsdeepchat.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JWT Authentication Starter (MERN)\r\n\u003cimg width=\"990\" alt=\"main page\" src=\"https://github.com/deepak14ri/JWT-Authentication/assets/49471265/1f7ebeb2-53d4-4bb3-9167-a193d8e95772\"\u003e\r\n\r\nThis is a starter app for a MERN stack application with authentication. This is for a SPA (Single Page Application) workflow that uses the [Vite](https://vite.dev) Build tool. \r\n\r\nIt includes the following:\r\n\r\n- Backend API with Express \u0026 MongoDB\r\n- Routes for auth, logout, register, profile, update profile\r\n- JWT authentication stored in HTTP-only cookie\r\n- Protected routes and endpoints\r\n- Custom middleware to check JSON web token and store in cookie\r\n- Custom error middleware\r\n- React frontend to register, login, logout, view profile, and update profile\r\n- Applied CRUD operation in home page and filter on email and name basis\r\n- React Bootstrap UI library\r\n- React Toastify notifications\r\n\r\n## Usage\r\n\r\n- Create a MongoDB database and obtain your `MongoDB URI` - [MongoDB Atlas](https://www.mongodb.com/cloud/atlas/register)\r\n\r\n### Env Variables\r\n\r\n`.env` contails Mongodb URI and secret key\r\n\r\n```\r\nNODE_ENV = development\r\nPORT = 5000\r\nMONGO_URI = your mongodb uri\r\nJWT_SECRET = 'abc123'\r\n```\r\n\r\n\r\n### Install Dependencies (frontend \u0026 backend)\r\n\r\n```\r\nnpm install\r\ncd frontend\r\nnpm install\r\n```\r\n\r\n### Run\r\n\r\n```\r\n\r\n# Run frontend (:3000) \u0026 backend (:5000)\r\nnpm run dev\r\n\r\n# Run backend only\r\nnpm run server\r\n```\r\n\r\n## Build \u0026 Deploy\r\n\r\n```\r\n# Create frontend prod build\r\ncd frontend\r\nnpm run build\r\n```\r\n![updatepage](https://github.com/deepak14ri/JWT-Authentication/assets/49471265/766209fe-1826-4595-a928-d1502da39e7b)\r\n\r\n![main2](https://github.com/deepak14ri/JWT-Authentication/assets/49471265/f43cee0f-e1dd-4d1d-b809-946b5815358a)\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletsdeepchat%2Fjwt-authentication","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fletsdeepchat%2Fjwt-authentication","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletsdeepchat%2Fjwt-authentication/lists"}