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.