I set out to create a command line application that would assit in the creation and management of team members. I wanted to make an easy to use and stylish application. In building this app, I discovered better ways to implament ideas and refactor my code to be simplier and easier to read.
Even though this application hasnt been deployed to npm yet, by downloading the required dependicees and running the index.js file found in the root.
Link-To-Repo Git Checkout HTTPS
Using the Team Profile Builder is easier that ever.
-
node index.js- To start the application, after installing dependencies -
Follow the prompts of the screen, building your team. There are default answers for some of the question if you don't have that information on hand yet.
-
When you have added everyone on your team, just select
nwhen asked if you need to add another and the application will take care of the rest. -
You will find your newly build index.html file located in the
/dist/index.htmlfolder
There is a small collection of tests for making sure that the app is running correctly and each employee is populated correctly🐛.
npm test To start test suite
I was able to create dynamic questions using the inquirer pakage using the information I found in📰 This-Article by Janne Kemppainen.
My prompts change depending on the type of employee being added
{
type: "input",
name: "unique",
message: "What is the engineer's GitHub?",
default: "githubUser",
when(answers) {
return answers.role === "Engineer"
}
},
{
type: "input",
name: "unique",
message: "What school is the Intern From?",
default: "Uni. None",
when(answers) {
return answers.role === "Intern"
}
},I also found the code needed to make sure that a valid email address has been entered to cut down on the amount of entry errors.
{
type: "input",
name: "email",
default: "none@none.none",
message(answers) {
return `What's ${answers.name} email address?`
},
validate: (answer) => {
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/
if (!emailRegex.test(answer)) {
return "You have to provide a valid email address!"
}
return true
}
},I want to implement a lot more information about each employee, as well as store and manipulate that data. Adding resources like MySQL🐬 and express should really improve the performance and make a bunch of new features possible.


