{"id":25070649,"url":"https://github.com/flexycode/qr-code-verifier","last_synced_at":"2025-05-08T02:40:42.309Z","repository":{"id":217555284,"uuid":"744199355","full_name":"flexycode/qr-code-verifier","owner":"flexycode","description":"QR Code Verifier","archived":false,"fork":false,"pushed_at":"2024-01-21T17:03:24.000Z","size":1124,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-31T16:26:03.049Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/flexycode.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-01-16T20:16:29.000Z","updated_at":"2024-02-07T13:10:46.000Z","dependencies_parsed_at":"2025-02-06T21:33:08.213Z","dependency_job_id":"61737008-6e37-4206-9a4a-cf075a002d3d","html_url":"https://github.com/flexycode/qr-code-verifier","commit_stats":null,"previous_names":["flexycode/qr-code-verifier"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexycode%2Fqr-code-verifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexycode%2Fqr-code-verifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexycode%2Fqr-code-verifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexycode%2Fqr-code-verifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flexycode","download_url":"https://codeload.github.com/flexycode/qr-code-verifier/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252989488,"owners_count":21836660,"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":"2025-02-06T21:33:01.083Z","updated_at":"2025-05-08T02:40:42.289Z","avatar_url":"https://github.com/flexycode.png","language":"TypeScript","readme":"# qr-code-verifier \n\n## QR Code Verifier\n\n### 1. Set up a new Next.js project:  \n\n* Install Next.js globally: `npm install -g create-next-app` \n\n* Create a new Next.js project: `npx create-next-app qr-code-verifier`  \n\n* Move into the project directory: `cd qr-code-verifier`\n\n### 2. Install required dependencies:\n\n* Install Express.js and QR Code reader library: `npm install express qrcode-reader`\n\n### 3. Create a new folder for the backend:\n\n* Inside the project directory, create a new folder called backend: `mkdir backend`\n\n### 4. Create a backend server file: \n\n* Inside the `backend` folder, create a new file called `server.js`.\n\n### 5. Set up the backend server:\n* In `server.js`, require Express.js and the QR Code reader library:\n\n```bash \nconst express = require('express');\nconst QRCodeReader = require('qrcode-reader'); \nconst fs = require('fs');\nconst path = require('path');\nconst app = express();\nconst qrCodeReader = new QRCodeReader();\n```\n\n* Define a route for handling QR code verification:\n\n```bash\napp.get('/api/verify', (req, res) =\u003e { \n  const qrCodePath = path.join(__dirname, '..', 'public', 'qr-code.png');\n  const imageBuffer = fs.readFileSync(qrCodePath);\n  qrCodeReader.decode(imageBuffer, (error, result) =\u003e {\n    if (error) {\n      console.error(error);\n      res.status(500).json({ error: 'Error decoding QR code' }); \n    } else {\n      const qrCodeData = result.result;\n      // Perform verification logic here\n      // Example: Check if qrCodeData matches expected data\n      const expectedData = 'Your expected data';\n      if (qrCodeData === expectedData) {\n        res.json({ message: 'QR code verification successful' }); \n      } else {\n        res.status(400).json({ error: 'QR code verification failed' }); \n      }\n    }\n  });\n});\n```\n\n\n### 6. Update the Next.js pages:\n\n* Replace the content of `pages/index.js` with:\n\n```bash\nimport React, { useEffect, useState } from 'react';\n\nexport default function Home() {\n  const [verificationMessage, setVerificationMessage] = useState('');\n\n  useEffect(() =\u003e {\n    // Fetch data from the backend\n    fetch('/api/verify') \n      .then((response) =\u003e response.json()) \n      .then((data) =\u003e setVerificationMessage(data.message))\n      .catch((error) =\u003e console.error(error));\n  }, []);\n\n  return (\n    \u003cdiv\u003e\n      \u003ch1\u003eQR Code Verifier\u003c/h1\u003e\n      \u003cp\u003e{verificationMessage}\u003c/p\u003e \n    \u003c/div\u003e\n  );\n}\n```\n\n### 7. Create a QR code image (e.g., `public/qr-code.png`) with the expected data encoded.\n\n### 8. Start the backend server and the Next.js development server:\n* In the project directory, run: `npm run dev` \n\n### 9. Open your browser and visit: \n`http://localhost:3000` \n\n* The frontend will display the verification message retrieved from the backend based on the QR code verification.\n\n\n## Contributing\n\n### Submitting Changes\n\nContributions are welcome! If you have ideas for improvements, follow these steps:\n\n1. Fork the repository.\n2. Create a new branch.\n3. Make your changes and commit them.\n4. Push to your fork and submit a pull request.\n\n### Reporting Issues\n\nIf you encounter any issues or have suggestions, please open an issue to let us know.\n\n### Update\n\nKindly redirect here at https://github.com/flexycode/qr-code-verifier-rn\nfor the mobile version app\n\n### License\n\nThis project is licensed under the MIT License.\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflexycode%2Fqr-code-verifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflexycode%2Fqr-code-verifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflexycode%2Fqr-code-verifier/lists"}