Employee management application executed via a Node Command Line Interface (CLI). Employee information is stored in a MySQL database.
Github Repository Page: https://github.com/palowenstein/mysql-employee-management-tracker-application
Github Deployment Page: N/A - App is to be executed via CLI in Terminal (Mac) or Powershell, Bash (PC).
Gif 1. MySQL Workench: 1. Setting up the database, 2. Populating the database with seed.sql. (GIF)
Gif 2. Executing the Application via CLI (Command Line Interface) in Terminal.
- The MySQL Employee Management Tracker Application allows for the creation and maintenance of an employee database, ideal for company management.
- The application is powered by Node.js to allow for JS execution outside of the browser (Mac Terminal window), Express (Get/Post Requests between REST 'REpresentational State Transfer' APIs), Inquirer (for information collection), Console.table (for a clean table display) and a MySQL database which stores the information created, read, updated or deleted (CRUD).
- The MySQL database, stored in the db folder as schema.sql, can be initiatied via Terminal or, more simply, via MySQL Workbench (GIF/MP4).
- In addition of the database schema, the db folder also contains a seed.sql file which will populate the database at startup so that it doesn't show empty.
- Like the database, the seed.sql file can be executed via Terminal or via MySQL Workbench, it contains the names of 19 Atari Inc. key employees (1972-1984) such as Jay Miner or Joe Decuir.
- The end user, via the Terminal Command-Line Interface, is allowed all four CRUD stages:
- (Create) Add departments, roles, employees.
- (Read) View departments, roles, employees.
- (Update) Update employee roles.
- (Delete) Delete employees.
- A .gitignore file is present at the root level to prevent the upload of node_modules, bonus functions in development, .DS_Store.
- For this application to execute properly:
- Oracle's MySQL must be installed and running in the background as seen in the System Preferences photo below. The application will not run correctly otherwise. Please make note of the password associated with your MySQL install as it will be required by the application. Newcomers to MySQL will gain information from reading the following article: https://www.thoughtco.com/installing-mysql-on-mac-2693866
- The end user must execute the package.json file via the npm install command (Terminal). This will install the required dependencies (Express, Inquirer, MySQL, Console.Table) needed for the program to run. This package is located in the application root folder and must be executed in situ prior to running the application (see Instructions).
Fig. 0. MySQL runs in the background as seen in the MySQL maintenance panel located in System Preferences (Apple Macintosh).
- Makes sure MySQL is properly installed, password initiated and running in the background as seen in the Details section illustration above.
- In MySQL Workbench, load the schema.sql file, located in the application db folder, then initiate it by clicking on the lightning bolt (GIF/MP4).
- Still in MySQL Workbench, locate the seed.sql file in the application db folder then, as in the prior step, initiate it by clicking on the lightning bolt (GIF/MP4).
- In the Application folder, open app.js in a text / code editor, add your MySQL Password on line 17 between the password quotation marks.
- In Terminal, locate the application folder and enter into it via the 'cd' command: cd mysql-employee-management-tracker-application
- Run the 'npm install' command to install the necessary node modules from the package.json.
- Run the 'node app.js' command to launch the application in Terminal (GIF/MP4).
- Once the application is running, you can exert all four CRUD privileges (Create Read Update Delete):
- Creation: Create departments, roles, employees.
- Reading: Read departments, roles, employees.
- Updating: Update employee roles.
- Deletion: Delete employees.
- The application can be closed from the main menu by selecting the 'Leave' option.
Refer to app.js (javascript file) for code dissection.
Fig. 1. Setting up the database in MySQL Workbench (PNG)
Fig. 2. Populating the database with seed.sql (ATARI Employees) in MySQL Workbench (PNG)
Fig. 3. Executing the Application via CLI Interface in Terminal [1] (PNG)
Fig. 4. Executing the Application via CLI Interface in Terminal [2] (PNG)
- MySQL Relational Database Structure.
- Node.js Javascript Library for CLI Execution.
- Express for GET/POST/DELETE Requests between REST APIs.
- Inquirer for prompt interaction, data collection.
- Console.Table for proper CLI table formatting / presentation.
- Package.JSON / NPM for installing dependencies
MIT License | Copyright © [2021] Pierre André Lowenstein
- Pull/Fork from master.
- Create your own branch.
- Add your own code (must be tested).
- Push your branch.
- Request a pull.
Please use the [Contributor Covenant Code of Conduct](https://www.contributor-covenant.org/version/2/0/code_of_conduct/code_of_conduct.md)
For major changes, please open an issue beforehand to discuss the changes.
[www] pierreandrelowenstein.com | [e-mail] Send me a 'courriel'