Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/y-broad/workschedule/llms.txt

Use this file to discover all available pages before exploring further.

The Work Schedule Organizer loads its initial employee roster from a static JSON file served alongside the app. Understanding this format lets you seed the app with your own team data, validate records before import, and build tooling around the data model.

How employee data is loaded

On startup, App.jsx issues a fetch('/employees.json') request to load the roster from public/employees.json. The response is parsed as JSON, sorted alphabetically by name, and stored in React state. Employees added through the UI during a session exist only in memory — they are not written back to the file.
useEffect(() => {
  (async () => {
    try {
      const response = await fetch("/employees.json");
      const data = await response.json();
      const sortedEmployees = sortEmployees(data);
      setEmployees(sortedEmployees);
    } catch (error) {
      console.error(error);
    }
  })();
}, []);
public/employees.json must be a valid JSON array at the top level. A single object or any non-array value will cause the fetch to fail silently and the employee list will be empty.
Changes to public/employees.json are not hot-reloaded by Vite. After editing the file you must refresh the page in your browser. When running npm run preview or a production build, restart the server to serve the updated file.

JSON schema

Each item in the array represents one employee and must conform to the following shape.
id
number
Unique numeric identifier for the employee. Used internally to distinguish records. Assign sequential integers starting from 1 and never reuse an id.
name
string
required
Employee’s full name. This value is displayed as the card heading and is used for alphabetical sorting via localeCompare.
phone
string
required
Employee’s phone number. Any format is accepted (e.g. "123-456-7890", "(123) 456 7890"). The value is displayed as-is on the employee card.
email
string
required
Employee’s email address. Displayed on the employee card. No validation is applied at the data-loading stage.
workdays
object
required
An object with exactly five boolean properties — one for each weekday. A value of true means the employee works that day; false means they do not. All five keys must be present.

Single record example

The following is Bob’s record taken directly from the default employees.json. Bob works Monday, Wednesday, and Friday.
{
  "id": 1,
  "name": "Bob",
  "phone": "123-456-7890",
  "email": "bob@example.com",
  "workdays": {
    "monday": true,
    "tuesday": false,
    "wednesday": true,
    "thursday": false,
    "friday": true
  }
}

Complete employees.json structure

The file must be a JSON array. Each element is an employee object. The default file ships with twelve employees.
[
  {
    "id": 1,
    "name": "Bob",
    "phone": "123-456-7890",
    "email": "bob@example.com",
    "workdays": { "monday": true, "tuesday": false, "wednesday": true, "thursday": false, "friday": true }
  },
  {
    "id": 2,
    "name": "Susan",
    "phone": "098-765-4321",
    "email": "susan@example.com",
    "workdays": { "monday": false, "tuesday": true, "wednesday": false, "thursday": true, "friday": false }
  },
  {
    "id": 3,
    "name": "John",
    "phone": "555-666-5555",
    "email": "john@example.com",
    "workdays": { "monday": false, "tuesday": false, "wednesday": true, "thursday": false, "friday": true }
  }
]

Editing the JSON file

Follow these tips to avoid common mistakes when adding or removing employees. Adding an employee
  1. Open public/employees.json in any text editor.
  2. Copy an existing object and paste it as a new element inside the top-level array.
  3. Update each field with the new employee’s information.
  4. Assign an id value that is not already used by any other record in the file.
  5. Set each workdays property to true or false to match the employee’s schedule.
  6. Confirm the file is still valid JSON — use a linter or paste it into a JSON validator.
  7. Refresh the browser (or restart the dev server) to see the change.
Removing an employee Delete the entire object for that employee, including the surrounding {}. Make sure the remaining array elements are separated by commas with no trailing comma after the last element. Sorting You do not need to sort the array manually. App.jsx sorts all records alphabetically by name each time the data is loaded.

Build docs developers (and LLMs) love