User App is a web application designed to handle user registration, login, profile management, and PDF form processing. This project is still a work in progress.
- User Registration and Login
- Profile Management
- PDF Form Upload and Field Extraction
- OCR Processing for Scanned PDFs
- Form Autofill using Profile Data
user_app/ ├── pycache/ ├── p/ ├── .env ├── app.py ├── app.py.backup ├── app.log ├── config.py ├── database.py ├── fieldextractor.log ├── fieldextractor.py ├── fill_form_handler.py ├── form_autofill.py ├── ocr_processor.py ├── requirements.txt ├── retrievedata.py ├── static/ │ └── css/ │ └── styles.css ├── templates/ │ ├── base.html │ ├── fill_form.html │ ├── login.html │ ├── profile.html │ ├── register.html │ ├── review_form.html │ ├── upload_form.html │ └── view_profile.html ├── Sample Files/ ├── TEST.PY └── uploads/
-
Clone the repository:
git clone https://github.com/yourusername/user_app.git cd user_app -
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Set up the environment variables in a .env file:
HUGGINGFACE_API_KEY="your_huggingface_api_key" SECRET_KEY="your_secret_key" WTF_CSRF_SECRET_KEY="your_csrf_secret_key" DEEPSEEK_API_KEY="your_deepseek_api_key"
-
Initialize the database:
python -c "from database import init_db; init_db()"
-
Run the application:
flask run
-
Open your web browser and go to
http://127.0.0.1:5000/.
The main application file that sets up the Flask app, routes, and handles user authentication and profile management.
Contains configuration settings for the Flask app, including secret keys and session settings.
Handles database connections and operations, including user and profile management.
Uses the DeepSeek API to extract fields from uploaded PDF forms.
Handles the form filling process, including field validation and autofill using profile data.
Contains logic for autofilling form fields based on user profile data.
Processes PDF files using OCR to extract text content.
A utility script to retrieve and print user data from the database.
- base.html: Base template for the application.
- fill_form.html: Template for displaying and filling out extracted form fields.
- login.html: Template for user login.
- profile.html: Template for editing user profile.
- register.html: Template for user registration.
- review_form.html: Template for reviewing form data before submission.
- upload_form.html: Template for uploading PDF forms.
- view_profile.html: Template for viewing user profile.
- styles.css: Contains the CSS styles for the application.
- app.log: Logs application events and errors.
- fieldextractor.log: Logs field extraction events and errors.
To run the tests, use the following command:
python TEST.PY
Contributing
Contributions are welcome! Please fork the repository and submit a pull request.