https://github.com/hashim-zj/inventory_management
A Management Application using Django ,React
https://github.com/hashim-zj/inventory_management
Last synced: 3 months ago
JSON representation
A Management Application using Django ,React
- Host: GitHub
- URL: https://github.com/hashim-zj/inventory_management
- Owner: Hashim-Zj
- Created: 2025-01-10T12:10:56.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-01-13T09:04:53.000Z (5 months ago)
- Last Synced: 2025-01-19T02:04:39.061Z (4 months ago)
- Language: JavaScript
- Size: 212 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# INVONTARY MANAGEMENT SYSTEM
## Technologies Used
- **Backend**: Django, Django REST Framework
- **Frontend**: React.js, Axios, React Bootstrap,
- **Database**: MySQL---
## Setting Up the Project
### Step 1: Create a Virtual Environment
#### For Linux:
```bash
python3 -m venv env
source env/bin/activate
```#### For Windows:
```bash
python -m venv env
env\Scripts\activate
```### Step 2: Install Required Dependencies
```bash
pip install django djangorestframework python-decouple mysqlclient django-cors-headers
```---
## MySQL Database Setup
### Step 3: Configure MySQL
#### Start MySQL:
```bash
sudo mysql -u root -p
```#### Create a New User:
```sql
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
```#### Create the Database:
```sql
CREATE DATABASE invontary;
```#### Grant Privileges to the User:
```sql
GRANT ALL PRIVILEGES ON invontary.* TO 'username'@'localhost';
```#### Verify Privileges:
```sql
SHOW GRANTS FOR 'username'@'localhost';
```### Step 4: Create an Environment File
In the main folder, create a `.env` file with the following format:
```
DB_NAME=invontary
DB_USER=username
DB_PASSWORD=password
DB_HOST=localhost
DB_PORT=3306
```---
## Backend Setup
### Step 5: Migrate and Run the Backend Server
Navigate to the backend directory:
```bash
cd invontary/
```Run the following commands:
```bash
python manage.py makemigrations
python manage.py migrate
python manage.py runserver
```---
## Frontend Setup
### Step 6: Install Dependencies and Run
Navigate to the frontend directory:
```bash
cd frontend/
```Install dependencies:
```bash
npm install axios react-datepicker react-router-dom react-bootstrap react-toastify
```Run the frontend server:
```bash
npm start
```---
## API Endpoints for Testing
### 1- ITEM MASTER
### Get All ITEMS
**Method**: GET
**URL**: `http://localhost:8000/item_master/`### Get a Specific Item
**Method**: GET
**URL**: `http://localhost:8000/item_master//`
Replace `` with the ID of the todo item.### Add a New Item
**Method**: POST
**URL**: `http://localhost:8000/item_master/`
**Body**:```json
{
"item_name": "Veg Burgur",
"description": "A fress Veg Burger"
}
```### Edit a Item
**Method**: PUT
**URL**: `http://localhost:8000/item_master//`
Replace `` with the ID of the todo item.
**Body**:```json
{
"item_name": "Veg Burgur",
"description": "A fress Veg Burger with expery date"
}
```### Delete a Item
**Method**: DELETE
**URL**: `http://localhost:8000/item_master//`
Replace `` with the ID of the todo item.### ************\_\_\_\_************
### 2- STOCK INVONTORY
### Get All Stocks
**Method**: GET
**URL**: `http://localhost:8000/goodsin/`### Get a Specific stock
**Method**: GET
**URL**: `http://localhost:8000/goodsin//`
Replace `` with the ID of the todo item.### Add a New stock
**Method**: POST
**URL**: `http://localhost:8000/item_master//add_GoodsIn/`
Replace `` with the ID of the todo item.
**Body**:```json
{
"quantity": 5,
"expiry_date": "2025-01-10",
"entry_number": 02
}
```### Edit a stock
**Method**: PUT
**URL**: `http://localhost:8000/goodsin//`
Replace `` with the ID of the todo item.
**Body**:```json
{
"quantity": 10,
"expiry_date": "2025-01-10",
"entry_number": 02
}
```### Delete a stock
**Method**: DELETE
**URL**: `http://localhost:8000/goodsin//`
Replace `` with the ID of the todo item.### ************\_\_\_\_************
### 2- PURCHASE INVONTORY
### Get All Purchase
**Method**: GET
**URL**: `http://localhost:8000/goodsout/`### Get a Specific Purchase
**Method**: GET
**URL**: `http://localhost:8000/goodsout//`
Replace `` with the ID of the todo item.### Add a New Purchase
**Method**: POST
**URL**: `http://localhost:8000/item_master//add_GoodsOut/`
Replace `` with the ID of the todo item.
**Body**:```json
{
"quantity": 5
}
```### Edit a Purchase
**Method**: PUT
**URL**: `http://localhost:8000/goodsout//`
Replace `` with the ID of the todo item.
**Body**:```json
{
"quantity": 10
}
```### Delete a Purchase
**Method**: DELETE
**URL**: `http://localhost:8000/goodsout//`
Replace `` with the ID of the todo item.---