Skip to content

A simple command-line application for managing a company's employees using node, inquirer, and MySQL.

Notifications You must be signed in to change notification settings

larguar/employee-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Employee Tracker

A command-line application for managing a company's departments, roles, and employees using node, inquirer, and MySQL. From viewing your company’s departments and roles to updating an employee’s manager or salary, you can use this simple application to make your changes in one place.

JavaScript Badge Node.JS Badge MySQL Badge

Application Screenshot

User Story

As a business owner
I want to be able to view and manage the departments, roles, and employees in my company
So that I can organize and plan my business

Functionality

WHEN I run the application
THEN I am prompted with a list of options
WHEN I select ‘View All Departments’/‘View All Roles’/‘View All Employees’
THEN I can view a table with all of the current data in the department/role/employee database table
WHEN I select ‘Add A Department’/‘Add A Role’/‘Add An Employee’
THEN I am prompted for the data needed to add a new department/role/employee
THEN based on my input, a new department/role/employee is added to the appropriate database table
WHEN I select ‘Delete A Department’/‘Delete A Role’/‘Delete An Employee’
THEN I am prompted with a list of all current departments/roles/employees
THEN based on my input, a department/role/employee is deleted from the database
WHEN I select ‘Update A Role's Salary’
THEN I am prompted for the role to update and the new salary
THEN based on my input, the role is updated
WHEN I select ‘Update An Employee's Role’/‘Update An Employee's Manager’
THEN I am prompted for the employee to update and the new role/manager
THEN based on my input, the employee is updated
WHEN I select ‘Exit’
THEN the application stops running

Table of Contents

Installation

  • Download this repository or fork and clone it to your local device.
  • Run an npm install to install all of the dependencies:
npm install
  • Update the tracker.js file with your localhost connection password on line 12:
const connection = mysql.createConnection({
  host: 'localhost',
  port: 3306,
  user: 'root',
  password: 'p@ssw0rd',
  database: 'employeeDB'
});
  • Run the db/schema.sql file through MySQL or your command line to create your database and tables:
source ~/.bashrc
mysql -u root -p < db/schema.sql

Usage

  • Start the application by typing node tracker in your command line:

Application Screenshot

  • Select a choice when prompted and continue to make changes for as long as you'd like:

Application Screenshot

  • When you're done, you can select Exit at the end of the main menu choices or ^c at any time:

Application Screenshot

Credits

This CLI App wouldn't run without Inquirer or MySQL. Chalk and console.table also helped make the content more readable in the console.

Questions

If you have any questions, feel free to find me at:

Donate

Appreciate this code? Say thanks with a coffee:

ko-fi

License

Copyright (c) 2020 Lauren Siminski.