Skip to content

About

AI-powered barcode and QR code reader with real-time scanning - Next.js, TypeScript, Tailwind CSS

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

🔍 Smart Barcode Reader

Next.js TypeScript TailwindCSS License

A modern, AI-powered barcode and QR code reader application built with Next.js, TypeScript, and Tailwind CSS. Features real-time camera scanning, intelligent code interpretation, and a responsive mobile-first design.

✨ Features

📱 Core Functionality

  • Universal Scanning: Supports QR codes, barcodes, and 2D codes
  • Real-time Detection: Instant scanning with camera feed
  • AI Insights: Intelligent interpretation of scanned content
  • Cross-platform: Works on desktop and mobile browsers
  • PWA Ready: Installable as a Progressive Web App

🎨 User Experience

  • Mobile-first Design: Optimized for smartphones and tablets
  • Dark/Light Themes: Automatic theme switching
  • Responsive Layout: Adapts to any screen size
  • Accessibility: WCAG 2.1 AA compliant
  • Offline Support: Core functionality works without internet

🔧 Technical Features

  • TypeScript: Full type safety and IntelliSense
  • Modern UI: Clean, intuitive interface with Lucide icons
  • Performance: Optimized with Next.js 14 and React 18
  • Security: CSP headers and input validation
  • Export: Download scan history as JSON/CSV

🚀 Live Demo

image

🌐 View Live Application

Try scanning any QR code or barcode with your device camera

📸 Screenshots

Click to view screenshots

Mobile Interface

Mobile Scanner Real-time scanning interface

Desktop Layout

Desktop View Split-screen desktop layout

Results Panel

Results Panel Scan results with AI insights

🛠️ Tech Stack

Category Technologies
Frontend Next.js 14, React 18, TypeScript
Styling Tailwind CSS, Lucide React Icons
Scanning jsQR, react-webcam
State React Hooks, Context API
Build Webpack, SWC, ESLint
Deployment Vercel, Docker

📋 Prerequisites

Before running this project, ensure you have:

  • Node.js 18.17.0 or higher
  • npm 9.0.0 or higher
  • Modern browser with camera support
  • HTTPS (required for camera access)

⚡ Quick Start

1️⃣ Clone the Repository

git clone https://github.com/yourusername/smart-barcode-reader.git
cd smart-barcode-reader

2️⃣ Install Dependencies

npm install

3️⃣ Start Development Server

npm run dev

4️⃣ Open in Browser

Navigate to http://localhost:3000 and grant camera permissions when prompted.

🔧 Available Scripts

Command Description
npm run dev Start development server
npm run build Build for production
npm run start Start production server
npm run lint Run ESLint
npm run type-check Run TypeScript checker

📁 Project Structure

smart-barcode-reader/
├── app/                    # Next.js 14 App Router
│   ├── layout.tsx         # Root layout
│   ├── page.tsx           # Main scanner page
│   └── globals.css        # Global styles
├── components/            # React components
│   ├── scanner/           # Camera and scanning logic
│   ├── results/           # Results display and actions
│   ├── history/           # Scan history management
│   └── layout/            # App layout components
├── types/                 # TypeScript type definitions
├── public/               # Static assets
│   ├── manifest.json     # PWA manifest
│   └── icons/            # App icons
├── backend/              # Python FastAPI backend
└── docs/                 # Documentation

🌐 Deployment

Deploy to Vercel (Recommended)

Deploy with Vercel

  1. Fork this repository
  2. Connect to Vercel
  3. Deploy automatically

Deploy to Netlify

Deploy to Netlify

Manual Deployment

# Build for production
npm run build

# Start production server
npm run start

⚙️ Configuration

Environment Variables

Create a .env.local file:

# API Configuration
NEXT_PUBLIC_BACKEND_URL=http://localhost:8000
ANTHROPIC_API_KEY=your_anthropic_key
OPENAI_API_KEY=your_openai_key

# Optional: Analytics
NEXT_PUBLIC_GA_ID=your_google_analytics_id

Camera Permissions

The app requires camera access to function. Ensure you're running on:

  • HTTPS in production
  • localhost for development
  • Trusted domain for deployment

🔌 Backend Integration

The frontend is designed to work with a Python FastAPI backend for AI features:

Start Backend Server

cd backend/
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000

Docker Deployment

docker-compose up -d

📱 PWA Installation

Mobile Installation

  1. Open the app in your mobile browser
  2. Tap "Add to Home Screen"
  3. Confirm installation

Desktop Installation

  1. Look for the install prompt in the address bar
  2. Click "Install" to add to your applications

🧪 Testing

Manual Testing Checklist

  • Camera permission request works
  • QR code detection is accurate
  • Results display correctly
  • Copy to clipboard functions
  • History saves and displays
  • Export functionality works
  • Theme toggle works
  • Mobile responsiveness
  • PWA installation

Browser Compatibility

Browser Desktop Mobile
Chrome ✅ ✅
Firefox ✅ ✅
Safari ✅ ✅
Edge ✅ ✅

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

Code Standards

  • Use TypeScript for all new code
  • Follow ESLint configuration
  • Write responsive CSS with Tailwind
  • Add meaningful comments
  • Update documentation

🐛 Troubleshooting

Common Issues

Camera not working?

  • Ensure HTTPS is enabled
  • Check browser permissions
  • Try reloading the page

Build errors?

  • Clear node_modules and reinstall
  • Check Node.js version compatibility
  • Update dependencies

TypeScript errors?

  • Run npm run type-check
  • Check type definitions in types/

Getting Help

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Next.js Team - Amazing React framework
  • Vercel - Seamless deployment platform
  • jsQR Library - QR code detection
  • Tailwind CSS - Utility-first CSS framework
  • Lucide - Beautiful icon library

📊 Project Stats

GitHub stars GitHub forks GitHub issues GitHub PRs


Built with ❤️ by Your Name

🌐 Website • 💼 LinkedIn • 🐦 Twitter

About

AI-powered barcode and QR code reader with real-time scanning - Next.js, TypeScript, Tailwind CSS

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages