Counselllor / Counsellor-Web

Counselling/Recommendation System for new Undergrad Students
http://counsellor.social/
MIT License
76 stars 173 forks source link

Complete Backend Integration for Job Application page #1318

Closed Ayushmaanagarwal1211 closed 3 months ago

Ayushmaanagarwal1211 commented 3 months ago

Description

I have created the complete Backend For the Job Application page Here i am storing that data in the database and the live data will be visible to the jobs page

Fixes #1059

Replace issue_no with the issue number which is fixed in this PR

Screenshots

https://github.com/user-attachments/assets/c702106c-29ed-487c-90c2-833192a7b3b0

Checklist

netlify[bot] commented 3 months ago

Deploy Preview for counsellor-startup ready!

Name Link
Latest commit e830fa8c4bb036826b7ef8e662d1eae29265b370
Latest deploy log https://app.netlify.com/sites/counsellor-startup/deploys/66a9195365c326000862eb6f
Deploy Preview https://deploy-preview-1318--counsellor-startup.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

Lighthouse
1 paths audited
Performance: 70
Accessibility: 96
Best Practices: 100
SEO: 67
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

github-actions[bot] commented 3 months ago

Thank you for submitting your pull request! πŸ™Œ We'll review it as soon as possible. In the meantime, please ensure that your changes align with our CONTRIBUTING.md. If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊

deepsource-io[bot] commented 3 months ago

Here's the code health analysis summary for commits 905ce14..e830fa8. View details on DeepSource β†—.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource JavaScript LogoJavaScript❌ Failure
❗ 28 occurences introduced
🎯 9 occurences resolved
View Check β†—

πŸ’‘ If you’re a repository administrator, you can configure the quality gates from the settings.
thestarsahil commented 3 months ago

Do a sort fun. according to date posted

Ayushmaanagarwal1211 commented 3 months ago

@thestarsahil Ok

Ayushmaanagarwal1211 commented 3 months ago

@thestarsahil Done sir

https://github.com/user-attachments/assets/52b4e30b-b3bc-48d7-afae-11b0edf19ac5

thestarsahil commented 3 months ago

Screenshot from 2024-07-30 18-04-49

Data is showing in Console , how should it been implemented ? Attacker can easily fetch that data easily and read

Ayushmaanagarwal1211 commented 3 months ago

@thestarsahil Removed

thestarsahil commented 3 months ago

Security level check :

Database Security Rules:

{
  "rules": {
    "users": {
      "$uid": {
        ".read": "auth != null && auth.uid == $uid",
        ".write": "auth != null && auth.uid == $uid"
      }
    },
    "jobs": {
      ".read": "auth != null",
      ".write": "auth != null",
      "$job_id": {
        ".write": "auth != null && data.child('companyName').val() != 'Soft'"
      }
    }
  }
}

Sanitizing User Input:

import validator from 'validator';

const handleChange = (event) => {
  const { name, value } = event.target;
  const sanitizedValue = validator.escape(value); // Sanitize input
  setFormData((prevData) => ({
    ...prevData,
    [name]: sanitizedValue,
  }));
};

File Upload Validation:

const handleFileChange = (event) => {
  const file = event.target.files[0];
  const validFileTypes = ['application/pdf', 'application/msword'];
  const maxFileSize = 2 * 1024 * 1024; // 2 MB

  if (file && validFileTypes.includes(file.type) && file.size <= maxFileSize) {
    // Handle file upload
  } else {
    alert('Invalid file type or size. Please upload a PDF or Word document less than 2MB.');
  }
};
Ayushmaanagarwal1211 commented 3 months ago

@thestarsahil sir can you please explain little bit more i didn't understand correctly

thestarsahil commented 3 months ago

In you code , the quality of code is low and security of your code easily crackable So , this i wrote you can modify in your code and try to run again

Ayushmaanagarwal1211 commented 3 months ago

@thestarsahil Sir i have optimized the code and did some changes can you please check again