This is a full-stack web application that allows users to perform three core functionalities:
- Take Website Screenshots: Enter a URL and capture a screenshot of the website.
- Generate Random User Data: Dynamically generate random user profiles based on input count.
- Generate PDF with QR Code: Enter any data and generate a PDF file containing a QR code.
Additionally, the application implements user authentication and authorization, enabling user profiles.
- Frontend: HTML, CSS, JavaScript, React.js
- Backend: Node.js, Express.js, MongoDB
- Website screenshot generation.
- Random user data generation based on input count.
- QR code generation in PDF.
- User profile with JWT-based authentication.
- MongoDB as the database for storing user information.
-
Clone the repository:
git clone https://github.com/dev-debasis/DevInnov8 cd DevInnov8 -
Install Backend Dependencies:
cd backend npm install -
Install Frontend Dependencies:
cd ../frontend npm install
DevInnov8/
│
├── backend/
│ ├── routes/ # API routes for different functionalities
│ ├── controllers/ # Business logic for each API endpoint
│ ├── models/ # Mongoose models (User, etc.)
│ ├── middleware/ # Middleware (Auth, etc.)
│ ├── utils/ # Utilities (for puppeteer, random data generation, QR code, etc.)
│ ├── app.js # Entry point of the backend
│ └── package.json # Backend dependencies
│
├── frontend/
│ ├── public/ # Static assets
│ ├── src/ # React.js components and app structure
│ ├── App.js # Main React component
│ └── package.json # Frontend dependencies
│
└── README.md # Project documentation-
Navigate to the
backenddirectory:cd backend -
Start the backend server:
npm start
By default, the backend server runs on
http://localhost:5000.
- POST
/api/auth/register: Register a new user. - POST
/api/auth/login: Login and receive a JWT token. - GET
/api/users/profile: Get user profile information (requires JWT).
- POST
/api/screenshot: Capture a screenshot of a given URL.- Request Body:
{ "url": "https://debasis.site" } - Response: Returns a PNG image of the website screenshot.
- Request Body:
- POST
/api/userData: Generate random user data.- Request Body:
{ "count": 10 } - Response: Returns a csv file of 10 random user data.
- Request Body:
- POST
/api/qrcode-pdf: Generate a PDF with QR code.- Request Body:
{ "inputData": "Hey, this is Debasis an aspiring ʙᴀᴄᴋᴇɴᴅ ᴅᴇᴠᴇʟᴏᴘᴇʀ skilled in ɴᴏᴅᴇ.ᴊᴤ, ᴇᴥᴘʀᴇᴤᴤ.ᴊᴤ, ᴍᴏɴɢᴏᴅʙ, ᴊᴀᴠᴀ, ᴘʏᴛʜᴏɴ, ᴊᴀᴠᴀᴤᴄʀɪᴘᴛ, Ғᴜɴᴅᴀᴍᴇɴᴛᴀʟᴤ ᴏҒ ᴄ++, ᴄ, ᴅᴀᴛᴀ ᴤᴛʀᴜᴄᴛᴜʀᴇᴤ & ᴀʟɢᴏʀɪᴛʜᴍᴤ. ᴄᴀᴍᴘᴜᴤ ᴀᴍʙᴀᴤᴤᴀᴅᴏʀ @ᴘᴡ" } - Response: Returns a PDF containing the QR code.
- Request Body:
-
Navigate to the
frontenddirectory:cd frontend -
Start the React.js frontend:
npm start
By default, the frontend runs on
http://localhost:3000.
- User Registration and Login: Users can register and log in to access the app functionalities.
- Screenshot Feature: A form to enter the website URL and capture the screenshot.
- Random User Data Generator: Generate random user profiles by specifying the count.
- QR Code PDF Generator: Enter data and generate a PDF with a QR code.
This app uses JWT (JSON Web Tokens) for user authentication. On successful login, the server generates a token which is stored in the frontend (typically in localStorage). This token is used to authenticate protected routes and access user profile information.
- User Profile: The
/profileroute is protected and requires the user to be authenticated. The token is passed in theAuthorizationheader for validation.
-
Create a Production Build of Frontend:
-
Deploy Backend & Frontend:
-
Unit Tests:
- We use
Jestfor unit and integration testing. - Run tests with:
npm test
- We use
-
Postman Testing:
Postmancollection to test the API endpoints manually.
This project is licensed under the MIT License. See the LICENSE file for details.
We welcome contributions! Feel free to raise issues or create pull requests.
- Debasis Khamari - Backend Developer
- Aman Prasad - Frontend Developer
For any issues, feel free to contact us at: debasiskhamari7@gmail.com | amanprasad048@gmail.com
