Skip to content

The application takes place in the terminal. It uses inquirer.js to prompt users for questions. It implements MySQL to store tables for employees, roles, and departments and the CLI allows users to interact with the database by allowing them to do things like add new employees, create new departments, and more. Some of the tables have a one-to-m…

Notifications You must be signed in to change notification settings

edwardreyes29/EmployeeTracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Employee Tracker using Node.js MySQL and Inquirer

Author

Edward Reyes

Tables of Contents

Description

This app is an Content Management Systems built with Node.js.

Design the following database schema containing three tables:

  • department:

    • id - INT PRIMARY KEY
    • name - VARCHAR(30) to hold department name
  • role:

    • id - INT PRIMARY KEY
    • title - VARCHAR(30) to hold role title
    • salary - DECIMAL to hold role salary
    • department_id - INT to hold reference to department role belongs to
  • employee:

    • id - INT PRIMARY KEY
    • first_name - VARCHAR(30) to hold employee first name
    • last_name - VARCHAR(30) to hold employee last name
    • role_id - INT to hold reference to role employee has
    • manager_id - INT to hold reference to another employee that manager of the current employee. This field may be null if the employee has no manager

The app allows the user to:

  • Add departments, roles, employees

  • View departments, roles, employees

  • Update employee roles

  • Update employee managers

  • View employees by manager

  • Delete departments, roles, and employees

  • View the total utilized budget of a department -- ie the combined salaries of all employees in that department

Installation

To install the necessary dependencies, run the following command:

npm i

Usage

To start the program:

node index.js

Challenges

My biggest challenge was managing all the asynchronous functions. There were times where I wasn't using async functions properly, like using the keyword 'await' on a function that doesn't return a promise. I had to review how promises worked and how to utilize them in order to get the desired data for some the inquirer prompts. But once I understood how to use async functions along with promises I was able to progress smoothly.

Demo

Here's a video of The Employee Tracker in action: EmployeeTrackerDemo

main budget

About

The application takes place in the terminal. It uses inquirer.js to prompt users for questions. It implements MySQL to store tables for employees, roles, and departments and the CLI allows users to interact with the database by allowing them to do things like add new employees, create new departments, and more. Some of the tables have a one-to-m…

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published