How ashqrahmn/qrcode_generator works
Project Type and Purpose
• This is a full-stack web application.
• Backend: Node.js/Express server (server.js) that handles authentication, QR generation history, and persists data in JSON files (users.json, qr_history.json).
Main Components
a. Client (Browser)
b. React Frontend
• Entry point: index.js → App.js
• Core UI components: Login, SignUp, Home, InputForm (with InputField, InputColor), QrCode, History
c. Backend API Server
• server.js (Express routes/controllers)
• JSON file storage: users.json, qr_history.json
d. Static Assets
• public/index.html, manifest.json, robots.txt
e. Build & Tooling
• CRA build scripts, Tailwind config
f. External Libraries/Services
• React, React Router (if used), Tailwind CSS, any QR code‐generation library
Relationships and Data Flows
• User interacts with React UI → triggers component actions/forms
• UI issues HTTP requests (fetch/axios) to Express endpoints (e.g., POST /login, POST /signup, POST /generate, GET /history)
• Express server routes receive requests → read/write to JSON storage → respond with JSON payload
• Frontend receives API response → updates UI state (displays QR code, updates history, handles auth tokens/cookies)
• On deployment, the built frontend static bundle can be served by the Express server (or separately on a CDN)
Architectural Patterns & Design Principles
• Client-Server (Separation of concerns between UI and data layer)
• RESTful API layer in the backend
• Component-based UI in the frontend (React)
• Simple file-based persistence (JSON as “database”)
• Potential MVC within server.js (Routes → Controllers → Models)