An AI-powered web application that enables users to upload PDF files, ask questions based on the document, and receive answers. Utilizing our proprietary AI-predictive model, the application scans the PDF document and provides answers based on user prompts. Additionally, IntelliScan offers an admin dashboard for administrators to manage users and monitor API usage.
Important
Due to ongoing maintenance, the API endpoint that processes requests sent to the AI model microservice is currently down to prevent misuse. Users can still upload files and submit prompts, but responses will not be returned until the service is restored.
Check out the live project here.
Login Page | Forgot Password Page |
Home Page | Prompt and AI-Model Response |
Admin Dashboard Page | User API Usage Page |
- Towa Quimbayo GitHub LinkedIn
- Noufil Saqib GitHub LinkedIn
- Maximillian Yong GitHub LinkedIn
- Juan Escalada GitHub LinkedIn
- React.js
v18.2.0
- CSS3
- React Helmet
v6.1.0
- React Redux
v8.1.1
- React Verification-Input
v4.1.1
- Redux
v4.2.1
- Redux-Thunk
v2.4.2
- Node.js
- Express
v4.18.2
- JWT Authentication
v9.0.0
- MongoDB / Mongoose
v6.3.3
- Multer
v1.4.5
- Nodemailer
v6.9.13
- Nodemon
v3.1.0
- TypeScript
v4.9.4
- Zod
v3.20.2
- Python
- FastAPI
- Google Gemma
Gemma2B-IT
- Pydantic
- PyPDF2
- Torch
- Transformers
- Uvicorn
Installation
- Install the latest npm package version.
npm install npm@latest -g
- Clone the repository to your local machine.
git clone https://github.com/towaquimbayo/IntelliScan.git
- Installing required dependencies requires Node and npm.
Change the directory to Frontend and install dependencies:
cd frontend
npm install
Change the directory to Backend and install dependencies:
cd backend
npm install
- (optional: self-deploying AI model) Clone the HuggingFace Google Gemma model to local machine.
To run test.py
, download the required models.
Note: Ensure you have git-lfs
installed.
Note: Ensure you have at least 30 GB of free space to download. After downloading, you can delete the .git
folder to save storage space.
git clone https://huggingface.co/google/gemma-2b-it
Environment Variables Setup
For the project to run correctly, environment variables are required only for the backend directory. Rename the .env.example
to .env
.
JWT_SECRET
is the encryption key to sign your JWTs (JSON Web Tokens). Create a secret at https://www.allkeysgenerator.com.JWT_LIFETIME
is the amount of time a particular JWT will be valid for (i.e.30d
for 30 days).- Sign up for a MongoDB Atlas account at https://www.mongodb.com/cloud/atlas/register. Then create a database Cluster and connect your project to that Cluster by clicking on the
Connect
, selecting theConnect To Your Application
option and copying the DatabaseURI
string as yourDATABASE_URL
. Finally, replace theusername
andpassword
fields in the URI string with your database credentials. - Either enter your email account credentials for the Nodemailer transporter credentials or create a Gmail account to generate an App Password by following the instructions at https://medium.com/@y.mehnati_49486/how-to-send-an-email-from-your-gmail-account-with-nodemailer-837bf09a7628.
Run The App
In order to run the application, you would need the client (frontend) and server (backend) running concurrently in different terminal sessions.
Change the directory to the client (frontend
) and execute npm start
to run locally in development mode or production mode. For production, make sure to build the app to the build
folder by executing npm run build
as this would correctly bundle React in production mode and optimize the build for the best performance.
cd frontend
npm start
Change the directory to the server (backend
) and execute npm run dev
to run locally in development mode or execute npm start
to run in production mode. For production, make sure to build the app to the dist
folder by executing npm run build
as this would correctly compile TypeScript code to ES5 JavaScript codes and optimize the build for the best performance.
cd backend
npm run dev // running locally in development mode
npm run start // running in production mode
To create a pre-quantized model run:
create accelerated.py
To run the app, change the directory to the app directory and run:
uvicorn main:app --reload
// or
gunicorn main:app -w 2 -k uvicorn.workers.UvicornWorker
Secure and efficient user management functionalities to ensure smooth user operations.
- JWT Authentication: Our authentication system ensures secure access to the application using JSON Web Tokens (JWT) stored in HttpOnly cookies. This approach protects user integrity and ensures secure session management.
- Login/Signup: Users can sign up and log in with a straightforward system that requires standard information: name, email, and password. This setup, combined with JWT authentication, provides robust security and seamless session handling.
- Forgot Password: Users who forget their password can easily reset it through a secure process. An OTP (One-Time Password) token is sent to the user's registered email for verification, ensuring the validity of the request and enabling secure password reset functionality.
Simple and intuitive file upload system for user convenience.
- Document File Upload: Users can upload PDF files either by drag-and-drop or by selecting from their local machine. The application validates the file size and type before processing. This user-friendly upload mechanism ensures that files are correctly sent to the backend for further processing by our AI model.
Advanced AI capabilities to process documents and interact with users based on the document content.
- AI-Predictive Model: Our AI-Predictive model enables users to upload PDF documents and ask questions about the content. The AI model processes the extracted text from the PDF and provides relevant answers, facilitating an interactive experience with the document.
- PDF to Plain Text Converter: A dedicated microservice extracts and converts PDF document text to plain text. This text is then formatted and passed to our AI model, which processes user prompts and generates accurate responses.
Comprehensive dashboard for administrators to manage users and monitor system usage.
- User Management: Administrators have access to a detailed list of users registered on the application. They can view user information, edit details, and delete users if necessary, ensuring effective user management.
- API Usage Tracking: The admin dashboard includes a feature to monitor API usage, allowing administrators to track the number of requests per API endpoint. This helps in rate-limiting users who exceed a certain threshold, preventing backend and microservice overload.