{"id":18780159,"url":"https://github.com/berasumitdev/Node-JWT-Authentication-Test-Project","last_synced_at":"2025-09-02T00:32:34.623Z","repository":{"id":260038089,"uuid":"862404521","full_name":"berasumitdev/Node-JWT-Authentication-Test-Project","owner":"berasumitdev","description":"A simple full-stack authentication system using Node.js, Express, PostgreSQL, JWT, and Vue.js. Includes login, signup, and dashboard with JWT-based session management.","archived":false,"fork":false,"pushed_at":"2024-10-03T06:44:51.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-18T13:43:41.108Z","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/berasumitdev.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-09-24T14:41:42.000Z","updated_at":"2024-12-30T09:17:19.000Z","dependencies_parsed_at":"2024-10-29T07:22:07.333Z","dependency_job_id":"c4034fe1-d135-476c-917f-4d008193d17d","html_url":"https://github.com/berasumitdev/Node-JWT-Authentication-Test-Project","commit_stats":null,"previous_names":["aiquant4/node-jwt-authentication-test-project","berasumit611/node-jwt-authentication-test-project","berasumitdev/node-jwt-authentication-test-project"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/berasumitdev/Node-JWT-Authentication-Test-Project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berasumitdev%2FNode-JWT-Authentication-Test-Project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berasumitdev%2FNode-JWT-Authentication-Test-Project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berasumitdev%2FNode-JWT-Authentication-Test-Project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berasumitdev%2FNode-JWT-Authentication-Test-Project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/berasumitdev","download_url":"https://codeload.github.com/berasumitdev/Node-JWT-Authentication-Test-Project/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berasumitdev%2FNode-JWT-Authentication-Test-Project/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273213760,"owners_count":25065058,"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","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"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":[],"created_at":"2024-11-07T20:25:07.466Z","updated_at":"2025-09-02T00:32:34.368Z","avatar_url":"https://github.com/berasumitdev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Node-JWT-Authentication-Test-Project\n\n## Overview\nThis project is a full-stack authentication system built with Node.js, Express, PostgreSQL, and Vue.js for the frontend. It uses JSON Web Tokens (JWT) for secure user authentication and session management.\n\n## Features\n- User registration and login\n- Password hashing with `bcrypt`\n- JWT-based authentication and authorization\n- Dashboard with user-specific data display\n- Route protection (users can only access certain pages if authenticated)\n- Logout functionality\n\n## Technologies Used\n- **Backend**: Node.js, Express, PostgreSQL\n- **Frontend**: Vue 3, Axios\n- **Authentication**: JWT (JSON Web Tokens), bcrypt for password hashing\n- **Database**: PostgreSQL\n\n## Prerequisites\nBefore running the project, ensure you have the following installed on your system:\n- [Node.js](https://nodejs.org/)\n- [PostgreSQL](https://www.postgresql.org/)\n- [Vue CLI](https://cli.vuejs.org/)\n\n## Setup\n\n### Backend Setup\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/your-username/Node-JWT-Authentication-Test-Project.git\n   cd Node-JWT-Authentication-Test-Project\n   ```\n\n2. Install backend dependencies:\n   ```bash\n   cd backend\n   npm install\n   ```\n\n3. Set up the PostgreSQL database:\n   - Create a new database in PostgreSQL and note the credentials (username, password, database name).\n   - Create a `.env` file in the `backend/` directory and configure the following environment variables:\n     ```bash\n     PORT=5000\n     DB_USER=your_db_username\n     DB_HOST=localhost\n     DB_NAME=your_db_name\n     DB_PASSWORD=your_db_password\n     DB_PORT=5432\n     JWT_SECRET=your_jwt_secret\n     ```\n\n4. Start the backend server:\n   ```bash\n   npm start\n   ```\n\n### Frontend Setup\n\n1. Navigate to the `frontend` directory:\n   ```bash\n   cd ../frontend\n   ```\n\n2. Install frontend dependencies:\n   ```bash\n   npm install\n   ```\n\n3. Configure the API endpoint:\n   - Open the `frontend/src/api.js` (or wherever you're managing API calls) and set the API base URL:\n     ```javascript\n     const API_URL = 'http://localhost:5000';  // Backend URL\n     ```\n\n4. Start the frontend development server:\n   ```bash\n   npm run serve\n   ```\n\n## Running the Project\n\n1. Make sure both backend and frontend servers are running.\n2. Open your browser and go to `http://localhost:8080` to see the application.\n\n\n\n## API Endpoints\n\n### Authentication\n- `POST /register`: Create a new user account\n- `POST /login`: Authenticate and log in the user, return JWT token\n- `GET /dashboard`: Protected route, accessible only with a valid JWT token\n\n### JWT Authentication Flow\n1. **Register**: Users can create an account by providing their email and password.\n2. **Login**: Users log in by providing their credentials, and the server responds with a JWT.\n3. **Protected Routes**: The token is sent in the `Authorization` header as a Bearer token when accessing protected routes.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberasumitdev%2FNode-JWT-Authentication-Test-Project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fberasumitdev%2FNode-JWT-Authentication-Test-Project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberasumitdev%2FNode-JWT-Authentication-Test-Project/lists"}