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.
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
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
- 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 yourlocalhost
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
- Start the application by typing
node tracker
in your command line:
- Select a choice when prompted and continue to make changes for as long as you'd like:
- When you're done, you can select
Exit
at the end of the main menu choices or^c
at any time:
This CLI App wouldn't run without Inquirer or MySQL. Chalk and console.table also helped make the content more readable in the console.
If you have any questions, feel free to find me at:
- Email: laurensiminski@gmail.com
- Website: https://siminski.co
- Github: @siminski
Appreciate this code? Say thanks with a coffee:
Copyright (c) 2020 Lauren Siminski.