Week-10 Challenge Object-oriented Programming Challenge: SVG Logo Maker
In this challenge, you are tasked with building a Node.js command-line application that generates a logo based on user input. The application prompts the user to select a color and shape, provide text for the logo, and then saves the generated logo as an SVG file. You will need to provide a walkthrough video demonstrating the functionality of the application and passing all tests.
This application was built as a way to allow freelance web developers to create simple logos for their clients and projects so that they can forego paying a graphic designer. It utilizes inquirer to prompt the user within the command line for how they would like their logo to look (ie. what text they would like their logo to display (up to 3 characters in length), the color of that text, the shape of their logo (triangle, square, or circle) and the color of that shape.) Once the user answers all prompts, then an SVG file is written using their selections to generate a logo.
Node.js Jest for unit testing Inquirer for collecting user input
This project is powered by Node.js v16, utilizes inquirer v8.2.4 (node package manager), and file system module (node package manager). It also employs jest v29.5.0 (node package manager) for the unit testing conducted in this application.
Installation: Clone the repository or create a new directory for your project. Set up the directory structure as recommended:
├── examples/
├── lib/
├── shapes.js
├── shapes.test.js
└── more...
├── .gitignore
├── index.js
├── package.json
└── README.md
Install Jest and Inquirer by running: npm install jest inquirer Create the necessary classes (Triangle, Circle, Square) in the lib folder and write tests for each class using Jest. Implement the application logic in index.js to prompt the user for input, generate the logo, and save it as an SVG file.
Use Jest for running unit tests. Each shape class (Triangle, Circle, Square) should be tested for a render() method that returns the corresponding SVG string with the given shape color. An example test for the Triangle class could be: const shape = new Triangle(); shape.setColor("blue"); expect(shape.render()).toEqual(''); You may also need to write additional tests for handling user input, file writing, etc., although this is optional.
NOTICE: This application is covered under the MIT License
© 2024 edX Boot Camps LLC. Confidential and Proprietary. All Rights Reserved.
Have additional questions? Click the links below to reach me through my GitHub account or Email address.