From ff3510a96163dcd41f992b8fee9984be2a696cbc Mon Sep 17 00:00:00 2001 From: ahmedgamalyousef Date: Sat, 4 Oct 2025 22:47:10 +0300 Subject: [PATCH] Updating README.md File --- README.md | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index b1c77a8..90ff056 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ # 🍎 Fruit Store API A simple **RESTful API** built with Flask that manages fruits in a store. -The project also includes **logging**, a **log monitoring script**, and **automated testing script** with clear pass/fail output. +The project also includes **logging**, a **log monitoring script**, and **automated testing script** with clear pass/fail output . This project uses **GitHub Actions Continuous Integration (CI)** to ensure the API works correctly after every code change . + ---- ## 📂 Project Structure ``` fruit-api/ @@ -33,7 +33,7 @@ fruit-api/ - `CI/CD` pipeline for automated testing ---- + ## ⚙️ Setup Instructions @@ -61,10 +61,10 @@ or python3 fruit_api.py ``` -API will start at: +API will start at : 👉 `http://localhost:5000` ---- + ## 🚀 API Endpoints @@ -86,7 +86,7 @@ http://localhost:5000 | GET | `/fruits/search?name=` | Search fruits by name | | GET | `/health` | Health check | ---- + ## 📑 Example Usage (with curl) @@ -119,7 +119,7 @@ Example log: 2025-09-29 18:05:22 - IP:127.0.0.1 - METHOD:GET - ENDPOINT:/fruits - STATUS:200 ``` ---- + ## 🔎 Monitoring (log_monitor.sh) @@ -134,11 +134,11 @@ Run it in background: bash log_monitor.sh & ``` ---- + ## 🤖 API Testing (test_api.sh) -The `test_api.sh` script: +The `test_api.sh` script : - Runs automated `GET`, `POST`, `PUT`, `DELETE` requests - Prints ✅ if the status is correct (200/201), ❌ otherwise - Logs results in `test_results.log` @@ -159,18 +159,15 @@ Example output: ✅ All tests passed! ``` ---- + ## 📘 Swagger Documentation After starting the API, open: 👉 [http://localhost:5000/docs](http://localhost:5000/docs) ---- + ## ⚡ CI/CD Pipeline - -This project uses **Continuous Integration (CI)** to ensure the API works correctly after every code change. - ### Workflow - Triggered on every **push** or **pull request** to `main` branch. - Installs dependencies (`requirements.txt`). @@ -178,7 +175,6 @@ This project uses **Continuous Integration (CI)** to ensure the API works correc - Runs automated tests (`test_api.sh`). - Pipeline **fails** if any test ❌ fails. ---- ## 🐳 Docker Support