Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fredm23579/sql-employee-tracker
This is a Node.js project with a MySQL database, consisting of a RESTful API for managing departments, employees, and roles in a company.
https://github.com/fredm23579/sql-employee-tracker
Last synced: about 2 months ago
JSON representation
This is a Node.js project with a MySQL database, consisting of a RESTful API for managing departments, employees, and roles in a company.
- Host: GitHub
- URL: https://github.com/fredm23579/sql-employee-tracker
- Owner: fredm23579
- License: mit
- Created: 2024-05-05T02:54:50.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-05-06T04:33:52.000Z (8 months ago)
- Last Synced: 2024-05-07T03:29:23.818Z (8 months ago)
- Language: JavaScript
- Homepage: https://github.com/fredm23579/sql-employee-tracker
- Size: 16.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
SQL EMPLOYEE TRACKER
Codebase for the SQL EMPLOYEE TRACKER platform
◦ Developed with the software and tools below.
---
## 📚 Table of Contents
- [📚 Table of Contents](#-table-of-contents)
- [🔍 Description](#-description)
- [🌟 Features](#-features)
- [📁 Repository Structure](#-repository-structure)
- [💻 Demo Video](#-demo-video)
- [💻 Code Summary](#-code-summary)
- [🚀 Getting Started](#-getting-started)
---
## 🔍 DescriptionThis is a Node.js project with a MySQL database, consisting of a RESTful API for managing departments, employees, and roles in a company. The project includes a `db` directory with schema and seed files, as well as a `lib` directory with utility functions for connecting to the database and performing queries. The `models` directory contains JavaScript classes for each of the three entities, and the `index.js` file is the entry point for the application.
---
## 🌟 Features
Node.js, MySQL, RESTful API, departments, employees, roles, company, schema, seed, utility functions, connection, queries, models, JavaScript classes
---
## 📁 Repository Structure
```sh
├── .env
├── .gitignore
├── db
│ ├── schema.sql
│ └── seeds.sql
├── index.js
├── lib
│ ├── connection.js
│ ├── queries.js
│ └── utils.js
├── LICENSE
├── models
│ ├── department.js
│ ├── employee.js
│ └── role.js
├── package-lock.json
├── package.json
└── README.md```
---## Demo Video
- [demo video](https://drive.google.com/file/d/1kzjCWhborksz4Yp_1Lof7safywFpYE9N/view?usp=sharing)
---
## 💻 Code Summary
Root
| File | Summary |
| ---- | ------- |
| index.js | The code is a command-line application that allows users to interact with a database of employees, departments, and roles. It provides a menu-driven interface for viewing, adding, updating, and deleting data, as well as exiting the application. |---
\lib
| File | Summary |
| ---- | ------- |
| connection.js | The code creates a connection pool for a MySQL database using the `mysql2` package, loads environment variables from a `.env` file, and exports the pool as a promise. |
| queries.js | The code defines a set of functions for interacting with a database, including retrieving data, adding new records, and updating existing ones. |
| utils.js | The code defines two functions, `promptUser` and `promptInput`, which use the `inquirer` package to prompt the user with a list of choices or for input, respectively. |---
\models
| File | Summary |
| ---- | ------- |
| department.js | The code defines a module that exports functions to interact with a database using the `pool` connection from the `../lib/connection` file. |
| employee.js | The code defines a module that exports functions to interact with a database using the `pool` connection. |
| role.js | The code defines a module that exports functions to interact with a database using the `pool` connection from the `../lib/connection` file. |---
## 🚀 Getting Started
To get started with this project, follow these steps:
1. Install the necessary dependencies by running `npm install` in your terminal.
2. Create a `.env` file in the root directory of the project and add your MySQL username and password to it, like this:
```
DB_USER=your_username
DB_PASSWORD=your_password
```
3. Start the application by running `node index.js` in your terminal.
4. Use the command-line interface to interact with the application and manage the employee database.Note: Before you start, make sure you have a MySQL server running on your local machine and that you have created the necessary database and tables using the schema and seed files in the `db` directory.