This command-line application will take in information about employees on a software engineering team, then generates an HTML webpage that displays summaries for each person.
The following image shows the generated webpage:
As a manager, I want to generate a webpage that displays my team's basic info so that a user can have quick access to their contact details.
-
Based on the tests provided (inside the
starter/__tests__
folder), I created 4 classes - 1Employee
parent class and 3 other classes extending that parent class. -
I used the
inquirer
module to prompt the user and gather information about the development team members and creates objects for each team member using the correct classes as blueprints.
-
Each employee card is generated based on a class :
Manager
,Engineer
,Intern
-
All those 3 classes extend an
Employee
parent class, with a basic structure including aname
,email address
andemployee ID
. -
But each class also has unique properties and methods that are not shared with other classes. e.g.
Manager
has anofficeNumber
property,Engineer
has agithub
property andIntern
has aschool
property.
- I have implemented basic validation functions to check user inputs (for employee names, IDs, email and Github username). For instance, if an employee name contains characters that are not letters or whitespaces, then they will be prompted again.
- After collecting all the data from the user, the application dynamically generates a
team.html
file inside aoutput
folder (also dynamically generated) to store the rendered HTML content returned from therender
function (provided with the starter code).
-
Javascript
-
Node.js
-
Npm
-
Html5
-
Bootstrap
-
Jest
Apart for some styling adjustments that I've made (cards margins, background and text-color), the HTML content along with the tests files was provided in the starter code.
My task was to write all the JavaScript content necessary to pass the tests and achieve the final goal: generate a webpage based on the user input.
To use the app, you will need to:
- install
Node.js
- run
npm install --save inquirer@^8.0.0
(the app requires version 8 or below) - run
npm install --save-dev jest
- then run
node index.js
ornpm start
To run the tests, run npm test
in your terminal.
README template
Input validation
fs & path modules
- How to check if a directory exists
- How to create a directory
- Difference between path.resolve and path.join
Thank you
- This project was made as part of a coding assignment with Trilogy Education Services
All contributions are welcome. Please feel free to contact me (using the contact details in the Questions section) or open an issue on this repository.
- If you have any questions, please click here to send me an email.
- You can also visit my Github profile @senseilein.
This application is covered under MIT License.