Skip to content

HetPatel-0209/Cloudinary-file-upload-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PDF Upload to Cloudinary with Resume Analysis

A complete web application for uploading PDF files to Cloudinary with resume parsing and ATS score analysis.

Features

  • πŸ“„ PDF file upload with drag & drop support
  • 🎨 Modern and responsive UI design
  • πŸ“Š Real-time upload progress
  • πŸ”’ File type and size validation (max 10MB)
  • ☁️ Secure upload to Cloudinary
  • πŸ“± Mobile-friendly interface
  • ✨ Beautiful animations and transitions
  • πŸ“ˆ Resume parsing and data extraction
  • 🧠 ATS score analysis
  • πŸ’‘ Resume improvement suggestions

Setup Instructions

1. Clone or Navigate to Project Directory

cd cloud_upload_module

2. Install Dependencies

npm install

3. Configure Cloudinary

  1. Sign up for a free account at Cloudinary
  2. Copy .env.example to .env:
    copy .env.example .env
  3. Edit .env file with your Cloudinary credentials:
    CLOUDINARY_CLOUD_NAME=your_actual_cloud_name
    CLOUDINARY_API_KEY=your_actual_api_key
    CLOUDINARY_API_SECRET=your_actual_api_secret
    

4. Start the Server

npm start

Or for development with auto-restart:

npm test

5. Access the Application

Open your browser and navigate to: http://localhost:3000

Project Structure

cloud_upload_module/
β”œβ”€β”€ public/
β”‚   └── index.html          # Frontend interface
β”œβ”€β”€ server.js               # Backend Express server
β”œβ”€β”€ package.json            # Dependencies and scripts
β”œβ”€β”€ .env.example           # Environment variables template
└── README.md              # This file

API Endpoints

POST /upload-pdf

Upload a PDF file to Cloudinary and extract resume data.

Request:

  • Method: POST
  • Content-Type: multipart/form-data
  • Body: PDF file with field name 'pdf'

Response:

{
  "success": true,
  "message": "PDF uploaded successfully",
  "data": {
    "public_id": "pdf_uploads/sample_pdf",
    "secure_url": "https://res.cloudinary.com/...",
    "direct_pdf_url": "https://res.cloudinary.com/...",
    "cloudinary_url": "https://res.cloudinary.com/...",
    "download_url": "https://res.cloudinary.com/...",
    "local_view_url": "http://localhost:3000/view-pdf?id=...",
    "ats_score_url": "http://localhost:3000/ats-score?id=...",
    "resume_analyzed": true,
    "analysis_id": 1,
    "original_filename": "document.pdf",
    "file_size": 1024000,
    "upload_time": "2025-06-14T10:30:00.000Z",
    "compression": {
      "original_size": 1048576,
      "compressed_size": 1024000,
      "ratio": "2.34"
    }
  }
}

GET /ats-score

View the ATS score analysis page for a resume.

Query Parameters:

  • id: The public ID of the uploaded PDF

GET /api/ats-score/:id

Get the ATS score data for a resume.

Path Parameters:

  • id: The public ID of the uploaded PDF

Response:

{
  "success": true,
  "data": {
    "publicId": "pdf_uploads/sample_pdf",
    "filename": "resume.pdf",
    "timestamp": "2025-06-14T10:30:00.000Z",
    "score": 85,
    "breakdown": {
      "skills": {
        "count": 8,
        "items": ["javascript", "react", "node.js", ...],
        "score": 35,
        "maxScore": 40
      },
      "education": {
        "count": 2,
        "items": [
          { "degree": "bachelor of computer science", "year": "2022" },
          { "degree": "master of computer science", "year": "2024" }
        ],
        "score": 20,
        "maxScore": 30
      },
      "experience": {
        "count": 3,
        "items": [
          { "title": "software developer at abc corp", "duration": "2 years" },
          { "title": "intern at xyz inc", "duration": "6 months" },
          { "title": "freelance web developer", "duration": "1 year" }
        ],
        "score": 30,
        "maxScore": 30
      }
    },
    "suggestions": [
      "Consider adding more relevant skills to your resume.",
      "Your education section looks good!"
    ]
  }
}

Frontend Features

  • Drag & Drop: Simply drag PDF files onto the upload area
  • File Validation: Automatically validates file type and size
  • Progress Tracking: Visual progress bar during upload
  • Responsive Design: Works on desktop, tablet, and mobile
  • Error Handling: Clear error messages for various scenarios
  • Success Details: Shows complete file information after upload

Backend Features

  • File Upload Handling: Uses Multer middleware for file processing
  • Cloudinary Integration: Secure upload to cloud storage
  • Error Handling: Comprehensive error handling and validation
  • CORS Support: Allows cross-origin requests
  • Environment Variables: Secure credential management

Validation Rules

  • File Type: Only PDF files are accepted
  • File Size: Maximum 10MB per file
  • File Format: Must be a valid PDF document

Error Handling

The application handles various error scenarios:

  • Invalid file types
  • Files exceeding size limits
  • Network connectivity issues
  • Cloudinary upload failures
  • Missing environment variables

Security Features

  • File type validation on both frontend and backend
  • File size limits to prevent abuse
  • Environment variables for sensitive credentials
  • CORS configuration for secure cross-origin requests

Browser Support

  • Chrome (recommended)
  • Firefox
  • Safari
  • Edge
  • Mobile browsers

Troubleshooting

  1. Upload fails: Check your Cloudinary credentials in .env file
  2. File not accepted: Ensure the file is a valid PDF under 10MB
  3. Server won't start: Make sure port 3000 is available
  4. Environment variables: Ensure .env file exists and has correct values

Development

For development, use:

npm test

This uses nodemon for automatic server restart on file changes.

License

ISC License - See package.json for details.

Author

Het-Patel

Support

For issues or questions, please check the console for error messages and ensure all setup steps are completed correctly.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors