{"id":19475024,"url":"https://github.com/saibarathr/jwt-login-service","last_synced_at":"2026-04-05T22:36:33.430Z","repository":{"id":213684320,"uuid":"734634753","full_name":"SaiBarathR/jwt-login-service","owner":"SaiBarathR","description":"This Node.js authentication server is designed to provide JWT authentication for a sign-in/sign-up client. It includes Google Sign-In integration, manual sign-up/sign-in, and user management features. The server is built using Node.js, Express, Sequelize, and PostgreSQL.","archived":false,"fork":false,"pushed_at":"2024-07-26T10:11:43.000Z","size":98,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-08T06:29:40.688Z","etag":null,"topics":["expressjs","googleoauth2","jwt-authentication","nodejs","postgresql","sequelize"],"latest_commit_sha":null,"homepage":"","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/SaiBarathR.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":"2023-12-22T07:40:52.000Z","updated_at":"2024-07-25T09:36:00.000Z","dependencies_parsed_at":"2025-01-08T06:27:14.225Z","dependency_job_id":"1d252494-7d82-46fd-b81c-ee1ddbf19b6e","html_url":"https://github.com/SaiBarathR/jwt-login-service","commit_stats":null,"previous_names":["saibarathr/jwt-login-node-service","saibarathr/jwt-login-service"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaiBarathR%2Fjwt-login-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaiBarathR%2Fjwt-login-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaiBarathR%2Fjwt-login-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaiBarathR%2Fjwt-login-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SaiBarathR","download_url":"https://codeload.github.com/SaiBarathR/jwt-login-service/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240698770,"owners_count":19843451,"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":["expressjs","googleoauth2","jwt-authentication","nodejs","postgresql","sequelize"],"created_at":"2024-11-10T19:28:38.836Z","updated_at":"2025-11-18T22:04:47.978Z","avatar_url":"https://github.com/SaiBarathR.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node.js JWT Authentication Server\n\nA Node.js server providing JWT authentication for a sign-in/sign-up client.\n\n## Table of Contents\n\n1. [Introduction](#introduction)\n2. [Prerequisites](#prerequisites)\n3. [Installation](#installation)  \n4. [Docker](#docker)      \n5. [Configuration](#configuration)\n6. [API Endpoints](#api-endpoints)\n7. [Usage](#usage)\n8. [Client Information](#client-information)\n9. [Client Repository](#client-repository)\n10. [Dependencies](#dependencies)\n11. [License](#license)\n\n## Introduction\n\nThis Node.js authentication server is designed to provide JWT authentication for a sign-in/sign-up client. It includes Google Sign-In integration, manual sign-up/sign-in, and user management features. The server is built using Node.js, Express, Sequelize, and PostgreSQL. It is designed to be used with a CORS-enabled client application. The client application can be found [here](https://github.com/SaiBarathR/login-page-with-jwt-auth-one-tap-sign-in).\n\n## Prerequisites\n\nEnsure you have the following software installed on your machine:\n\n- Node.js\n- npm (Node Package Manager)\n- PostgreSQL (as per the configuration, you can modify it for other databases)\n- Google API key and OAuth credentials (see [Google Sign-In](https://developers.google.com/identity/gsi/web/guides/overview) for more information)\n- A CORS-enabled client application (see [Client Information](#client-information))\n\n## Installation\n\nTo install and run the server locally, follow these steps:\n\n1. Clone the repository:\n\n    ```bash\n    git clone https://github.com/SaiBarathR/jwt-login-node-service.git\n    ```\n\n2. Navigate to the project directory:\n\n    ```bash\n    cd jwt-login-node-service\n    ```\n\n3. Install dependencies:\n\n    ```bash\n    npm install\n    ```\n\n4. Start the server:\n\n    ```bash\n    npm start\n    ```\n\n## Docker\n\nTo run the server using Docker, follow these steps:\n\n1. Follow the steps 1 \u0026 2 in [Installation](#installation) to clone the repository and navigate to the project directory.\n    \n2. Build the Docker image:\n\n    ```bash\n    docker build -t jwt-login-node-service .\n    ```\n3. Run the Docker container:\n\n    ```bash\n    docker run -p 8080:8080 jwt-login-node-service\n    ```    \n\n## Configuration\n\nCreate a `.env` file in the root directory of the project and add the following environment variables:\n\n```bash\nGOOGLE_CLIENT_ID= # Google client ID for OAuth.\nGOOGLE_CLIENT_SECRET= # Google client secret for OAuth.\nGOOGLE_API_KEY= # Google API key.\nAUTH_SECRET= # Secret key for JWT authentication.\nCORS_URLS= # Comma-separated list of allowed CORS URLs.\nMODE= # Development mode.\n```\nConfigure the PostgreSQL database settings in the environment variables as follows:\n\n```bash\nDB_HOST= # Database host.\nDB_USER= # Database user.\nDB_PASS= # Database password.\nDB_NAME= # Database name.\nDB_DIALECT= # Database dialect.\n```\n\n## API Endpoints\n\n### Authentication Endpoints\n\n- **POST /api/auth/signup**: Register a new user.\n- **POST /api/auth/signin**: Sign in with email and password.\n- **POST /api/auth/googleSignIn**: Sign in/register with Google.\n\n### User Management Endpoints\n\n- **GET /api/test/all**: Public content.\n- **GET /api/test/user**: User content (requires authentication).\n- **POST /api/userInfo**: Get user information (requires authentication).\n- **DELETE /api/deleteAccount/:type/:email**: Delete user account (requires authentication).\n\n## Usage\n\n1. **Sign Up**\n\n    ```bash\n    POST /api/auth/signup\n    ```\n\n    Parameters:\n    - `email`: User's email.\n    - `password`: User's password (optional).\n    - `name`: User's name.\n    - `age`: User's age.\n    - `gender`: User's gender.\n    - `photo`: User's photo URL (optional).\n\n2. **Sign In**\n\n    ```bash\n    POST /api/auth/signin\n    ```\n\n    Parameters:\n    - `email`: User's email.\n    - `password`: User's password.\n\n3. **Google Sign-In**\n\n    ```bash\n    POST /api/auth/googleSignIn\n    ```\n\n    Parameters:\n    - `code`: Authorization code from Google OAuth.\n\n4. **Get User Information**\n\n    ```bash\n    POST /api/userInfo\n    ```\n\n    Requires authentication.\n\n5. **Delete User Account**\n\n    ```bash\n    DELETE /api/deleteAccount/:type/:email\n    ```\n\n    Requires authentication.\n\n## Client Information\n\n- [Client Website](https://login-page-with-jwt-auth-one-tap-sign.netlify.app/login)\n- [Client Repository](https://github.com/SaiBarathR/login-page-with-jwt-auth-one-tap-sign-in)\n\n## Dependencies\n\n- `bcryptjs`: Password hashing.\n- `cors`: Cross-Origin Resource Sharing.\n- `dotenv`: Environment variable management.\n- `express`: Web application framework.\n- `google-auth-library`: Google OAuth library.\n- `jsonwebtoken`: JSON Web Token implementation.\n- `node-fetch`: HTTP requests.\n- `nodemon`: Development server auto-restart.\n- `pg`: PostgreSQL client for Node.js.\n- `sequelize`: SQL ORM for Node.js.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaibarathr%2Fjwt-login-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaibarathr%2Fjwt-login-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaibarathr%2Fjwt-login-service/lists"}