AI Personal Learning
and practical guidance
Beanbag Marscode1

Server-free generation of permanent microsoft QR code

General Introduction

serverless-qrcode-hub is an open source tool designed to solve the problem of frequent failure of QR codes in WeChat group chats. It is based on Cloudflare Workers and D1 database , without the need for traditional servers to run . Users can generate permanently valid WeChat group QR code to facilitate the management of group chat , while supporting any long link to a short link . The project provides a management background where users can update the QR code or short link content at any time, and supports customized styles and password protection. Deployment is simple, free quota is enough for daily use, suitable for individuals, teams or developers. The code is publicly available on GitHub, and the community is free to optimize and expand.

Serverless generation of permanent microsoft QR code-1


Server-free generation of permanent microsoft QR code-1

 

Function List

  • Generate permanently valid QR code for WeChat group chat to solve the failure problem.
  • Convert long links to short links for easy sharing and distribution.
  • Supports custom QR code styles, including colors, borders and logos.
  • Provide management backend to update the content of QR code or short link at any time.
  • Supports password protection to restrict unauthorized access.
  • Based on Cloudflare Workers and D1 database, no servers required.
  • Open source code with support for user modifications and extensions.
  • Automatically cleans up expired data to keep your system efficient.

 

Using Help

Installation and Deployment

serverless-qrcode-hub runs using the Cloudflare Workers platform and does not require a traditional server. Here are the detailed deployment steps:

  1. Sign up for a Cloudflare account
    Visit the Cloudflare website to sign up for a free account. Existing accounts can be logged in directly.
  2. Creating a D1 database
    Log in to the Cloudflare dashboard and go to Workers and Pages > D1 > Create Database.

    • Name the database, e.g. qrcode-dbThe
    • Copy the database ID after creation and use it later.
  3. Fork GitHub repository
    interviews Project WarehouseThen click the "Fork" button in the upper right corner to copy the repository to your GitHub account.
  4. compiler wrangler.toml
    In your Fork repository, open the wrangler.toml file, click the Edit button. Find the [d1_databases] In part, it will database_id Replace with the D1 database ID copied in step 2. example:

    [[d1_databases]]
    binding = "DB"
    database_name = "qrcode-db"
    database_id = "<你的数据库ID>"
    

    Save and commit the changes.

  5. Creating a Cloudflare Worker
    Return to the Cloudflare dashboard and select Workers and Pages > Create Worker.

    • Name the worker, for example qrcode-hubThe
    • Click Configuration > Git Integration and select the GitHub repository you're working with.
    • Click "Save and Deploy".
  6. Binding of customized domain names (optional)
    After a successful deployment, Cloudflare provides the default *.workers.dev Domain Name. If faster access or branding is needed:

    • Go to "Workers" > "Triggers" > "Add Custom Domain".
    • Enter a subdomain hosted on Cloudflare (e.g. qr.example.com).
    • Follow the prompts to complete the DNS configuration.
  7. Setting an access password
    In the Cloudflare dashboard, go to Worker Settings and find the Environment Variables section. Add the variable PASSWORD, the value is a custom password (a combination of letters and numbers is recommended, such as two UUID strings, e.g. a1b2c3d4-e5f6g7h8). After saving, you need to enter this password to access the administration backend.
  8. Validating Deployment
    After deployment is complete, access to the assigned *.workers.dev domain or a custom domain. If you see the login page, the deployment was successful.

Upgrade Instructions

The old version of the project (based on Cloudflare KV, version ≤ v1.2.0) is no longer recommended due to free quota restrictions. The new version is based on D1 database and supports 5 million reads for more stable performance.

Using the main functions

Once deployment is complete, users can access the tool via their browser. Below is the detailed operation flow:

