The Employee-Tracker is a command-line application built with Node.js, Inquirer, and PostgreSQL. It allows business owners to easily view and manage all of the departments, roles, and employees in their company. This application offers a user-friendly interface to interact with the company's employee database, enabling the organization and planning of business operations.
To get the Employee Management System up and running, follow these steps:
-
Clone the Repository:
git clone https://github.com/Redwolf917/Employee-Tracker.git
-
Navigate to the Project Directory:
cd Employee-Tracker
-
Install Dependencies:
npm install
-
Set Up PostgreSQL Database:
- Create a new PostgreSQL database:
CREATE DATABASE company_db;
- Use the
schema.sql
file to set up the database schema:psql -U postgres -d company_db -f sql/schema.sql
- (Optional) Use the
seeds.sql
file to populate the database with initial data:psql -U postgres -d company_db -f sql/seeds.sql
- Create a new PostgreSQL database:
-
Configure Database Connection:
- Update the
db.js
file with your PostgreSQL connection details. Specifically, you need to add your own password and change the username if you aren't using the username "postgres".
- Update the
To run the application:
node index.js
Once started, you will be presented with a menu of options:
- View all departments
- View all roles
- View all employees
- Add a department
- Add a role
- Add an employee
- Update an employee role
- Exit
- View All Employees: Displays a formatted table showing employee data, including employee IDs, first names, last names, job titles, departments, salaries, and managers.
- Add a New Role: Prompts the user for the role name, salary, and department before adding the role to the database.
The database consists of three main tables:
-
Department:
id
: SERIAL PRIMARY KEYname
: VARCHAR(30) UNIQUE NOT NULL
-
Role:
id
: SERIAL PRIMARY KEYtitle
: VARCHAR(30) UNIQUE NOT NULLsalary
: DECIMAL NOT
- [email protected]:Redwolf917/Employee-Tracker.git
- https://github.com/Redwolf917/Employee-Tracker.git