I've created a command-line interface/application from scratch to manage a company's human resources data, an employee database, by using Node.js, Inquirer, and MySQL.
Here the steps to get up and running:
npm i
REQUIRED: You will need a MySQL username and account because you could be prompted to enter your MySQL password.- To initiate MySQL the command is
mysql -u root -p
then you are prompted for your password.
Note: Command lines are notorious for not allowing copy/paste. You can copy/paste if you right click in the command line on most machines. - The command line will change from powershell or node to mysql. Enter
source db/schema.sql;
to set up the database locally. - Then to seed the database with data, enter
source db/seeds.sql;
- To get out of the mysql shell type
quit
orexit
To fully initiate the Command Line Interface type either npm start
or node index.js
.
To exit any question or the CLI at any time, click CTRL+C
and the CLI will ask you if you want to terminate the batch job.
A user will be able to go through command prompts to do the following:
- To view all departments
- To view all employee roles
- To view all employee data
- To create a new role
- To create a new employee entry
Initial Prompt of Departments:
Link to recording of working application. https://drive.google.com/file/d/1KmyHf6bsI5JnXZKTgV4-F2bCP4WvDR1C/view
If there are issues with the application, please reach out to me, Jennifer Engle, at j.engle.dev@gmail.com and reference the application, site's URL or GitHub repo you're reviewing. Please provide any screenshots and behavior along with your browser information. Thank you!
I'd like to thank David Love @Cyril1743 & Steven Chafin @SChafinIII for helping me understand switch statements and cases.
These references helped me build this project:
- https://nodejs.org/en/docs/
- https://nodesource.com/blog/an-absolute-beginners-guide-to-using-npm/
- https://github.com/SBoudrias/Inquirer.js/blob/master/packages/inquirer/examples/filter-validate-progress.js
- https://www.javatpoint.com/nodejs-mysql-insert-record
- https://www.javatpoint.com/nodejs-mysql-create-connection
- https://www.npmjs.com/package/inquirer?activeTab=explore
- https://sequelize.org/docs/v6/getting-started/
- https://www.w3schools.com/sql/sql_constraints.asp
- https://www.sqlshack.com/sql-insert-into-select-statement-overview-and-examples/
- Reviewed coursework solved files.
- ASKBCS help in Slack
- Class instructor team & tutoring
There is no license for this project.
Sumitted for grading review. I will continue to work on this.
I am open to collaboration for contributing to updates to this page. Please email me at j.engle.dev@gmail.com.