Generate permanent microsoft QR code

  1. Access to the management background
    Open the Workers domain (e.g. https://qrcode-hub.<你的账户>.workers.dev) or a customized domain name. Enter the set password to log in.
  2. Add WeChat link
    In the administration background, click "Add WeChat QR Code".

    • Enter the original link to the WeChat group chat (usually a temporary QR code link).
    • Optionally, you can upload a logo (PNG/JPG format recommended, less than 100x100 pixels).
    • Adjust the QR code color or border (default black foreground, white background).
    • Click "Generate".
  3. Get QR code and short link
    The system returns QR code images and short links (e.g. https://qr.example.com/abc123) Scan the QR code to join the group chat directly, and the short link can be shared to WeChat or other platforms.
  4. Update Group Chat Link
    If the original group chat link is not working, go to the management background, find the corresponding QR code record and update it to a new group chat link. After updating, the QR code and short link remain unchanged, so users don't need to re-share them.

URL shortening services

  1. Add long link
    In the admin panel, click "Add Common Shortlink".

    • Paste any long link (e.g. article, file download address).
    • Optionally customize the short link suffix (e.g. abc123).
    • Click "Generate".
  2. Get short link
    The system returns a short link to click to test if it jumps to the original page. Short links can be used in social media, email and other scenarios.
  3. Managing Short Links
    View all short links in the admin backend, support editing, deleting or viewing jump records.

Customize the QR code style

  1. Adjustment of appearance
    When adding a QR code, click "Advanced Options".

    • Upload Logo (to enhance branding)
    • Select the foreground and background colors (to ensure high contrast and ease of scanning).
    • Set the border width or rounded corner effect.
  2. Preview and Save
    Click "Preview" to see the effect, and confirm to generate the final QR code.

Password protection management

  • Each time you access the administration backend, you need to enter the password that you set up at the time of deployment.
  • To change your password, update it in the Cloudflare dashboard PASSWORD environment variable and redeploy the worker.

caveat

  • ration: Cloudflare Workers free accounts offer 100,000 requests per day and the D1 database supports 5 million reads, enough for personal use. High traffic scenarios can be upgraded to a paid plan.
  • backing up: The D1 database stores all QR code and short link data, and it is recommended to export backups regularly (operated through the Cloudflare dashboard).
  • Domain Speed: Default *.workers.dev Domain names are slow to access in some areas, it is recommended to bind a customized domain name.
  • surety: Passwords need to be complex enough to avoid leakage. The content of short links and QR codes should be legal and compliant.

sample operation (computing)

  • Creating short links: Input https://example.com/long-urlGenerate https://qr.example.com/xyz789, click on the test jump.
  • Create a QR code for WeChat: Enter the group chat link, upload the Logo, generate the QR code and then save the image to share it to WeChat group or circle of friends.
  • update a record: Find the QR code record in the management background, replace the invalid link and confirm that the user can continue to use the original QR code.

With these steps, users can quickly deploy serverless-qrcode-hub to generate permanent QR codes or short links. The management backend is intuitive and requires no programming experience to get started.

 

application scenario

  1. WeChat Group Management
    Group administrators need to share the QR code of the group chat for a long time. serverless-qrcode-hub generates a permanent QR code which avoids the trouble of frequent changes, and members can scan the code to join at any time.
  2. marketing campaign
    Merchants turn event registration links into short links and QR codes to print on flyers or post to social media. Customizable logos enhance branding, and the management backend supports updating links at any time.
  3. Content Sharing
    Bloggers or creators shorten links to articles and videos, generate QR codes, and embed them in business cards or posters for easy access by fans.
  4. Education and training
    Training organizations convert course links into QR codes and print them in textbooks or advertisements. Students can scan the code to enroll, and link updates do not affect the use of the QR code.
  5. Open source project promotion
    Developers turn GitHub repository links into short links, generate QR codes, and share them with communities or documents for easy access.

 

QA

  1. Will the generated QR code be invalidated?
    As long as Cloudflare Workers and the D1 database are working properly, the QR code is valid forever. Even if the original group chat link does not work, it can be updated via the admin backend and the QR code does not need to be replaced.
  2. Do I need programming experience to deploy?
    No need. Deployment is just a step-by-step operation, and the management backend interface is friendly and suitable for zero-basic users.
  3. Is a free account enough?
    Cloudflare free quota (100,000 requests/day, 5 million database reads) is enough for an individual or small team. High-traffic scenarios may consider a paid plan.
  4. How do you keep your data secure?
    The data is stored in the D1 database and the password protects the administration backend. It is recommended to back up the database regularly and set complex passwords.
  5. What links are supported?
    Supports any legal URL, including WeChat links, web pages, file downloads, etc. It is recommended to test the link validity before generating.
  6. How do I upgrade for older users?
    consultation MIGRATE.mdThe new version of the code was redeployed by migrating the KV data to the D1 database.
May not be reproduced without permission:Chief AI Sharing Circle " Server-free generation of permanent microsoft QR code
en_USEnglish