Skip to content
 
 

Latest commit

 

History

25 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Here’s the README file text separated for easier copying:

Section 1: Predictive API

# Predictive API

This project is a predictive maintenance API built with Flask and MySQL, designed to integrate with the Fixed Asset Management System.

Section 2: Setup

## Setup

### Create the `predictive-api` Folder

1. Create a folder named `predictive-api` for the project.

Section 3: Installation

### Installation

To install the necessary dependencies, run the following commands:

```bash
pip install Flask
pip install mysql-connector-python
pip freeze > requirements.txt

This will install Flask and MySQL Connector, and save the installed packages to requirements.txt.


### Section 4: Running the API

```markdown
### Running the API

1. Activate the virtual environment:

   ```bash
   .\venv\Scripts\activate
  1. Run the Flask application:

    python app.py

### Section 5: Checking if the API is Working

```markdown
### Checking if the API is Working

#### Option 1: Using PowerShell

Run the following command in PowerShell to test the API:

```powershell
Invoke-RestMethod -Uri http://127.0.0.1:5000/predict -Method POST -Headers @{'Content-Type'='application/json'} -Body '{"repair_count": 3, "average_cost": 2000, "time_between_repairs": 100}'

Option 2: Using a Browser

Open a web browser and go to:

http://127.0.0.1:5000/

You should see the following output:

Flask app is running!

### Section 6: Integration with Fixed Asset Management System

```markdown
## Integration with Fixed Asset Management System

In the `fixed-asset-management-system` project, run the following command to process the queue:

```bash
php artisan queue:work

This will start the queue worker for processing background jobs.


These sections can be copied and used individually as needed. Let me know if you need any further adjustments!

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages