{"id":28862395,"url":"https://github.com/theshefer/jwt-auth","last_synced_at":"2026-06-11T10:31:39.983Z","repository":{"id":239477146,"uuid":"799636876","full_name":"theshefer/JWT-auth","owner":"theshefer","description":"How to implement JWT authorization in your application","archived":false,"fork":false,"pushed_at":"2024-07-06T12:29:02.000Z","size":1587,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-11T03:36:36.543Z","etag":null,"topics":["docker","jwt-authorization","mongodb","node-js","react"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/theshefer.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-05-12T18:16:55.000Z","updated_at":"2025-01-27T08:06:55.000Z","dependencies_parsed_at":"2024-05-20T18:36:47.131Z","dependency_job_id":null,"html_url":"https://github.com/theshefer/JWT-auth","commit_stats":null,"previous_names":["sssshefer/json-web-token-auth","theshefer/jwt-auth"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/theshefer/JWT-auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theshefer%2FJWT-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theshefer%2FJWT-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theshefer%2FJWT-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theshefer%2FJWT-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theshefer","download_url":"https://codeload.github.com/theshefer/JWT-auth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theshefer%2FJWT-auth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34195112,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"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","jwt-authorization","mongodb","node-js","react"],"created_at":"2025-06-20T06:10:47.772Z","updated_at":"2026-06-11T10:31:39.950Z","avatar_url":"https://github.com/theshefer.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"https://github.com/sssshefer/JWT-auth/assets/63253440/0da60f27-3cb9-4a3c-8844-fc43b2d85d0f\" width=\"24\"\u003e JWT Authentication\n\nThis application demonstrates the benefits of using **Json Web Tokens** (JWT) for authentication. The app is built with React, TypeScript, Express, Node.js, MongoDB and Docker\n\n## Table of Contents\n\n- [Features](#features)\n- [Test User Credentials For Website](#test-user-credentials-for-website)\n- [Exciting Features to Explore in This Project](#exciting-features-to-explore-in-this-project)\n- [Project Structure](#project-structure)\n  - [Backend](#backend)\n    - [Authentication](#authentication)\n    - [Database](#database)\n    - [Emails](#emails)\n  - [Frontend](#frontend)\n    - [User Interface](#user-interface)\n    - [Persistent Login](#persistent-login)\n- [How to Run Locally](#how-to-run-locally)\n- [NGINX Container](#nginx-container)\n## Features\n\n- **Sign Up and Login**: Create an account and log in using JWT for secure session management\n- **Persistent Login**: Stay logged in even after reloading the page or closing the browser\n- **Password Recovery**: Recover your password via email if you have access to the provided email address\n- **Change Password**: Change your password from the \"Account\" page, which will log you out from all devices\n- **Auto-Saved Inputs**: Update your first and last name on the \"Account\" page with debounced input that auto-saves after a short delay\n- **Password Change Alerts**: Receive warnings when the password on your account is changed to enhance security\n  \n## Test User Credentials For Website\n\n- **Email**: test@test.com\n- **Password**: 12345678\n\nYou can sign up with real credentials, and the application will send a confirmation email. To bypass email confirmation, check the \"Turn off email confirmation\" checkbox\n\n## Exciting Features to Explore in This Project\n\n1. **Sign Up**: Create an account using the test credentials or your own email\n2. **Log In**: Log in with your credentials to access protected routes and features\n3. **Account Management**: \n    - Recover your password if needed\n    - Change your password from the \"Account\" page\n    - Update your first and last name with auto-saved inputs\n   \n## Project Structure\n\n### Backend\n\nThe backend is built with **Express** and **Node.js** and handles core functionalities which is to process user requests\n\n- #### **Authentication**: \n  Uses **JWT** to manage user sessions securely\n        \n\u003e [!NOTE] \n\u003e Tokens in JWT are issued upon login and included with each request to verify the user's identity. We need them to authenticate users without repeated database queries, improving performance. JWT is secure because it uses signatures to ensure the token's integrity and authenticity\n\u003e\n\u003e **Access Tokens** are short-lived tokens used to access protected resources. They are typically stored in memory or local storage on the client side\n\u003e\n\u003e **Refresh Tokens** are long-lived tokens used to obtain new access tokens when the current one expires. They are usually stored in HTTP-only cookies to enhance security, preventing JavaScript access and           reducing the risk of XSS attacks\n\n- #### **Database**:\n  Stores user data in **MongoDB**, a NoSQL database known for high availability and scalability\n\n- #### **Emails**:\n  The email service is implemented with **Nodemailer**, allowing the application to send confirmation and password recovery emails\n  \n\n### Frontend\n\nThe frontend is developed with **React** and **TypeScript**:\n\n-  #### **User Interface**:\n    User-friendly UI with components for signing up, logging in, and managing account settings\n\n- #### **Persistent Login**:\n    Supports persistent login through secure storage of JWT\n\n## How to Run locally \nTo start the application, first clone the repository\n```bash\ngit clone \u003crepository_url\u003e\n```\n\nThen, navigate to the project directory and run the following commands:\n```bash\ndocker-compose build\ndocker-compose up\n```\n\n\u003e [!IMPORTANT]  \n\u003e **Ecosystem Config Files**\n\u003e \n\u003e In order to use the application locally, you'll need the `ecosystem.config.js` file for both the frontend and backend. However, these files contain confidential data and cannot be uploaded here. \n\u003e Make sure to create these files yourself with the necessary configurations before running the application locally. But it's much easier to try the project online by following the link\n\n## NGINX container\nThe NGINX configurations are not completed, but you can utilize the templates provided to configure it according to your needs\n\n\n*Happy coding*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheshefer%2Fjwt-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheshefer%2Fjwt-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheshefer%2Fjwt-auth/lists"}