The Employee Tracker Application is an interactive command-line tool designed to help businesses manage their organizational structure. Built using Node.js, PostgreSQL, and Inquirer, this application allows users to view and manage employees, roles, and departments dynamically through an intuitive CLI interface.
- Overview
- Features
- Technologies Used
- Concepts Covered
- Learning Objectives
- How to Run
- Future Improvements
- Summary
The Employee Tracker Application enables businesses to streamline their human resources processes by allowing seamless management of employees, roles, and departments. Users can add, view, and update employee information, ensuring data integrity and consistency through PostgreSQL's relational database structure. The app also dynamically retrieves and displays organizational data in a tabular format for quick insights.
- View All Departments: Fetch and display a list of all departments in the organization.
- View All Roles: Retrieve and display all roles, their respective departments, and salaries.
- View All Employees: Display detailed employee information, including their roles, departments, salaries, and managers.
- Add a Department: Add new departments to the organizational structure.
- Add a Role: Create new roles and associate them with existing departments.
- Add an Employee: Add new employees, assign roles, and optionally specify their managers.
- Update Employee Roles: Modify an employee's role to reflect changes in their position.
- Node.js: The runtime environment for executing JavaScript on the server side.
- PostgreSQL: A robust relational database system for storing and managing organizational data.
- Inquirer.js: Handles interactive command-line prompts for user input.
- dotenv: Manages environment variables for secure database connections.
- Console.table: Formats data into easily readable tables in the terminal.
- Relational Database Management: Using PostgreSQL to store and manage hierarchical data.
- SQL Query Execution: Writing and executing SQL queries dynamically based on user input.
- Environment Configuration: Securing sensitive credentials using environment variables.
- Command-Line Interfaces: Building an intuitive CLI for interacting with the database.
- Dynamic Query Results: Fetching and displaying relational data using JOINs and aggregations.
- Understand how to build a Node.js CLI application for database management.
- Learn to connect and query a PostgreSQL database from a Node.js application.
- Explore advanced SQL concepts such as JOINs and cascading relationships.
- Practice securing database credentials with environment variables using dotenv.
- Gain hands-on experience with asynchronous programming using promises and async/await.
-
Clone the Repository
Clone the project repository to your local machine:git clone https://github.com/BrockAltug/employee-tracker.git
Navigate to the project directory:
cd employee-tracker -
Set Up Environment Variables
Create a.envfile in the root directory with the following content:DB_USER=your_database_user DB_PASSWORD=your_database_password DB_HOST=localhost DB_DATABASE=your_database DB_PORT=5432 -
Install Dependencies
Install the required dependencies by running:npm install
-
Set Up the Database
Initialize the database by running the provided SQL scripts:psql -U your_database_user
Create schema and insert sample data:
\i schema.sql \i seeds.sql
-
Run the Application
Start the application by running:node index.js
-
Interact with the CLI
Follow the on-screen prompts to view and manage organizational data.
The Employee Tracker Application is an essential tool for businesses looking to manage their organizational data effectively. By leveraging the power of Node.js, PostgreSQL, and Inquirer, this application provides a streamlined, user-friendly solution for HR and administrative tasks. It offers dynamic insights into the company structure, ensuring efficient and informed decision-making. Perfect for any organization seeking to enhance its employee management processes.