{"id":19263228,"url":"https://github.com/a-tetarwal/auth-jwt-bcrypt-ii","last_synced_at":"2026-06-17T19:33:07.120Z","repository":{"id":249662580,"uuid":"832155375","full_name":"A-Tetarwal/Auth-JWT-Bcrypt-II","owner":"A-Tetarwal","description":"Auth-JWT-Bcrypt-II is a Node.js project that demonstrates user authentication using JSON Web Tokens (JWT) and password hashing with bcrypt. The project includes a simple Express server with routes for user signup, login, and logout, and uses EJS for templating.","archived":false,"fork":false,"pushed_at":"2024-07-22T13:13:34.000Z","size":3430,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-23T18:47:48.507Z","etag":null,"topics":["authentication","authorization","backend","bcryptjs","cookie","jwt-token","learning-by-doing"],"latest_commit_sha":null,"homepage":"","language":"EJS","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/A-Tetarwal.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}},"created_at":"2024-07-22T13:03:32.000Z","updated_at":"2024-07-23T03:43:22.000Z","dependencies_parsed_at":"2024-07-22T15:53:59.167Z","dependency_job_id":null,"html_url":"https://github.com/A-Tetarwal/Auth-JWT-Bcrypt-II","commit_stats":null,"previous_names":["a-tetarwal/auth-jwt-bcrypt-ii"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/A-Tetarwal/Auth-JWT-Bcrypt-II","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/A-Tetarwal%2FAuth-JWT-Bcrypt-II","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/A-Tetarwal%2FAuth-JWT-Bcrypt-II/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/A-Tetarwal%2FAuth-JWT-Bcrypt-II/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/A-Tetarwal%2FAuth-JWT-Bcrypt-II/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/A-Tetarwal","download_url":"https://codeload.github.com/A-Tetarwal/Auth-JWT-Bcrypt-II/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/A-Tetarwal%2FAuth-JWT-Bcrypt-II/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34463552,"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-17T02:00:05.408Z","response_time":127,"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":["authentication","authorization","backend","bcryptjs","cookie","jwt-token","learning-by-doing"],"created_at":"2024-11-09T19:35:20.393Z","updated_at":"2026-06-17T19:33:07.103Z","avatar_url":"https://github.com/A-Tetarwal.png","language":"EJS","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Auth-JWT-Bcrypt-II\n\n## Overview\n\nAuth-JWT-Bcrypt-II is a Node.js project that demonstrates user authentication using JSON Web Tokens (JWT) and password hashing with bcrypt. The project includes a simple Express server with routes for user signup, login, and logout, and uses EJS for templating.\n\n## Prerequisites\n\n- Node.js and npm installed\n- MongoDB installed and running\n\n## Installation\n\n1. **Clone the repository:**\n    ```sh\n    git clone https://github.com/A-Tetarwal/Auth-JWT-Bcrypt-II.git\n    cd Auth-JWT-Bcrypt-II\n    ```\n\n2. **Install dependencies:**\n    ```sh\n    npm install\n    ```\n\n3. **Start the server:**\n    ```sh\n    node app.js\n    ```\n\n## Project Structure\n\n```\nAuth-JWT-Bcrypt-II\n│\n├── models\n│   └── user.js           # User model definition\n├── public\n│   └── stylesheets\n│       └── index.css     # CSS styles\n├── views\n│   ├── index.ejs         # Home page view\n│   ├── login.ejs         # Login page view\n├── app.js                # Main application file\n├── package.json          # Project metadata and dependencies\n└── README.md             # Project documentation\n```\n\n## Usage\n\n### Signup\n\n- **Route:** `/signup`\n- **Method:** `POST`\n- **Description:** Creates a new user, hashes the password, and returns a JWT token.\n- **Request Body:**\n    ```json\n    {\n        \"username\": \"your_username\",\n        \"email\": \"your_email\",\n        \"password\": \"your_password\",\n        \"age\": \"your_age\"\n    }\n    ```\n\n### Login\n\n- **Route:** `/login`\n- **Method:** `POST`\n- **Description:** Authenticates a user, verifies the password, and returns a JWT token.\n- **Request Body:**\n    ```json\n    {\n        \"email\": \"your_email\",\n        \"password\": \"your_password\"\n    }\n    ```\n\n### Logout\n\n- **Route:** `/logout`\n- **Method:** `GET`\n- **Description:** Logs out the user by clearing the JWT token cookie.\n- **Request Body:** None\n\n## Notes\n\n- The JWT secret key should be stored in an environment variable for security.\n- Proper error handling is implemented to provide meaningful feedback.\n- The project uses EJS for server-side rendering of HTML views.\n\n\n---\n\nFeel free to modify this README according to your project's specific details and requirements.\n\n## What is done?\n```\ncreate user account, \n    setup mongoose,\n    schema,\n    model,\n    usercreate -\u003e passwod -\u003e hash,\n    jwt token -\u003e cookie,\n\n    login -\u003e token -\u003e decrypt -\u003e email\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-tetarwal%2Fauth-jwt-bcrypt-ii","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa-tetarwal%2Fauth-jwt-bcrypt-ii","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-tetarwal%2Fauth-jwt-bcrypt-ii/lists"}