Skip to content

sridhar852002/Bizyl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Bizyl Tech Challenge - Solution Notes

What I changed

  • Backend (jobsRoute.js):

    • Fixed GET /jobs to return jobs sorted by postedDate (newest first).
    • Added input validation for POST /jobs:
      • title is required (non-empty string)
      • salary must be a number (string numeric values are coerced)
      • Defaults: type defaults to full-time, postedDate defaults to today (YYYY-MM-DD)
    • Refactored with helper functions: sortJobsByPostedDateDesc and validateJobPayload for clarity and DRYness.
  • Frontend (JobList.jsx):

    • Added job type filtering UI (all, full-time, part-time, remote).
    • Fixed loading spinner bug by ensuring setLoading(false) runs in the error path.
    • Derived filteredJobs from state to keep render logic simple.

Assumptions

  • postedDate strings are ISO-like (YYYY-MM-DD) and parseable by Date.
  • API base is /api and jobsRoute.js is mounted accordingly.
  • Minimal styling is acceptable for the challenge; focus is on logic and correctness.

How to run

  1. Ensure the Express app uses JSON body parsing (express.json()) and mounts this router under /api.
  2. Start the server and the frontend as per the host app’s instructions.

What I’d improve with more time

  • Add a lightweight validation library (e.g., zod) to centralize schemas and get better error messages.
  • Extend filters (search by title, min/max salary) and persist filter state to the URL.
  • Add unit tests for router helpers and component behavior (loading/error states and filtering).
  • Improve UX: skeleton loaders, retry button on error.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published