sql-employee-tracker

Employee Tracker

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.

Table of Contents

Demo

Demo Video

Overview

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.

Features

Technologies Used

Concepts Covered

Learning Objectives

  1. Understand how to build a Node.js CLI application for database management.
  2. Learn to connect and query a PostgreSQL database from a Node.js application.
  3. Explore advanced SQL concepts such as JOINs and cascading relationships.
  4. Practice securing database credentials with environment variables using dotenv.
  5. Gain hands-on experience with asynchronous programming using promises and async/await.

How to Run

  1. 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
    
  2. Set Up Environment Variables
    Create a .env file 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
    
  3. Install Dependencies
    Install the required dependencies by running:

    npm install
    
  4. 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
    
  5. Run the Application
    Start the application by running:

    node index.js
    
  6. Interact with the CLI
    Follow the on-screen prompts to view and manage organizational data.

Summary

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.