![Screenshot 2023-11-25 at 11 23 31](https://private-user-images.githubusercontent.com/31235308/285596813-1ff10313-1860-4166-a3a3-e7cae8310336.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTE0MDk4MDgsIm5iZiI6MTcxMTQwOTUwOCwicGF0aCI6Ii8zMTIzNTMwOC8yODU1OTY4MTMtMWZmMTAzMTMtMTg2MC00MTY2LWEzYTMtZTdjYWU4MzEwMzM2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDAzMjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwMzI1VDIzMzE0OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE5ZGViNDExNTU0MzY3Njg0MGIyNTcwNGJiMjM2ZTlhYmE5N2Y1NzlkOGEyZTE4Mzc4MDQ2OTVkMDAwN2IwY2QmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.7sN3oYKnyd56EKugKoC9LEW_lwxPfcnipvDAoQZL6xI)
This is a monorepo for a QR code-based authentication system, designed to allow users to log in to a web application by scanning a QR code using a mobile app. The structure of the repository includes three main directories: web/
, mobile/
, and server/
.
-
Mobile (React Native with Expo)
- React Native
- Expo
-
Web (Next.js)
- Next.js
- React
-
Server (Fastify with Prisma)
- Fastify
- Prisma
The project aims to create a seamless authentication experience where users can log in to the web application by scanning a QR code displayed on the web interface using the mobile app. The primary technologies used in each component are listed above.
web
: Contains the Next.js web application code.mobile
: Houses the React Native mobile app developed with Expo.server
: Holds the Fastify server code, integrating Prisma for database operations.
-
Web Application (Next.js)
- Generates a unique QR code for user authentication.
- Displays the QR code on the web interface.
-
Mobile App (React Native with Expo)
- Scans the QR code displayed on the web interface.
- Authenticates the user on the mobile app.
-
Server (Fastify with Prisma)
- Manages the authentication process.
- Interacts with the database (Prisma) for user-related operations.
-
Clone the Repository
git clone https://github.com/viniciusanchieta/qr-login-system.git cd qr-login-system
-
Install Dependencies
# Install dependencies for the web application cd web npm install # Install dependencies for the mobile app cd ../mobile npm install # Install dependencies for the server cd ../server npm install
-
Set Up the Database
# Add the database URL to the .env file cd server # Replace <DATABASE_URL> with the URL of your database echo DATABASE_URL="<DATABASE_URL>" >> .env
-
Run the Project
# Run the web application cd web npm run dev # Run the mobile app cd ../mobile npm start # Run the server cd ../server npm run dev
This project is licensed under the MIT License. See the LICENSE file for details.