Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mani-prakash-n-r/dynamic_inventory_tracking_system

The Dynamic Inventory Tracking System is a web app for managing and tracking inventory in real-time with secure login.
https://github.com/mani-prakash-n-r/dynamic_inventory_tracking_system

angular express mysql nodejs postman

Last synced: about 1 month ago
JSON representation

The Dynamic Inventory Tracking System is a web app for managing and tracking inventory in real-time with secure login.

Awesome Lists containing this project

README

        

# 🛠️ **Dynamic Inventory Tracking System** - Web Development

## 📋 **Project Overview**
The **Dynamic Inventory Tracking System** is a web-based application designed to help businesses manage their inventory efficiently. It provides a user-friendly interface to track product stock levels in real-time, manage products, and ensure secure access through user authentication. Built with modern technologies, this system features:

- **Frontend**: Developed using **Angular** (TypeScript, HTML, CSS)
- **Backend**: Powered by **Node.js** and **Express.js**
- **Database**: **MySQL** for data storage

---

## 🎯 **Features**
- **🛒 Manage Products**: Add, edit, and delete products in the inventory.
- **📊 Real-Time Stock Levels**: Track and monitor product stock levels in real-time.
- **🔒 Secure User Authentication**: Login and authentication system for secure access.
- **🔍 Product Search & Filter**: Search and filter products by category, name, or product ID.
- **📱 Responsive Design**: Access the system from any device, thanks to the responsive Angular frontend.

---

## 🔧 **Tech Stack**
- **Frontend**: Angular (TypeScript, HTML, CSS)
- **Backend**: Node.js, Express.js
- **Database**: MySQL
- **Authentication**: JWT (JSON Web Token) for secure user authentication
- **API Requests**: HTTP REST API using Express.js
- **Development Tools**: npm, Angular CLI

---

## 📝 **Installation Instructions**

### 1️⃣ **Clone the Repository**
Clone the project repository to your local machine:
```bash
git clone https://github.com/your-username/Dynamic_Inventory_Tracking_System.git
cd Dynamic_Inventory_Tracking_System

### 2️⃣ **Set Up the Backend**
- Navigate to the backend directory:
```bash
cd backend
```
- **Install Dependencies**:
```bash
npm install
```
- **Configure MySQL Database**:
Update the MySQL database configuration in the `config/db.config.js` file:
```javascript
module.exports = {
HOST: "localhost",
USER: "root",
PASSWORD: "password",
DB: "inventory_db"
};
```
Make sure to replace "localhost", "root", and "password" with your MySQL credentials.

- **Start the Backend Server**:
```bash
npm start
```
The backend will now be running at **http://localhost:3000**.

---

### 3️⃣ **Set Up the Frontend**
- Navigate to the frontend directory:
```bash
cd frontend
```
- **Install Angular Dependencies**:
```bash
npm install
```
- **Set the API Endpoint**:
In `src/environments/environment.ts`, set the API URL to point to your backend server:
```typescript
export const environment = {
production: false,
apiUrl: 'http://localhost:3000/api'
};
```
- **Start the Angular Frontend**:
```bash
ng serve
```
The Angular frontend will now be running at **http://localhost:4200**.

---

### 4️⃣ **Database Setup**

#### Create the Database:
Run the following SQL command in MySQL:
```sql
CREATE DATABASE inventory_db;
```

#### Create a MySQL User:
Create a user with necessary privileges to interact with the `inventory_db`:
```sql
CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON inventory_db.* TO 'user'@'localhost';
```
Make sure to replace `'user'` and `'password'` with your desired credentials.

---

## 🚀 **Running the Application**

1. **Start the Backend Server** at **http://localhost:3000**.
2. **Start the Frontend Server** at **http://localhost:4200**.
3. Open **http://localhost:4200** in your browser to access the **Dynamic Inventory Tracking System**.

---

## 📡 **API Endpoints**

The backend exposes the following **REST API** endpoints for interacting with the inventory system:

- **POST** `/api/products`: Add a new product to the inventory.
- Request body:
```json
{
"name": "Product Name",
"category": "Product Category",
"quantity": 100,
"price": 20.50
}
```

- **GET** `/api/products`: Retrieve a list of all products in the inventory.

- **GET** `/api/products/:id`: Get the details of a specific product by its ID.

- **PUT** `/api/products/:id`: Update product details (name, category, quantity, price) for a given product ID.
- Request body:
```json
{
"name": "Updated Product Name",
"category": "Updated Category",
"quantity": 120,
"price": 22.00
}
```

- **DELETE** `/api/products/:id`: Delete a product from the inventory by its ID.

---

## 🔐 **User Authentication**

The system supports secure user authentication using **JWT** (JSON Web Tokens).

To authenticate, send a **POST** request to `/api/auth/login` with your **username** and **password**:
```json
{
"username": "admin",
"password": "password123"
}
```
On successful login, the server will return a **JWT token**, which should be included in the **Authorization header** for subsequent API requests.

---

## 🏁 **Challenges**
### ⚠️ **Challenges Faced**:
- **Data Consistency**: Ensuring that data is consistently updated across the frontend, backend, and database, especially with multiple users accessing the system simultaneously.
- **Scalability**: As the product catalog grows, managing large datasets can lead to performance issues. Optimizing queries and improving backend processing is crucial.
- **User Authentication**: Implementing secure and reliable user authentication with JWT tokens requires attention to session management and token expiration.
- **Error Handling**: Proper error handling and input validation are essential for system stability and to prevent crashes or data corruption.

---

## 🚀 **Future Enhancements**
- **🔄 Real-Time Inventory Tracking**: Implement real-time stock updates using WebSockets to instantly reflect changes in inventory.
- **📈 Data Analytics**: Provide insightful analytics on inventory trends, product demand, and sales forecasts.
- **💻 Multi-User Support**: Enable multiple roles with different access levels (e.g., Admin, Manager, Employee).
- **📦 Integration with Other Systems**: Integrate with external supply chain and ERP systems for a seamless workflow.

---

## 🏅 **Conclusion**

The **Dynamic Inventory Tracking System** offers an intuitive, web-based solution to manage inventory efficiently. By leveraging **Angular** for the frontend, **Node.js** for the backend, and **MySQL** for data storage, the system is built for scalability and real-time performance. The integration of secure **JWT authentication** ensures safe and controlled access for users.

---

## ✨ **Key Takeaways**:
- Provides **real-time tracking** of inventory levels.
- **User authentication** ensures secure system access.
- Built with **modern technologies** for scalability and reliability.
- Easy to deploy and access from any device with a responsive UI.

---

## 📢 **Disclaimer**:
This system uses **personal data** (user login credentials) for authentication. Ensure data security practices are followed to protect user privacy.
```