The Employee Management System is a robust and interactive application designed to streamline the management of employee data within an organization. This application offers a user-friendly command line interface to view, add, update, and delete employee-related information, encapsulating the essential aspects of effective data management and organization hierarchy.
The core objective of this project is to provide a simplified, yet comprehensive, interface for managing various aspects of employee data, departments, roles, and budgets within a designated database structure.
- Interactive CLI interface facilitating ease of navigation and data manipulation.
- Efficient data retrieval and modification for departments, roles, and employees.
- Real-time budget analysis for different departments.
- Structured database schema ensuring data integrity and consistency.
The project incorporates a class SqlFunctions to encapsulate the SQL operations required for interacting with the database. This class provides methods to execute a variety of SQL queries to manage and retrieve data.
Identify the requirements for data management, such as:
- Data attributes for employees, roles, and departments.
- Necessary operations like viewing, adding, updating, and deleting records.
Designing the database schema to accommodate the data structures for employees, roles, and departments while ensuring referential integrity.
Key components developed:
main: The main function to handle user interactions through a series of prompts.SqlFunctions: A class to encapsulate SQL operations and provide asynchronous query execution.
Ensure all functionality works as expected, and the database interactions are handled gracefully.
- User Input: Utilizes
inquirerto prompt the user for actions and inputs. - Action Handling: Based on user's action, relevant methods of
SqlFunctionsclass are invoked to execute corresponding database operations.
- Asynchronous Query Execution: Provides a method
queryAsyncfor executing SQL queries asynchronously. - Data Management Methods: Includes a variety of methods to handle CRUD (Create, Read, Update, Delete) operations for departments, roles, and employees.
- Ensure that
node.jsand MySQL are installed on your machine. - Clone the repository or download the source code.
- Open your terminal and navigate to the project directory.
- Once inside the project directory, navigate to the
Maindirectory. - Install the necessary npm modules by executing the command
npm install. - make sure you have a .enf file with the following format. Please make sure to update your password to match the mysql password.
DB_NAME='employeeDB' DB_USER='root' DB_PASSWORD='Your MySql password'
- Navigate to the
dbdirectory, which contains theschema.sqlandseeds.sqlfiles. - Launch MySQL by entering the following command in your terminal:
`
mysql -u root -p
- When prompted, enter your MySQL password.
- Once logged into MySQL, execute the following commands to set up the database and seed it with initial data:
source schema.sql;
source seeds.sql;
- Quit and navigate back to the Main directory
- Run the application by executing the command:
npm start
- Follow the prompts to interact with the employee management system.
Watch the app demo: Demo Video
The Employee Management System is a compact and intuitive solution for managing essential organizational data. The CLI interface coupled with structured database interactions makes data management efficient and straightforward.
This project is open for contributions and is licensed under the MIT License.
For any inquiries, feel free to contact at sep.alamouti@sepalamouti.com