{"id":28282583,"url":"https://github.com/pawansankalpa/secrets-full-stack","last_synced_at":"2026-04-02T18:53:29.920Z","repository":{"id":293599264,"uuid":"984544115","full_name":"PawanSankalpa/Secrets-full-stack","owner":"PawanSankalpa","description":"web application built with Node.js, Express, PostgreSQL, and EJS, featuring both local login (with hashed passwords via bcrypt) and Google OAuth2 authentication using passport.js.","archived":false,"fork":false,"pushed_at":"2025-05-16T05:51:03.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-16T06:31:52.574Z","etag":null,"topics":["bcrypt","ejs","express","nodejs","oauth2","passport","postgresql"],"latest_commit_sha":null,"homepage":"","language":"CSS","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/PawanSankalpa.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-05-16T05:29:38.000Z","updated_at":"2025-05-16T05:51:06.000Z","dependencies_parsed_at":"2025-05-16T06:41:53.707Z","dependency_job_id":null,"html_url":"https://github.com/PawanSankalpa/Secrets-full-stack","commit_stats":null,"previous_names":["pawansankalpa/secrets-full-stack"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PawanSankalpa/Secrets-full-stack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PawanSankalpa%2FSecrets-full-stack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PawanSankalpa%2FSecrets-full-stack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PawanSankalpa%2FSecrets-full-stack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PawanSankalpa%2FSecrets-full-stack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PawanSankalpa","download_url":"https://codeload.github.com/PawanSankalpa/Secrets-full-stack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PawanSankalpa%2FSecrets-full-stack/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260306816,"owners_count":22989669,"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":["bcrypt","ejs","express","nodejs","oauth2","passport","postgresql"],"created_at":"2025-05-21T15:19:13.358Z","updated_at":"2025-12-30T23:01:33.226Z","avatar_url":"https://github.com/PawanSankalpa.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔐 Secret Sharing App with Authentication\n\nThis is a Node.js + Express-based web app that allows users to **register**, **log in**, and **share their secrets** securely. It supports authentication via:\n- Local strategy (username + password)\n- Google OAuth 2.0\n\nOnly authenticated users can view or submit secrets.\n\n---\n\n## 🚀 Features\n\n- 🧑‍💻 User registration and login (with hashed passwords using bcrypt)\n- 🔐 Google OAuth 2.0 login integration\n- 🗝 Session-based authentication using Passport.js\n- 🧾 Secrets stored securely in PostgreSQL\n- 🧼 Route protection: only logged-in users can view or submit secrets\n- 📦 Environment variables support via `.env`\n\n---\n\n## 🛠 Tech Stack\n\n- **Node.js** + **Express**\n- **PostgreSQL** (via `pg`)\n- **Passport.js** for authentication\n- **bcrypt** for password hashing\n- **EJS** for templating\n- **dotenv** for managing environment variables\n\n---\n\n\n## 🔧 Setup Instructions\n\n### 1. Clone the repo\n```bash\ngit clone https://github.com/your-username/secret-auth-app.git\ncd secret-auth-app\n```\n\n2. **Install dependencies**\n```bash\nnpm install\n```\n\n3. **Set up PostgreSQL**\n```sql\nCREATE TABLE users (\n  id SERIAL PRIMARY KEY,\n  email TEXT UNIQUE NOT NULL,\n  password TEXT,\n  secret TEXT\n);\n```\n\n4. **Create .env file**\n```env\nPG_USER=your_pg_username\nPG_PASSWORD=your_pg_password\nPG_HOST=localhost\nPG_PORT=5432\nPG_DATABASE=your_database_name\nSESSION_SECRET=your_random_session_secret\nGOOGLE_CLIENT_ID=your_google_client_id\nGOOGLE_CLIENT_SECRET=your_google_client_secret\n```\n\n5. **Run the app**\n```bash\nnode index.js\n```\nVisit http://localhost:3000 in your browser.\n\n## 🌐 Available Routes\n| Route                  | Method | Description                          |\n| ---------------------- | ------ | ------------------------------------ |\n| `/`                    | GET    | Homepage                             |\n| `/register`            | GET    | Registration form                    |\n| `/register`            | POST   | Register a new user                  |\n| `/login`               | GET    | Login form                           |\n| `/login`               | POST   | Log in existing user                 |\n| `/secrets`             | GET    | View secret (authenticated only)     |\n| `/submit`              | GET    | Submit a secret (authenticated only) |\n| `/submit`              | POST   | Save a secret to DB                  |\n| `/logout`              | GET    | Log out the user                     |\n| `/auth/google`         | GET    | Start Google OAuth2                  |\n| `/auth/google/secrets` | GET    | Callback after Google auth           |\n\n\n## 🛡 Security Notes\n- Passwords are hashed with bcrypt before storing.\n- Session cookies are used for authentication.\n- Routes like /submit and /secrets are protected server-side (not just in the UI).\n\n## 🙋‍♂️ Author\n*Developed by Pawan Sankalpa.*\n*Feel free to contribute or fork this project!*\n\n## Screenshots\n**Home Page**\n![Home Page](\u003cscreenshot(Home Page).png\u003e)\n\n**Login Page**\n![Login Page](\u003cscreenshot(Login Page).png\u003e)\n\n**Register Page**\n![Register Page](\u003cscreenshot(Register Page).png\u003e)\n\n**Secret Page**\n![Secret Page](\u003cscreenshot(Secrets Page).png\u003e)\n\n**Submit Page**\n![Submit Page](\u003cscreenshot(submit Page).png\u003e)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpawansankalpa%2Fsecrets-full-stack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpawansankalpa%2Fsecrets-full-stack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpawansankalpa%2Fsecrets-full-stack/lists"}