{"id":28419247,"url":"https://github.com/trtheo/user-authentication-system","last_synced_at":"2026-04-12T15:04:37.155Z","repository":{"id":296739215,"uuid":"994293466","full_name":"Trtheo/User-Authentication-System","owner":"Trtheo","description":"A full-stack User Authentication System built with React, Node.js, Express, and PostgreSQL (hosted on Neon DB). Features include JWT login, registration, password reset, protected routes, and real-time toast notifications. Deployed with Vercel (frontend) and Render (backend).","archived":false,"fork":false,"pushed_at":"2025-06-01T20:54:44.000Z","size":8516,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-26T11:44:22.969Z","etag":null,"topics":["authentication","axios","database","database-management","javascript","jwt-authentication","neondb","nodejs","onrender","postgresql","react-hooks","reactjs","tailwindcss","toastify","vercel-deployment"],"latest_commit_sha":null,"homepage":"https://user-authentication-system-lac.vercel.app","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/Trtheo.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}},"created_at":"2025-06-01T16:27:13.000Z","updated_at":"2025-06-01T20:54:48.000Z","dependencies_parsed_at":"2025-06-02T03:49:53.929Z","dependency_job_id":"73c3a80a-3031-4c79-abd3-37f40232ce78","html_url":"https://github.com/Trtheo/User-Authentication-System","commit_stats":null,"previous_names":["trtheo/user-authentication-system"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Trtheo/User-Authentication-System","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trtheo%2FUser-Authentication-System","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trtheo%2FUser-Authentication-System/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trtheo%2FUser-Authentication-System/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trtheo%2FUser-Authentication-System/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Trtheo","download_url":"https://codeload.github.com/Trtheo/User-Authentication-System/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trtheo%2FUser-Authentication-System/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265497989,"owners_count":23777093,"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":["authentication","axios","database","database-management","javascript","jwt-authentication","neondb","nodejs","onrender","postgresql","react-hooks","reactjs","tailwindcss","toastify","vercel-deployment"],"created_at":"2025-06-04T17:00:43.734Z","updated_at":"2026-04-12T15:04:37.097Z","avatar_url":"https://github.com/Trtheo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  User Authentication System (React + Node.js + PostgreSQL)\r\n\r\nA complete full-stack **User Authentication System** with modern best practices:\r\n\r\n-  Secure User Registration \u0026 Login  \r\n-  JWT-based Authentication  \r\n-  Password Hashing with bcrypt  \r\n-  Password Reset via Token  \r\n-  React Frontend with Toast Notifications  \r\n-  PostgreSQL as Database (Remote/Local)\r\n\r\n---\r\n\r\n##  Technologies Used\r\n\r\n### 🔹 Backend\r\n- Node.js  \r\n- Express.js  \r\n- PostgreSQL (with `pg` and Neon DB compatibility)  \r\n- bcrypt  \r\n- JSON Web Token (JWT)  \r\n- dotenv\r\n\r\n### 🔹 Frontend\r\n- React.js  \r\n- React Router DOM  \r\n- Axios  \r\n- React Toastify  \r\n- TailwindCSS (optional)\r\n\r\n---\r\n\r\n##  Project Structure\r\n\r\n```bash\r\nPOSINOVE-PROJECT/\r\n├── backend/\r\n│   ├── controllers/\r\n│   │   └── authController.js\r\n│   ├── routes/\r\n│   │   ├── auth.js\r\n│   │   ├── password.js\r\n│   │   └── task.js\r\n│   ├── db.js\r\n│   ├── server.js\r\n│   └── .env\r\n├── frontend/\r\n│   ├── src/\r\n│   │   ├── pages/\r\n│   │   │   ├── LoginPage.js\r\n│   │   │   ├── RegisterPage.js\r\n│   │   │   ├── Dashboard.js\r\n│   │   │   ├── ForgotPasswordPage.js\r\n│   │   │   └── ResetPasswordPage.js\r\n│   │   ├── api.js\r\n│   │   └── App.js\r\n└── README.md\r\n\r\n```\r\n\r\n###  Setup Instructions\r\n1. Clone the Repository\r\n\r\n```bash\r\n\r\ngit clone https://github.com/Trtheo/User-Auth-System-React-Nodejs.git\r\ncd User-Auth-System-React-Nodejs\r\n\r\n```\r\n\r\n2. Backend Setup (backend/)\r\na. Install Dependencies\r\n\r\n```bash\r\n\r\ncd backend\r\nnpm install\r\n\r\n```\r\n\r\nb. Configure .env\r\nCreate a `.env` file in the backend/ directory:\r\n```bash\r\nPORT=5000\r\nJWT_SECRET=your_jwt_secret_here\r\nNODE_ENV=production\r\nDATABASE_URL=postgresql://\u003cusername\u003e:\u003cpassword\u003e@\u003chost\u003e/\u003cdbname\u003e?sslmode=require\r\n```\r\n\r\n*Use your NeonDB or local PostgreSQL connection string for DATABASE_URL.*\r\n\r\nc. Start the Server\r\n\r\n```bash\r\nnode server.js\r\n\r\n```\r\n- Server will run at: `http://localhost:5000`\r\n\r\n3. Frontend Setup (frontend/)\r\na. Install Dependencies\r\n\r\n```bash\r\ncd ../frontend\r\nnpm install\r\n```\r\n\r\nb. Configure `API URL`  in `.env`\r\nCreate a `.env` file in frontend/:\r\n\r\n```bash\r\nREACT_APP_BACKEND_URL=http://localhost:5000/api\r\n```\r\n\r\nc. Start the React App\r\n\r\n```bash\r\nnpm start\r\n```\r\n- App runs at: `http://localhost:3000` in browser\r\n\r\n\r\n\r\n\r\n###  Authentication Features\r\nUser Registration \u0026 Login\r\n\r\nJWT-Based Session Storage\r\n\r\nSecure Password Hashing\r\n\r\nForgot Password (token sent to console)\r\n\r\nPassword Reset via token URL\r\n\r\nProtected Dashboard\r\n\r\nAuto-login after registration or reset\r\n\r\n\r\n###  API Endpoints\r\n🔹 Auth Routes `/api/auth`\r\nPOST `/register` → Create new user\r\n\r\nPOST `/login` → Authenticate and return JWT\r\n\r\nGET `/users` → Get all users\r\n\r\n🔹 Password Routes /api/password\r\nPOST `/forgot-password` → Send token\r\n\r\nPOST `/reset-password` → Reset password with token\r\n\r\n\r\n###  Test Workflow\r\n1. Register\r\nGo to /register → Register user\r\n\r\nAuto-login on success\r\n\r\n2. Login\r\nGo to /login → Enter credentials\r\n\r\nJWT token is saved in local storage\r\n\r\n3. Forgot/Reset Password\r\n/forgot-password → Submit email\r\n\r\nToken appears in terminal console\r\n\r\nGo to /reset-password?token=your_token_here\r\n\r\nEnter new password and login\r\n\r\n###  PostgreSQL Schema\r\n\r\n```bash\r\n\r\nCREATE TABLE users (\r\n  id SERIAL PRIMARY KEY,\r\n  name TEXT NOT NULL,\r\n  email TEXT UNIQUE NOT NULL,\r\n  password TEXT NOT NULL,\r\n  resetpasswordtoken TEXT,\r\n  resetpasswordexpires TEXT\r\n);\r\n\r\nCREATE TABLE tasks (\r\n  id SERIAL PRIMARY KEY,\r\n  title TEXT NOT NULL,\r\n  user_id INTEGER NOT NULL,\r\n  FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE\r\n);\r\n\r\n\r\n```\r\n\r\n**DATABASE HOST LINK**  https://user-authentication-system-1-p9ro.onrender.com\r\n\r\n**GETTING ALL USERS** https://user-authentication-system-1-p9ro.onrender.com/api/auth/users\r\n\r\n### 👨‍💻 Author\r\n**Theophile Niyigaba**\r\n\r\n🔗 *Portfolio*  https://visittheo.vercel.app/ \r\n\r\n💼 *GitHub*   https://github.com/Trtheo/ \r\n\r\n`Note:` This project is production-ready and was built as a secure, real-world user authentication system.\r\n\r\n✅ Deployment Ready!\r\n\r\nSupports `PostgreSQL` on `Neon DB`, and frontend/backend deployment on `Vercel`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrtheo%2Fuser-authentication-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrtheo%2Fuser-authentication-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrtheo%2Fuser-authentication-system/lists"}