Skip to content

sumiqverse/qr_code-static-dynamic-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QR Code Generator (Static & Dynamic)

A full-stack application for generating both static and dynamic QR codes. The project consists of a Next.js frontend and a FastAPI (Python) backend connected to a MongoDB database.

🚀 Features

  • Static & Dynamic Options: Generate classic static QR codes locally, or create dynamic QR codes for trackable links.
  • Dynamic redirection: Update the underlying destination URL of the QR code without changing the QR image itself.
  • Click Tracking: Tracks the number of total clicks/scans for each dynamic QR code.
  • Modern UI: Responsive frontend built with Next.js and Tailwind CSS.
  • Fast Backend: Python FastAPI backend for speedy short ID resolution and MongoDB connection.

🏗️ Architecture

  • Frontend: Next.js, React, Tailwind CSS, qrcode.react (located in the frontend/ directory)
  • Backend: Python, FastAPI, PyMongo (located in the backend/ directory)
  • Database: MongoDB

🛠️ Prerequisites

Make sure you have the following installed:


💻 Running the Application Locally

1. Backend Setup

  1. Navigate to the backend directory:
    cd backend
  2. Set up a virtual environment (recommended):
    python -m venv .venv
    source .venv/bin/activate   # On MacOS/Linux
    # or
    # .venv\Scripts\activate    # On Windows
  3. Install dependencies:
    pip install -r requirements.txt
  4. Set up environment variables:
    • Create a .env file or export your connection string.
    • Example (you can copy from .env.example at the root):
      export MONGO_URI="mongodb+srv://<username>:<password>@cluster0..."
  5. Run the FastAPI development server:
    uvicorn main:app --reload
    The backend will be available at http://127.0.0.1:8000

2. Frontend Setup

  1. Open a new terminal and navigate to the frontend directory:
    cd frontend
  2. Install dependencies using your preferred package manager (using pnpm as it is set as default in workspace):
    pnpm install
  3. Start the Next.js development server:
    pnpm run dev
    The frontend will be available at http://localhost:3000

🔒 Environment Variables

Do not commit actual passwords, API keys, or database URIs to this repository! A template for environment variables can be found in .env.example.

For Next.js frontend, place .env.local inside the frontend/ directory. For FastAPI backend, place .env inside the backend/ directory or export MONGO_URI.


📝 License

This project is open-source and available under the MIT License.

About

A full-stack application for generating both static and dynamic QR codes. The project consists of a Next.js frontend and a FastAPI (Python) backend connected to a MongoDB database.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors