Developers are often tasked with creating interfaces that make it easy for non-developers to view and interact with information stored in databases. Often these interfaces are known as Content Management Systems. In this assignment, we will architect and build a solution for managing a company's employees using node, inquirer, and MySQL.
We can frame this challenge as follows:
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
-
The command-line application should allow users to:
-
Add departments, roles, employees
-
View departments, roles, employees
-
Update employee roles
-
-
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
-
Schema Visual Representation:
-
Ensure
Node.js
is installed on your machine. IfNode.js
is not installed on your machine, click here to download and install the application. -
The
package.json
file included in this repo already lists all Node modules, NPM packages, and other dependencies that are required to successfully run this application. Please be sure to run thenpm install
command within the terminal, while in the root directory to install all required modules/packages. -
Use the
schema.sql
to create the database in MySQL.For assistance on how to install, creat and connect to MySQL - simply click this link. -
(Optional) then run the
seed.sql
file to pre-populate your database. This will make the development and testing of individual features much easier. Check out SQL Bolt for some extra MySQL help. -
Next run
node employeeTracker.js
to start the application.-
Used the MySQL NPM package to connect to your MySQL database and perform queries.
-
Used InquirerJs NPM package to interact with the user via the command-line.
-
Used console.table to print MySQL rows to the console. There is a built-in version of
console.table
, but the NPM package formats the data a little better for our purposes.
-
Andres Lajara |
Team Member | GitHub Link | LinkedIn Link |
---|---|---|
Kevin Holder | View | View |
Jordan Neill | View | View |
Ashley Lerma | View | View |
-
The command-line application should allow users to:
-
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
-