{"id":19583585,"url":"https://github.com/moiz-codebyte/register-login-system-using-google","last_synced_at":"2025-02-26T12:24:12.503Z","repository":{"id":204999657,"uuid":"689026465","full_name":"Moiz-CodeByte/Register-Login-system-using-google","owner":"Moiz-CodeByte","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-27T06:24:43.000Z","size":4450,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-09T05:37:30.449Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Moiz-CodeByte.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-09-08T16:10:27.000Z","updated_at":"2024-05-27T06:24:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"617f117c-b94f-4d05-b654-3442c7aae36c","html_url":"https://github.com/Moiz-CodeByte/Register-Login-system-using-google","commit_stats":null,"previous_names":["moiz-codebyte/register-login-system","moiz-codebyte/register-login-system-using-google"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moiz-CodeByte%2FRegister-Login-system-using-google","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moiz-CodeByte%2FRegister-Login-system-using-google/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moiz-CodeByte%2FRegister-Login-system-using-google/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moiz-CodeByte%2FRegister-Login-system-using-google/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Moiz-CodeByte","download_url":"https://codeload.github.com/Moiz-CodeByte/Register-Login-system-using-google/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240850525,"owners_count":19867889,"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":[],"created_at":"2024-11-11T07:43:14.681Z","updated_at":"2025-02-26T12:24:12.491Z","avatar_url":"https://github.com/Moiz-CodeByte.png","language":"EJS","readme":"\n# Secrets Web Application\n\n## Login and register using email and google account\n\nThis is a Node.js web application that allows users to register, log in, and anonymously share secrets. The app uses Passport.js for authentication, including Google OAuth2, and MongoDB for data storage.\n\n## Features\n\n- User authentication with Passport.js (local and Google OAuth2 strategies).\n- Secure session management.\n- Mongoose for MongoDB interactions.\n- EJS templating for dynamic content rendering.\n\n## Technologies Used\n\n- Node.js\n- Express.js\n- Passport.js\n- MongoDB with Mongoose\n- EJS for templating\n- Body-parser for parsing incoming request bodies\n- Dotenv for environment variable management\n\n## Setup\n\n### Prerequisites\n\n- Node.js and npm installed on your machine.\n- MongoDB installed and running locally or an accessible MongoDB Atlas cluster.\n\n### Installation\n\n1. **Clone the repository:**\n   ```bash\n    https://github.com/Moiz-CodeByte/Register-Login-system-using-google.git\n   cd Register-Login-system-using-google\n   ```\n\n2. **Install dependencies:**\n   ```bash\n   npm install\n   ```\n\n3. **Set up environment variables:**\n   Create a `.env` file in the root directory and add the following variables:\n   ```env\n   CLIENT_ID=your-google-client-id\n   CLIENT_SECRET=your-google-client-secret\n   ```\n\n4. **Run the application:**\n   ```bash\n   node app.js\n   ```\n\n5. **Access the application:**\n   Open your browser and navigate to `http://localhost:3000`.\n\n## Usage\n\n- **Home Page:** Access the home page at `/`.\n- **Register:** Register a new account at `/register`.\n- **Login:** Log in to your account at `/login`.\n- **Secrets:** View shared secrets at `/secrets` (requires authentication).\n- **Submit Secret:** Submit a new secret at `/submit` (requires authentication).\n- **Logout:** Log out of your account at `/logout`.\n\n## Project Structure\n\n```\nsecrets-app/\n│\n├── public/\n│   └── (static assets)\n├── views/\n│   ├── partials/\n│   │   ├── header.ejs\n│   │   └── footer.ejs\n│   ├── home.ejs\n│   ├── login.ejs\n│   ├── register.ejs\n│   ├── secrets.ejs\n│   └── submit.ejs\n├── .env\n├── app.js\n├── package.json\n└── README.md\n```\n\n## Code Overview\n\n### app.js\n\nThis is the main entry point of the application. It sets up the Express server, configures middleware, connects to MongoDB, and defines routes for authentication and rendering views.\n\n### Middleware\n\n- **express.static:** Serves static files from the `public` directory.\n- **body-parser:** Parses incoming request bodies.\n- **express-session:** Manages user sessions.\n- **passport:** Initializes Passport.js for authentication.\n\n### MongoDB Models\n\n- **User Model:** Defines the user schema with plugins for Passport.js and find-or-create functionality.\n\n### Routes\n\n- **GET /:** Renders the home page.\n- **GET /auth/google:** Initiates Google OAuth2 authentication.\n- **GET /auth/google/secrets:** Handles the Google OAuth2 callback.\n- **GET /login:** Renders the login page.\n- **POST /login:** Handles login form submission.\n- **GET /logout:** Logs out the user.\n- **GET /register:** Renders the registration page.\n- **POST /register:** Handles registration form submission.\n- **GET /secrets:** Renders the secrets page (requires authentication).\n- **GET /submit:** Renders the submit secret page (requires authentication).\n- **POST /submit:** Handles secret submission.\n\n## License\n\nThis project is licensed under the MIT License.\n## Author\nDeveloped by Abdul Moiz. For more information, visit [abdulmoiz](https://abdulmoiz.net).\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoiz-codebyte%2Fregister-login-system-using-google","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoiz-codebyte%2Fregister-login-system-using-google","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoiz-codebyte%2Fregister-login-system-using-google/lists"}