Employee Tracker is an application that uses Node.js, Inquirer, and SQL to create a database that connects with the command line interface. Users can search for employee information by entering key words into each inquiry prompt.
This application is useful to employers who wish to track their employees in one central database. They can view departments, roles, or employee tables. They can also add, delete, or update each of these tables.
This application is run using the user's terminal. Before running this application, please see the Installation section.
- It is invoked using the command
npm start, which will then begin to prompt the user for input regarding which action they want to take to interact with their employee database. - Users can navigate the menu to choose between the following options:
- View
- Departments
- Roles
- Employees
- Add
- Departments
- Roles
- Employees
- Delete
- Departments
- Roles
- Employees
- Update
- Employee's Role
- Employee's Manager
- View
- If the user chooses to view:
- departments, then they are presented with a table showing the department name and department ID.
- roles, then they are presented with a table showing the job title, role ID, department ID that the role belongs to, and salary for that role.
- employees, then they are presented with a table showing the employee data, including employee ID, first name, last name, job title, department, salary, and manager that the employee reports to.
Here's a link to the video version of the above gif.
- Users can add departments, roles, or employees as well. Once they select these prompts, they will be asked to enter the relevant information to fill out the table within the employee tracker database. If the user views the tables after adding an element, they can see their changes in the corresponding tables.
Here's a link to the video version of the above gif.
- Users can delete departments, roles, or employees as well. After the deletion, the corresponding tables will update to show that the relevant data has been removed. Note that any links from other tables to the deleted information will become null.
Here's a link to the video version of the above gif.
- And finally, users can update employee information. They have the option to update the employee's role or manager.
Here's a link to the video version of the above gif.
In order to use this application, you will need to install it on your local computer.
- Open the command line interface.
- Clone the repository onto your local machine using the
git clonecommand. - Once the repository has been cloned, navigate into the root directory of the application using the command
cd Team-Profile-Generator. - This application has dependencies that must be installed prior to running the application (i.e. dotenv, inquirer, MySQL2, and console.table). Run the command
npm installto install necessary packages and dependencies. - This application relies on private enviromental variables. In the main directory of the application, create a
.envfile.- The contents of your
.envfile should look like this, where [MySQL username] is your MySQL username, and [MySQL password] is your MySQL password:
DB_NAME="employee_tracker" DB_USER="[MySQL username]" DB_PW="[MySQL password]"- For example, if my username is
ashlynn4567and my password ispassword1234, my.envfile will look like the following:
DB_NAME="employee_tracker" DB_USER="ashlynn4567" DB_PW="password1234" - The contents of your
- Next, you will need to seed the data. Note: You must have MySQL installed on your computer in order to seed the data.
- Log in to MySQL in your command line with the command
mysql -u root -p. - Enter your login credentials.
- Type the command
source db/schema.sql. - Next, type the command
source db/seeds.sql. - Quit MySQL with the command
quit.
- Log in to MySQL in your command line with the command
- Now you can start the application. Enter the command
npm startin your terminal to begin. - Navigate through the prompts in your command line interface using your keyboard.
- If you wish to quit the application at any time, simply type
ctrl + C.
For further help with installation, please refer to the below demonstration video.
Here's a link to the video version of the above gif.
- JavaScript
- Node.js
- npm
- dotenv
- MySQL2
- Inquirer
- console.table
In the future, I would like to add the following improvements:
- A feature that allows users to export their employee tracker into an excel spreadsheet.
- A front-end UI so that users don't have to go through complicated installation instructions in order to use the application.
I'm always interested in refactoring code to improve it's functionality. If you would like to suggest your own improvements, you can reach me at the links below.
This project was built with the help of the University of Oregon's Coding Boot Camp.
The application is covered under the following license: MIT