{"_id":"@byk1tty/loginregister","name":"@byk1tty/loginregister","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.4":{"name":"@byk1tty/loginregister","version":"1.0.4","description":"Customizable login register module","main":"index.js","scripts":{"start":"node index.js"},"author":{"name":"ByKittY"},"license":"MIT","dependencies":{"dotenv":"^10.0.0","ejs":"^3.1.6","express":"^4.17.1","mongoose":"^6.0.12"},"_id":"@byk1tty/loginregister@1.0.4","_nodeVersion":"20.2.0","_npmVersion":"9.6.6","dist":{"integrity":"sha512-7Y0ITJ/9tAP/MSylsH0//tcUUKMZ34udTR6BUF0vJhwOPAiz1OZLVqwfbrjB4+u+RpRABBdIng7rQyNu56rzCA==","shasum":"0e9744e8e96cd27fa979424f63a4161d7b556b38","tarball":"https://registry.npmjs.org/@byk1tty/loginregister/-/loginregister-1.0.4.tgz","fileCount":7,"unpackedSize":11988,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDaBOq0DSwtfQfNyEuWxlB5SfZc7bx1XTXa9+LBZJ5ulwIhAJcSWj1WODk8wFbBr+Du/V6hlaQgNr8XhPKkCim27eZa"}]},"_npmUser":{"name":"byk1tty","email":"ncodesup@gmail.com"},"directories":{},"maintainers":[{"name":"byk1tty","email":"ncodesup@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/loginregister_1.0.4_1686520680514_0.6825542048605173"},"_hasShrinkwrap":false}},"time":{"created":"2023-06-11T21:58:00.460Z","1.0.4":"2023-06-11T21:58:00.797Z","modified":"2023-06-11T21:58:00.992Z"},"maintainers":[{"name":"byk1tty","email":"ncodesup@gmail.com"}],"description":"Customizable login register module","author":{"name":"ByKittY"},"license":"MIT","readme":"# loginregister\r\n\r\nloginregister is a Node.js based login and registration system module. With this module, you can quickly implement user login and registration functionalities in your application.\r\n\r\n## Installation\r\n\r\nTo use the loginregister module, you need to have Node.js and npm installed on your system. Then, you can add the loginregister module to your project by running the following command:\r\n\r\n```javascript\r\nnpm install loginregister\r\n```\r\n\r\n## Usage\r\n\r\nTo create a login and registration system using the loginregister module, you can follow these steps:\r\n\r\n1. Require the `loginregister` module in your Node.js application.\r\n2. Set up the necessary configuration options such as the login page name, register page name, database URL, and login redirect URL.\r\n3. Customize the CSS styles for the login and registration pages, if desired.\r\n4. Use the provided methods to handle user login and registration actions.\r\n5. Customize the UI templates as needed using the provided EJS templates.\r\n\r\nHere's an example code snippet:\r\n\r\n```javascript\r\nconst loginregister = require('loginregister');\r\n\r\n// Set up configuration options\r\nloginregister.loginRegister({\r\n  loginPageName: 'login',\r\n  registerPageName: 'register',\r\n  databaseURL: 'mongodb://localhost/myapp',\r\n  loginToPage: 'dashboard',\r\n  loginPageCss: 'path/to/login-page-styles.css',\r\n  registerPageCss: 'path/to/register-page-styles.css'\r\n});\r\n\r\n// Handle user login\r\napp.post('/login', (req, res) => {\r\n  // Retrieve login form data\r\n  const { username, password } = req.body;\r\n\r\n  // Use loginregister methods to handle the login process\r\n  loginregister.login(username, password)\r\n    .then(user => {\r\n      // Redirect the user to the specified page after successful login\r\n      res.redirect('/dashboard');\r\n    })\r\n    .catch(error => {\r\n      // Handle login error\r\n      res.render('login', { error });\r\n    });\r\n});\r\n\r\n// Handle user registration\r\napp.post('/register', (req, res) => {\r\n  // Retrieve registration form data\r\n  const { username, password, email } = req.body;\r\n\r\n  // Use loginregister methods to handle the registration process\r\n  loginregister.register(username, password, email)\r\n    .then(user => {\r\n      // Redirect the user to the specified page after successful registration\r\n      res.redirect('/dashboard');\r\n    })\r\n    .catch(error => {\r\n      // Handle registration error\r\n      res.render('register', { error });\r\n    });\r\n});\r\n```\r\nCustomizing CSS Styles\r\nThe login and registration pages can be customized by applying CSS styles to different elements. Here's a list of some common CSS selectors that you can use to target specific elements:\r\n\r\nForm Fields:\r\n\r\ninput[type=text]: Selects text input fields.\r\ninput[type=password]: Selects password input fields.\r\ninput[type=email]: Selects email input fields.\r\ninput[type=submit]: Selects submit buttons.\r\nselect: Selects dropdown/select fields.\r\ntextarea: Selects text area fields.\r\nLabels:\r\n\r\nlabel: Selects all labels associated with form fields.\r\nButtons:\r\n\r\n.login-button: Selects the login button.\r\n.register-button: Selects the register button.\r\nError Messages:\r\n\r\n.error-message: Selects error messages displayed on the login and registration pages.\r\nContainers/Sections:\r\n\r\n.login-container: Selects the container element for the login page.\r\n.register-container: Selects the container element for the registration page.\r\nPage Title:\r\n\r\n.login-title: Selects the title element on the login page.\r\n.register-title: Selects the title element on the registration page.\r\nThese are just a few examples of CSS selectors that you can use to target specific elements on the login and registration pages. You can apply various CSS properties such as color, font-size, background-color, padding, margin, etc., to customize the appearance of these elements.\r\n\r\nTo apply custom styles, create a CSS file and define the styles using the appropriate selectors mentioned above. Then, include the CSS file as mentioned in the previous section.\r\n\r\nHere's an example of how you can style the form labels:\r\n\r\n```css\r\nlabel {\r\n  color: #333;\r\n  font-weight: bold;\r\n}\r\n```\r\n\r\nIn this example, all labels associated with form fields will have a color of #333 and a bold font weight.\r\n\r\nFeel free to experiment and apply different styles to achieve the desired visual design for your login and registration pages.\r\n\r\nNote: It's recommended to use specific class names or IDs for elements to avoid conflicts with other styles in your application.\r\n\r\nFor more advanced styling techniques and tips, refer to the CSS documentation and resources available online.\r\n\r\nThat's it! You now have the flexibility to customize the CSS styles for different elements on the login and registration pages using the provided CSS selectors.\r\n\r\nHope this clarifies how to apply CSS styles to different elements!\r\n\r\nFor more information on available methods and customization options, please refer to the documentation provided with the mongodblogin module.\r\n\r\n## Contributing\r\nContributions to the mongodblogin module are welcome! If you find any issues or have suggestions for improvements, please create a GitHub issue or submit a pull request.\r\n\r\n## License\r\nThis project is licensed under the MIT License.","readmeFilename":"README.md"}