By the end of this guide you will have a fully running PermisosQR instance on your local machine: the PostgreSQL database seeded with two test users and 20 sample QR codes, the Express backend listening on port 4000, the React/TypeScript frontend on port 3000, and a verified login token you can use to explore the rest of the API.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/edgar2420/QrPermision/llms.txt
Use this file to discover all available pages before exploring further.
Create the database
Open a The schema creates indexed tables for
psql session and run the following commands to create the database, apply the schema (three tables: users, qr_codes, permissions), and load the seed data (two test accounts and 20 available QR codes):The SQL files live in the
base/ directory at the root of the repository. The npm run db:migrate and npm run db:seed scripts in backend/package.json reference ../database/schema.sql and ../database/seed.sql respectively — that path does not match the actual file locations. Use the manual \i commands above (with base/) when setting up the database from a fresh psql session.users, qr_codes, and permissions, along with update_updated_at_column triggers that automatically maintain the updated_at timestamps on every row change.Configure and start the backend
Copy the example environment file, fill in your PostgreSQL credentials, install dependencies, and start the development server:Your The
.env file should look like this after editing:npm run dev script uses Node’s built-in --watch flag, so the server restarts automatically whenever you edit a source file.Start the frontend
In a second terminal, install frontend dependencies and launch the Vite dev server:The frontend is a React 18 + TypeScript application built with Vite. It uses
html5-qrcode for camera-based scanning, qrcode for generating printable QR images, and Tailwind CSS for styling.Verify connectivity and log in
First, confirm the backend is up and the database connection is healthy:Then authenticate with the seeded super-admin account:A successful login returns a JWT and the user object:Copy the
token value. Pass it as Authorization: Bearer <token> on every subsequent request to protected endpoints.