Skip to content

JobTrackr is a backend API built with Express.js for managing job applications. It enables users to track their job statuses, such as disqualified, interview, and pending. The API integrates MongoDB for secure data storage and uses JWT-based authentication to protect user information.

Notifications You must be signed in to change notification settings

Shivaay210/JobTracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup

npm install && npm start

Database Connection

  1. Import connect.js
  2. Invoke in start()
  3. Setup .env in the root
  4. Add MONGO_URI with correct value

Routers

  • auth.js
  • jobs.js

User Model

Email Validation Regex

/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/

Register User

  • Validate - name, email, password - with Mongoose
  • Hash Password (with bcryptjs)
  • Save User
  • Generate Token
  • Send Response with Token

Login User

  • Validate - email, password - in controller
  • If email or password is missing, throw BadRequestError
  • Find User
  • Compare Passwords
  • If no user or password does not match, throw UnauthenticatedError
  • If correct, generate Token
  • Send Response with Token

Mongoose Errors

  • Validation Errors -if user doesnt provide any values
  • Duplicate (Email)
  • Cast Error -id syntax doesnt match with what moongosse is looking for

Security

  • helmet
  • cors --(cross origin resource sharing) ensure api is accessible from all domains
  • xss-clean-sanitizes user input in req.body, req,query, req.params, protect us from cross site scripting attacks(attacker tries to inject malicious code)
  • express-rate-limit -limit amount of req user make

About

JobTrackr is a backend API built with Express.js for managing job applications. It enables users to track their job statuses, such as disqualified, interview, and pending. The API integrates MongoDB for secure data storage and uses JWT-based authentication to protect user information.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published