From a895522111804087e2ad96c585d81d0d840afb14 Mon Sep 17 00:00:00 2001 From: Muawiya Amir Date: Sun, 30 Aug 2026 23:50:42 +0500 Subject: [PATCH 01/13] Add MIT LICENSE file The repository is meant to be open source under MIT but had no license file, so the license was legally unenforceable. Co-Authored-By: Claude Fable 5 --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d2758aa --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024-2026 Muawiya Amir and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 502d7ae48ef78b4a5f18f9edce2408e1bdc8e456 Mon Sep 17 00:00:00 2001 From: Muawiya Amir Date: Sun, 30 Aug 2026 23:50:42 +0500 Subject: [PATCH 02/13] Rewrite root README: accurate, concise, human-toned The old README still described the repo as NFC-Projects, listed folders that no longer exist (PhoneBook-HashTable), omitted most of the actual projects, and pointed the clone URL at the wrong repo. Replaced it with a short accurate project index, correct clone URL, a license section, and a note that AI assistance was used. Co-Authored-By: Claude Fable 5 --- README.md | 108 +++++++++++++----------------------------------------- 1 file changed, 26 insertions(+), 82 deletions(-) diff --git a/README.md b/README.md index 735c4e0..45edc88 100644 --- a/README.md +++ b/README.md @@ -1,94 +1,38 @@ -# NFC Projects — BS Artificial Intelligence Journey +# BSAI Projects -This repository contains my semester-wise projects from my BS in Artificial Intelligence -at **NFC Institute of Engineering & Technology (NFC IET), Multan** (2024–2028). +Semester-wise projects from my BS in Artificial Intelligence at NFC Institute of +Engineering & Technology (NFC IET), Multan — 2024 to 2028. Some were built solo, +some with classmates (credited in each project's README). Parts of the code and +documentation were written with AI assistance. -It serves as a structured record of all projects completed throughout my degree, -reflecting my learning progress, problem-solving approach, and practical application -of core Computer Science and AI concepts. +## Projects ---- +| Project | What it is | +| --- | --- | +| [SearchEngine](SearchEngine/) | Mini search engine with an inverted index and stack-based history (DSA lab) | +| [Smart-Home-Simulator-](Smart-Home-Simulator-/) | Phone-as-flashlight smart home simulator in Python/Flask (OOP lab) | +| [Stocks Trend Analyzer](Stocks%20Trend%20Analyzer/) | Stock trend analysis with data structures (DSA lab) | +| [ai_academic_fixed](ai_academic_fixed/) | AcadAI — GPA prediction, weak-subject detection, and career guidance desktop app | +| [msms](msms/) | Medical Store Management System — React + Express + MySQL (Database lab) | +| [CloudKernel](CloudKernel/) | Java concurrency simulator visualizing VM scheduling and synchronization | +| [CodingMoves-RCPlus](CodingMoves-RCPlus/) | WiFi-controlled RC car on NodeMCU (ESP8266) | +| [IoT_IDS](IoT_IDS/) | Intrusion detection system for IoT traffic (Information Security) | +| [ResQTemp](ResQTemp/) | Temperature and rescue alert system in assembly (COAL) | +| [SFS](SFS/) | Secure File System — Django REST backend with JWT auth | -## Repository Structure +Each folder has its own README with setup and run instructions. -```txt -NFC-Projects/ -│ -├── PhoneBook-HashTable/ -│ └── README.md -│ -├── SearchEngine/ -│ └── README.md -│ -├── .github/ -│ └── workflows/ -│ └── syntax-check.yml -│ -└── README.md ← (this file) -``` - ---- - -## Purpose - -This repository exists to: - -- Keep all university projects organized in one place -- Document my growth as an AI and software developer semester by semester -- Collaborate with classmates and share knowledge openly -- Gradually build a portfolio that reflects real, hands-on work - ---- - -## Projects Overview - -Each project lives in its own folder with a dedicated `README.md` that covers: - -- The semester and course it belongs to -- The core concept or data structure being demonstrated -- Features implemented and technologies used -- Instructions to run the project locally - -Some projects were built independently. Others were developed in collaboration -with fellow students, and credit is given where applicable. - ---- - -## Getting Started - -Clone the repository to your local machine: - -```bash -git clone https://github.com/Muawiya-contact/NFC-Projects.git -cd NFC-Projects -``` - -Then navigate into any project folder and follow its README. For example: +## Getting started ```bash -cd SearchEngine -python main.py +git clone https://github.com/Coding-Moves/BSAI-Projects.git +cd BSAI-Projects ``` ---- - -## Continuous Integration - -This repository uses a GitHub Actions workflow (`.github/workflows/syntax-check.yml`) -to automatically check Python syntax on every push, keeping the codebase clean -and error-free from the start. - ---- - -## Progress & Roadmap 🌱 - -This repository is actively maintained and will grow each semester as new projects -are added. Topics will expand from foundational data structures into machine learning, -deep learning, NLP, and beyond as the degree progresses. +Then follow the README inside the project you want to run. ---- +A GitHub Actions workflow checks Python syntax on every push and pull request. -## Contact +## License -For questions, feedback, or collaboration opportunities, feel free to reach out -via [GitHub](https://github.com/Muawiya-contact). +MIT — see [LICENSE](LICENSE). From c12395a310118e220d922414a02d07c2a68fb1c8 Mon Sep 17 00:00:00 2001 From: Muawiya Amir Date: Sun, 30 Aug 2026 23:50:42 +0500 Subject: [PATCH 03/13] CI: run syntax check on push, update actions, drop EOL Pythons The workflow only triggered on pull requests while the README said it runs on every push; added the push trigger. Bumped checkout to v4 and setup-python to v5, and dropped end-of-life Python 3.8/3.9 from the matrix. Co-Authored-By: Claude Fable 5 --- .github/workflows/syntax-check.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/syntax-check.yml b/.github/workflows/syntax-check.yml index 9c53551..d40f137 100644 --- a/.github/workflows/syntax-check.yml +++ b/.github/workflows/syntax-check.yml @@ -1,21 +1,24 @@ name: Python Syntax Check on: + push: + branches: + - main pull_request: branches: - - main # default branch + - main jobs: syntax-check: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.10', '3.11', '3.12'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} From 8773539b365d627c1166ff9bf9ef3666772b853c Mon Sep 17 00:00:00 2001 From: Muawiya Amir Date: Sun, 30 Aug 2026 23:52:41 +0500 Subject: [PATCH 04/13] SearchEngine: trim README to plain prose, fix stale claims Cut from 145 to ~50 lines. Fixed inaccuracies: GPT answers are saved to numbered gpt_N.txt files (not a single gpt.txt), all query words must match, and an API key is required at startup. Dropped the emoji checkmark walls, the long example session, and the future-work list. Co-Authored-By: Claude Fable 5 --- SearchEngine/README.md | 167 +++++++++-------------------------------- 1 file changed, 36 insertions(+), 131 deletions(-) diff --git a/SearchEngine/README.md b/SearchEngine/README.md index 7bf95f4..fc3cd7a 100644 --- a/SearchEngine/README.md +++ b/SearchEngine/README.md @@ -1,146 +1,51 @@ -# 🔍 Mini Search Engine with Stack +# Mini Search Engine with Stack -A **Mini Search Engine project** developed as part of my **2nd Semester DSA Lab Project (BS AI, NFC IET Multan)**. -It demonstrates **core Data Structures and Algorithms (DSA)** concepts such as: -- **Stack** (for search history navigation) -- **Inverted Index / Hash Map** (for efficient keyword-based searching) -- **String processing & searching algorithms** -- **GPT Integration** → fallback when no local documents match +A command-line search engine over local text files, built as a 2nd semester +DSA lab project (BS AI, NFC IET Multan). It uses an inverted index (hash map) +for keyword search, two stacks for browser-style undo/redo of queries, and +falls back to OpenAI GPT-3.5-turbo when no local document matches. ---- +## How it works -## ✨ Features -- ✅ **Keyword-based Search** → finds documents containing query terms -- ✅ **Ranked Results** → based on frequency of query terms -- ✅ **Search History (UNDO)** → supports `back` command just like a browser -- ✅ **Search History (REDO)** → supports `next` command just like a browser -- ✅ **Document Viewer** → open `.txt` files directly from search results -- ✅ **Automatic Crawler** → indexes all `.txt` files in the `documents/` folder -- ✅ **GPT Fallback** → uses OpenAI GPT-3.5-Turbo when no local results found, saves responses in `gpt_docs/gpt.txt` -- ✅ **Clean modular structure** for GitHub +- On startup, every `.txt` file in `documents/` is indexed into an inverted + index mapping `word -> {document: frequency}` (lowercased, punctuation + stripped). +- A query matches documents containing all of its words; results are ranked + by the summed frequency of the query words. +- Each query is pushed onto a history stack. `back` pops it to return to the + previous query (undo), `next` redoes an undone one, and `show` prints the + history stack. A new search clears the redo stack. +- If nothing matches locally, the query is sent to GPT-3.5-turbo. The answer + is saved as `gpt_docs/gpt_N.txt`, added to the index, and shown as a result. +- After each search you can type a result number to print the file's contents, + or `continue` to keep searching. `quit` exits. ---- +## Files -## 🗂️ Project Structure -```txt -Mini-Search-Engine/ -│ -├── stack.py # Stack implementation (push, pop, peek, empty) -├── index.py # Inverted Index implementation -├── search.py # Search Engine logic + GPT integration -├── main.py # Entry point for running the project -│ -├── documents/ # Folder containing sample text files -│ ├── doc1.txt -│ ├── doc2.txt -│ └── ... -│ -├── gpt_docs/ # Folder storing GPT responses -│ └── gpt.txt -│ -├── .env # Stores OPENAI_API_KEY -├── requirements.txt # Required Python packages -└── README.md # Project documentation -``` -### ⚡ How It Works - -+ The program scans the `documents/` folder and builds an inverted index. - -+ When the user searches, queries are cleaned (lowercased, punctuation removed, split into words). - -+ Matching documents are ranked by query word frequency. +- `main.py` - entry point +- `search.py` - search loop, undo/redo, GPT fallback +- `index.py` - inverted index (add, clean, search, rank) +- `stack.py` - list-based stack (push, pop, peek, show) +- `documents/` - sample text files to index +- `gpt_docs/` - saved GPT answers (`gpt_1.txt`, `gpt_2.txt`, ...) -+ The query is pushed onto the Stack (history). +## Running -+ If the user types `back`, the last query is popped and the previous one is shown again. +Requires Python 3.12+ and an OpenAI API key. -+ If no local document matches, the engine calls GPT, saves the result in `gpt_docs/gpt.txt`, indexes it, and shows it. - -+ Users can open a result to see the full content of the file. - -## ▶️ Usage - -1. Go to base Dir: -```batch -cd SearchEngine ``` -2. Run -```batch +cd SearchEngine +pip install -r requirements.txt +echo "OPENAI_API_KEY=sk-..." > .env python main.py ``` -***Example Session:*** -```py -Loading index... -Index built with 5 documents. - -Enter search query, 'back','next', 'show', or 'quit': ai -[Stack] Pushed: ai - -Searching for: 'ai' -Found 1 document(s): -1. doc5.txt | Score: 2 - -Enter document number to open, or 'continue': continue - -Enter search query, 'back','next', 'show', or 'quit': cs -[Stack] Pushed: cs - -Searching for: 'cs' -No matches found in local documents. Using ChatGPT... ---- GPT Answer --- -CS is the study of computers and computational systems... ------------------- -1. gpt.txt | Score: 1 - -Enter document number to open, or 'continue': 1 ---- gpt.txt --- -CS is the study of computers and computational systems... ------------------- - -Enter search query, 'back','next', 'show', or 'quit': back -[Stack] Popped: cs -[Stack] Pushed: cs - -Back to: 'ai' -1. doc5.txt | Score: 2 - -Enter search query, 'back','next', 'show', or 'quit': next -Redo: 'cs' -1. gpt.txt | Score: 1 - -Enter document number to open, or 'continue': continue -Enter search query, 'back','next', 'show', or 'quit': quit -Goodbye! -``` - -## 🏫 Academic Info - -📖 Course: Data Structures & Algorithms (DSA) - -🎓 Semester: 2nd Semester, BS Artificial Intelligence - -🏛️ University: NFC IET Multan - -👨‍💻 Student: Muawiya Amir - ---- -## 👥 Team Members - -👨‍💻 Muawiya (Team Leader) - -👨‍💻 M. Umar - ---- - -## 🚀 Future Improvements - -> Add synonym & fuzzy matching for queries - -> Implement OR / NOT search operators +The key is required even for local-only searches, since it is loaded at +startup. -> Enhance ranking with TF-IDF instead of simple counts +## Credits -> Build a GUI or Web-based interface +Course: Data Structures & Algorithms, 2nd Semester, BS Artificial +Intelligence, NFC IET Multan. -> Maintain multiple GPT files (gpt_1.txt, gpt_2.txt, ...) to fully integrate undo/redo \ No newline at end of file +Team: Muawiya Amir (team leader), M. Umar. From 0046769d7f8f10896405d87a8dd3a9964009c885 Mon Sep 17 00:00:00 2001 From: Muawiya Amir Date: Sun, 30 Aug 2026 23:52:41 +0500 Subject: [PATCH 05/13] Smart-Home-Simulator: trim README to plain prose Cut from 159 to ~53 lines, verified against controller.py and smart_light_server.py. Kept the description, setup commands, demo link, and course/author credits; dropped the emoji-heavy marketing tone. Co-Authored-By: Claude Fable 5 --- Smart-Home-Simulator-/README.md | 163 ++++++-------------------------- 1 file changed, 31 insertions(+), 132 deletions(-) diff --git a/Smart-Home-Simulator-/README.md b/Smart-Home-Simulator-/README.md index 69d919d..f92a36a 100644 --- a/Smart-Home-Simulator-/README.md +++ b/Smart-Home-Simulator-/README.md @@ -1,158 +1,57 @@ -# 🏠 Smart Home Simulator 🔦 | Powered by Python OOP + Flask + IoT +# Smart Home Simulator -Welcome to the **Smart Home Simulator** — a creative and fully functional IoT-based project where your **smartphone** acts as a **Smart Flashlight** (Light Device), and your **laptop** acts as the **Controller**! Built entirely using **Python**, **Flask**, and **Object-Oriented Programming (OOP)** concepts. No extra hardware required! 💻📱 +A small IoT demo built with Python, Flask, and OOP. An Android phone acts as a +smart light: a Flask server running in Termux exposes a `/flash` endpoint and +toggles the phone's actual torch through `termux-torch`. A laptop acts as the +controller, sending HTTP POST requests over the local Wi-Fi network to turn the +light on, off, or make it blink. No extra hardware is needed. -**Course:** Object-Oriented Programming (OOP) -**Semester:** 2rd -**Submitted To:** Prof. Khalid Mehmood Khan -**Submitted By:** -- *Moavia Amir* (2k24_BSAI_72) -- *Muhammad Dawood* (2k24_BSAI_48) ---- -[![Watch Demo](thumbnail.jpg)](https://www.linkedin.com/posts/contactmuawia_python-oop-iot-activity-7317201126267777024-MT_F?utm_source=share&utm_medium=member_desktop&rcm=ACoAAE83puMB2usKBg0a3tbcCz_4_33IjoRwOfw) -## 💡 Project Highlights +[Video demo on LinkedIn](https://www.linkedin.com/posts/contactmuawia_python-oop-iot-activity-7317201126267777024-MT_F?utm_source=share&utm_medium=member_desktop&rcm=ACoAAE83puMB2usKBg0a3tbcCz_4_33IjoRwOfw) -- ✅ Fully **Object-Oriented** Python structure -- ✅ Real-time **client-server communication** via HTTP -- ✅ Turns ON/OFF simulated Smart Flashlight remotely -- ✅ Uses only a **laptop & phone** to simulate real-world IoT -- ✅ Manual IP input = 🔌 easily connect to any smart device on same network -- ✅ Bonus: 🔁 Blink effect included! -- ✅ Future-ready: Easily expandable to other smart home devices +## How it works ---- +- `smart_light_server.py` runs on the phone. A `SmartFlashlight` class holds + the light state and calls `termux-torch on/off`; a `FlashController` class + maps incoming actions to it. Flask serves `POST /flash` on port 5000 and + returns the resulting state as JSON. +- `controller.py` runs on the laptop. It asks for the phone's IP address, then + shows a menu (Flash ON, Flash OFF, Blink, Exit) and sends the corresponding + `{"action": "on"|"off"}` requests. Blink alternates on/off with a short delay. -## ⚙️ Technologies Used +Both devices must be on the same network. -- 🐍 Python 3 -- 🌐 Flask (REST API) -- 📡 Wi-Fi LAN (Local Network Communication) -- 🧠 Object-Oriented Programming (OOP) -- 📱 Termux (on Android for server) - ---- - -## 🧱 Project Structure +## Files ``` -smart-home-simulator/ -│ -├── controller.py # 💻 Laptop - sends commands to the smart light -├── smart_light_server.py # 📱 Phone - handles light states via Flask -├── README.md # 📘 You're here! +controller.py # laptop client with the menu +smart_light_server.py # phone-side Flask server (Termux) ``` -# 🚀 How It Works -Think of this like a real-world smart home controller, but using basic devices and Python logic. - -## 🔁 Communication Flow: -Run smart_light_server.py on your friend’s phone (Android + Termux + Flask) - -Run controller.py on your laptop - -Enter the phone’s IP address in your controller -Control light via options: +## Running it - 1️⃣ Flash ON +On the phone (server), install Termux from F-Droid, then: - 2️⃣ Flash OFF - - 3️⃣ Blink - -Flash is simulated as a virtual smart light using OOP - -# 🔧 Setup Instructions -## 📱 On Phone (Server): -1. Install Termux from F-Droid - -2. Run these commands in Termux: -``` +``` pkg update pkg install python pip install flask termux-api termux-setup-storage -``` -3. Run the smart light server: -``` python smart_light_server.py ``` -# 💻 On Laptop (Client): -1. Install Flask & Requests: + +On the laptop (client): + ``` pip install flask requests -``` -2. Run the controller: -``` python controller.py ``` -3. Enter IP of the phone when prompted - -# 🎮 Sample Controller Menu -``` -Select the action: -1. Flash ON -2. Flash OFF -3. Blink -4. Exit -``` -# 👨‍💻 Code Sample (Flashlight Class) -```python -class SmartFlashlight: - def __init__(self): - self.state = "off" - - def turn_on(self): - self.state = "on" - return "Smart Flashlight is ON" - - def turn_off(self): - self.state = "off" - return "Smart Flashlight is OFF" - - def get_state(self): - return self.state -``` -# 🛠️ Future Improvements -- 📡 Auto IP detection & device scanning - -- 📱 Mobile-friendly web GUI - -- 📲 Integrate with real flashlight or LED (via GPIO/Arduino) - -- 📈 Analytics & dashboard for smart home actions - -- 🌍 Control multiple devices (Fan, AC, etc.) - -# 🧠 What We Learned -- Real-world implementation of OOP in Python - -- Building REST APIs with Flask - -- Local network-based IoT simulation - -- Client-server architecture - -- Collaboration and modular design in code - -# 🙋 Author -👨‍💻 Muawiya — @Coding_Moves - -# 🌟 Show Your Support -If you found this project inspiring: - -+ ⭐ Star this repo - -+ 📢 Share with friends - -+ 📽️ Watch the video demo on YouTube - -+ 🔗 Post it on LinkedIn with us! - - - - - +Enter the phone's IP address when prompted, then pick an action from the menu. +## Credits +Course: Object-Oriented Programming (OOP), 2nd semester +Submitted to: Prof. Khalid Mehmood Khan +Submitted by: Moavia Amir (2k24_BSAI_72) and Muhammad Dawood (2k24_BSAI_48) +Author: Muawiya — [Coding_Moves on YouTube](https://www.youtube.com/@Coding_Moves) From 9d2489df2496d00822f12a97ac1f0413de185a21 Mon Sep 17 00:00:00 2001 From: Muawiya Amir Date: Sun, 30 Aug 2026 23:52:41 +0500 Subject: [PATCH 06/13] Stocks Trend Analyzer: trim README, fix layout and deps Cut from 155 to ~51 lines. Fixed the wrong folder layout and added the missing customtkinter dependency (verified against main.py's actual imports). Kept per-module explanation and team credits. Co-Authored-By: Claude Fable 5 --- Stocks Trend Analyzer/README.md | 191 ++++++++------------------------ 1 file changed, 44 insertions(+), 147 deletions(-) diff --git a/Stocks Trend Analyzer/README.md b/Stocks Trend Analyzer/README.md index 9190bc6..2836437 100644 --- a/Stocks Trend Analyzer/README.md +++ b/Stocks Trend Analyzer/README.md @@ -1,154 +1,51 @@ -# 📈 Stocks Trend Analyzer (Data Structures Project) - -**Course:** Data Structures & Algorithms (DSA) -**Semester:** 3rd -**Submitted To:** Sir Hasnain Yousaf Khan -**Submitted By:** - -- 🧠 *Shazada M. Umar* (2k24_BSAI_42) -- 🧠 *Moavia Amir* (2k24_BSAI_72) — contactmuawia@gmail.com -- ⚙️ *Faizan Ishfaq* (2k24_BSAI_50) -- ⚙️ *M. Hamza* (2k24_BSAI_46) - ---- - -## 📘 Project Overview - -**Stocks Trend Analyzer** is a Python-based application that analyzes historical stock market data using **Data Structures and Algorithms**. -The system detects rising/falling patterns, computes moving averages, highlights buy–sell intervals, and visualizes trends using **Tkinter** and **Matplotlib**. - -The goal is to help students understand how DSA concepts apply to real-world financial time-series data. - ---- - -## 🔍 Problem Statement - -Financial datasets are large, noisy, and difficult for beginners to interpret. Without proper analysis, it becomes challenging to identify: - -- Continuous rising or falling trends -- Local highs and lows -- Smoothed patterns (moving averages) -- Optimal moments to buy or sell - -This project provides a simple and visual solution using efficient algorithms and Python-based tools. - ---- - -## 🎯 Objectives - -- Build a working desktop tool to analyze stock time-series data -- Implement DSA concepts such as arrays, queues, stacks, and maps -- Detect trends and compute moving averages -- Identify the best buy–sell intervals using an O(n) algorithm -- Visualize insights using charts -- Create a user-friendly GUI for easy interaction - ---- - -## 🧠 System Overview - -| Component | Purpose | -|----------|----------| -| **Python (Core)** | Implements algorithms and data structures | -| **Tkinter** | GUI for importing and analyzing data | -| **Matplotlib** | Visualization of trends and signals | -| **CSV Dataset** | Yahoo Finance or Kaggle stock data | -| **DSA Used** | Arrays, Lists, Stacks, Queues, Maps | - ---- - -## 🔬 Working Principle - -1. User loads a CSV file containing daily stock prices. -2. Data is stored in custom **Array/List** structures. -3. Algorithms run on the dataset: - - Trend detection - - Moving average calculation (Queue / Sliding Window) - - Local high/low using Stack logic - - Max-profit interval (Buy–Sell Strategy) -4. Tkinter displays results and summary. -5. Matplotlib generates charts with lines, markers, and trends. - ---- - -## 🛠 Features - -- 📊 **Trend Detection:** Identifies rising/falling streaks -- 📉 **Moving Averages:** Smooths noisy data using queue-based windows -- 💹 **Best Buy–Sell Interval:** Shows most profitable days -- 📈 **Visual Charts:** Price lines, moving averages, highs/lows -- 🖥 **User-Friendly GUI:** Import CSV and analyze instantly -- 🧠 **DSA-Focused Implementation:** Each module uses required structures - ---- - -## 🛠 Technologies & Tools - -- Python -- Tkinter (GUI) -- Matplotlib (Visualization) -- Custom Data Structures -- CSV Data (Stock Prices) - ---- - -## 📂 Folder Structure +# Stocks Trend Analyzer + +A desktop tool for analyzing historical stock prices, built as a 3rd-semester +Data Structures & Algorithms project. You load a CSV of daily prices and the +app detects rising/falling streaks, computes a moving average, finds local +highs and lows, and picks the best single buy–sell interval, all plotted on a +Matplotlib chart embedded in a CustomTkinter GUI. The point of the project is +to back each analysis step with a hand-written data structure rather than +library shortcuts. + +## How it works + +- `dsa/` contains the custom structures: `ArrayList` (price/date storage), + `Queue` (keeps a running sum for O(1) sliding-window averages), and `Stack`. +- `algorithms/trend_analysis.py` scans consecutive closes to track + rising/falling streaks. +- `algorithms/moving_average.py` computes an N-day moving average with the + queue as a sliding window. +- `algorithms/max_profit.py` finds the most profitable buy/sell days with a + single O(n) pass (classic best-time-to-buy-and-sell). +- `algorithms/local_high_low.py` marks local highs and lows by comparing each + point with its neighbors. +- `main.py` ties it together: load a CSV, set the moving-average window, + click "Analyze Trends" to draw the chart (price line, MA line, buy/sell + markers, high/low points), and "Save Chart" to write a PNG into `charts/`. + +## Running it + +Requires Python 3 with `customtkinter` and `matplotlib` installed +(`tkinter` ships with Python): ``` -Stocks-Trend-Analyzer/ -├─ README.md # (this file) -├─ main.py # Tkinter GUI -├─ algorithms/ -│ ├─ trend_analysis.py -│ ├─ moving_average.py -│ ├─ max_profit.py -│ └─ local_high_low.py -├─ dsa/ -│ ├─ array_list.py -│ ├─ queue.py -│ └─ stack.py -├─ data/ -│ └─ sample_stock.csv -├─ charts/ -│ └─ generated_charts.png -└─ docs/ - ├─ Proposal.pdf - └─ Report.pdf +pip install customtkinter matplotlib +python main.py ``` ---- - -## 📅 Project Timeline (6 Weeks) - -| Week | Task | -|------|------| -| Week 1 | Requirement analysis, dataset collection | -| Week 2 | Implement data structures | -| Week 3 | Implement algorithms | -| Week 4 | Develop Tkinter GUI | -| Week 5 | Add Matplotlib charts | -| Week 6 | Testing, debugging, documentation | - - - ---- - -## 🎓 Expected Learning Outcomes - -- Understand and apply DSA to financial datasets -- Learn how queues, stacks, and arrays operate in practical use-cases -- Gain experience with GUI development -- Learn data visualization techniques -- Strengthen algorithmic thinking and problem-solving - ---- - -## 🧾 Conclusion -The **Stocks Trend Analyzer** blends algorithms, data structures, and visualization to provide meaningful insights into stock behavior. -This project demonstrates the power of DSA in solving real-world problems and sets a foundation for advanced financial analytics, predictive modeling, and multi-stock comparison systems. +The CSV needs `Date` and `Close` columns. Sample datasets are in `data/` +(`sample_stock01.csv` through `sample_stock04.csv` and `bitcoin.csv`), and +`data/random_csv_genrator.py` can generate more. The project proposal and +report PDFs are in `doc/`. ---- +## Credits -## 📫 Contact +Course: Data Structures & Algorithms (DSA), 3rd semester +Submitted to: Sir Hasnain Yousaf Khan -- **Moavia Amir** — contactmuawia@gmail.com +Team: +- Shazada M. Umar (2k24_BSAI_42) +- Moavia Amir (2k24_BSAI_72) — contactmuawia@gmail.com +- Faizan Ishfaq (2k24_BSAI_50) +- M. Hamza (2k24_BSAI_46) From 3b278f31c09bc7644921db0df434b75104d378cc Mon Sep 17 00:00:00 2001 From: Muawiya Amir Date: Sun, 30 Aug 2026 23:52:41 +0500 Subject: [PATCH 07/13] AcadAI: trim README, correct model and dataset facts Cut from 105 to ~44 lines. Corrected the model description (Random Forest + Linear Regression, not Ridge), the generated dataset size (30 students, not 60), and removed the unverifiable ~91% accuracy claim and a placeholder clone URL. Co-Authored-By: Claude Fable 5 --- ai_academic_fixed/README.md | 131 ++++++++++-------------------------- 1 file changed, 35 insertions(+), 96 deletions(-) diff --git a/ai_academic_fixed/README.md b/ai_academic_fixed/README.md index 3bc2cce..899fe38 100644 --- a/ai_academic_fixed/README.md +++ b/ai_academic_fixed/README.md @@ -1,105 +1,44 @@ -# AcadAI — AI Academic Performance Prediction & Career Guidance System - -**A professional AI-powered desktop application that predicts student GPA, detects weak subjects, recommends careers, and generates personalized study plans — built as a 4th Semester BSAI Project.** - ---- - -## Project Info - -**Subject:** Artificial Intelligence -**Semester:** 4th -**Submitted To:** [Dr. Muhammad Siddique](mailto:msiddique@nfciet.edu.pk) - -**Members:** - -- [Faizan Ishfaq](https://github.com/faizanrajpoot774-debug) -- [Muawiya Amir](https://github.com/Muawiya-contact) - ---- - -## Overview - -**AcadAI** is an intelligent academic analytics platform built for university students. It uses Machine Learning to predict future GPA, detect at-risk students, recommend career paths based on academic profile, and generate AI-powered study plans — all inside a clean, professional desktop GUI. - -Built with Python · PyQt5 · scikit-learn · SQLite · Matplotlib - ---- - -## Features - -| Feature | Description | -| ---------------------- | ------------------------------------------------------------------------------------- | -| GPA Prediction | Random Forest + Ridge Regression model predicts next semester GPA with ~91% accuracy | -| Weak Subject Detection | ML model identifies subjects needing attention and suggests improvement strategies | -| Career Recommendation | Matches student profile (GPA + skills + interests) to best-fit career paths | -| Skill Roadmap | Personalized step-by-step learning roadmap for chosen career goal | -| Study Planner | Generates weekly study schedules prioritizing weak subjects | -| AI Chatbot 🤖 | NLP-based academic assistant that reads live database and answers student queries | -| Analytics Dashboard | Interactive charts: GPA trends, subject radar, risk distribution, attendance analysis | -| Student Management | Add, edit, import students via CSV — full CRUD with SQLite backend | -| CSV Import/Export | Bulk import 60+ students from CSV; export reports | - ---- - -## Installation - -### Prerequisites - -Make sure you have **Python 3.10+** installed: - -```bash -python --version -``` - -### Step 1 — Clone the Repository - -```bash -git clone https://github.com/your-username/acadai.git -cd acadAI -``` - -### Step 2 — Install Dependencies +# AcadAI — Academic Performance Prediction & Career Guidance + +AcadAI is a desktop application for tracking university students' academic +performance. It predicts next-semester GPA with a machine learning model, +flags weak subjects and at-risk students, suggests career paths based on a +student's GPA, skills, and interests, and builds weekly study plans. It also +includes a rule-based chatbot that answers questions from the live student +database, and an analytics dashboard with GPA trends, subject radar, and risk +distribution charts. Built with Python, PyQt5, scikit-learn, SQLite, and +Matplotlib. + +## How it works + +- Student records (semester GPAs, subject marks, attendance, study hours, + skills, interests) live in a SQLite database (`database/academic.db`), + with CSV import/export for bulk entry. +- On first launch, `main.py` trains a GPA model (Random Forest regressor, + with a Linear Regression baseline) on `datasets/student_data.csv` and + saves it to `models/gpa_model.pkl`. Later runs reuse the saved model. +- The PyQt5 GUI (`ui/`) has pages for student management, dashboard, + analytics, career recommendations, skill roadmaps, study planning, and + the chatbot. Career matching and study plans are generated by the + `recommender/` module; charts come from `analytics/` via Matplotlib. + +## How to run + +Requires Python 3.10+. ```bash pip install -r requirements.txt -``` - -### Step 3 — Generate Sample Dataset (First Time Only) - -```bash -python generate_dataset.py -``` - -This creates `datasets/student_data.csv` with 60 realistic student records. - -### Step 4 — Run the Application - -```bash +python generate_dataset.py # first time only: creates datasets/student_data.csv (30 sample students) python main.py ``` ---- - -## Requirements - -```batch -PyQt5>=5.15.0 -matplotlib>=3.7.0 -scikit-learn>=1.3.0 -pandas>=2.0.0 -numpy>=1.24.0 -``` - -Install all at once: +Dependencies: PyQt5, matplotlib, scikit-learn, pandas, numpy, joblib. -```bash -pip install PyQt5 matplotlib scikit-learn pandas numpy -``` +## Credits ---- +4th Semester BSAI project — Artificial Intelligence course. +Submitted to Dr. Muhammad Siddique (msiddique@nfciet.edu.pk). -## Project Structure - -```txt -AcadAI/ -``` +Team: +- Faizan Ishfaq (https://github.com/faizanrajpoot774-debug) +- Muawiya Amir (https://github.com/Muawiya-contact) From 66bcf23fa9371c97238beb7ca2b455cbcd1b4cea Mon Sep 17 00:00:00 2001 From: Muawiya Amir Date: Sun, 30 Aug 2026 23:52:41 +0500 Subject: [PATCH 08/13] MSMS: trim README from 340 to ~73 lines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Kept accurate setup, database import order, run instructions, ports, and default login. Cut the full project tree dump, API endpoint tables, 12-table schema table, and screenshots placeholder — detail that belongs in the code and docs/ folder, not the README. Co-Authored-By: Claude Fable 5 --- msms/README.md | 345 ++++++------------------------------------------- 1 file changed, 40 insertions(+), 305 deletions(-) diff --git a/msms/README.md b/msms/README.md index 4b64bea..d8f35d7 100644 --- a/msms/README.md +++ b/msms/README.md @@ -1,155 +1,46 @@ -# 🏥 Medical Store Management System (MSMS) +# Medical Store Management System (MSMS) -> **Student:** Muawiya Amir | **ID:** 2k24_BSAI_72 -> **Course:** Database Lab — 4th Semester BS Artificial Intelligence -> **Instructor:** Sir Ahsan Ahmed +A full-stack pharmacy management app built for the Database Lab course. It covers +day-to-day medical store operations: medicine inventory with batch and expiry +tracking, a point-of-sale screen with prescription validation, and management of +customers, suppliers, doctors, employees, and payments. The database does much of +the heavy lifting — 12 normalized tables (3NF) plus auxiliary tables, 4 triggers +(stock deduction, low-stock alerts, order total recalculation, expiry checks), +4 stored procedures (GenerateBill, RestockMedicine, PlaceOrder, CompletePayment), +7 reporting views, and indexes on frequent query columns. ---- +Other features: JWT authentication with role-based access (Admin / Manager / +Pharmacist / Cashier), a reports page with a sales chart and CSV export, printable +invoices with A5 PDF download, dark mode, and low-stock / expiry alerts on the +dashboard. -## 🚦 How to Run (Quick Start) +Tech stack: React 18 + Vite + TailwindCSS + Recharts frontend, Node.js/Express 4 +backend with mysql2, MySQL 8.0, JWT + bcryptjs auth, react-hook-form + Zod, +jsPDF + html2canvas for bills. -1. **Install dependencies** - Open two terminals and run: - - In `backend` folder: - `npm install` - - In `frontend` folder: - `npm install` +## Prerequisites -2. **Set up environment** - - Copy `backend/.env.example` to `backend/.env` and fill in your MySQL info. +- Node.js v18+ and npm v9+ +- MySQL 8.0 running locally -3. **Set up the database** - - Import all SQL files in `database/` into your MySQL server (see detailed steps below). - -4. **Start the servers** - - In `backend`: - `npm start` - - In `frontend`: - `npm run dev` - -5. **Open the app** - - Frontend: [http://localhost:5173](http://localhost:5173) - - Backend API: [http://localhost:5000](http://localhost:5000) - ---- - -## ✨ Features - -### Core Modules - -- **Inventory Management** — Add, edit, search medicines with dosage form, strength, price, and prescription flag -- **Point of Sale (POS)** — Real-time cart, customer lookup, prescription validation, live total calculation -- **Prescription Tracking** — Link doctor prescriptions to customers; enforce Rx-only sales -- **Supplier Management** — Track suppliers with ratings and contact details -- **Customer Management** — Profiles with purchase history and total spending -- **Employee Management** — Role-based accounts (Admin / Manager / Pharmacist / Cashier) -- **Payment Processing** — Cash, Card, Online, Insurance; full transaction log -- **Reports & Analytics** — Low stock, expiry alerts, sales summary with charts, top-selling medicines - -### Database Features - -- 12 normalized tables (3NF) -- 4 Triggers (stock deduction, low-stock alert, order total recalc, expiry check) -- 4 Stored Procedures (GenerateBill, RestockMedicine, PlaceOrder, CompletePayment) -- 7 Views (LowStockAlert, ExpiringSoon, SalesSummary, TopSellingMedicines, EmployeePerformance, SupplierRatings, FullInventory) -- Indexes on high-frequency query columns - -### UI/UX Extras - -- 🌙 Dark mode (persisted in localStorage) -- 🖨️ Printable invoices (`window.print()` hides sidebar/navbar) -- 📥 PDF bill download (A5 size via jsPDF + html2canvas) -- 📊 Sales bar chart (Recharts) -- 📤 Export to CSV on every report tab -- 🔔 Toast notifications for all actions -- 🔴 Red dot badge on sidebar when medicines expire within 7 days -- ⚠️ Low-stock banner on dashboard -- JWT authentication with role-based route protection - ---- - -## 🛠 Tech Stack - -| Layer | Technology | -| -------- | ------------------------------------- | -| Frontend | React 18, Vite, TailwindCSS, Recharts | -| Backend | Node.js, Express 4, mysql2 | -| Database | MySQL 8.0 | -| Auth | JWT (jsonwebtoken) + bcryptjs | -| Forms | react-hook-form + Zod validation | -| PDF | jsPDF + html2canvas | - ---- - -## 📋 Prerequisites - -- **Node.js** v18 or higher -- **npm** v9 or higher -- **MySQL 8.0** running locally - ---- - -## 🚀 Installation & Setup - -### 1. Clone the repository - -```bash -git clone "https://github.com/Coding-Moves/BSAI-Projects.git" -cd msms -``` - -### 2. Install all dependencies +## Setup ```bash -npm run install:all +git clone https://github.com/Coding-Moves/BSAI-Projects.git +cd BSAI-Projects/msms +npm run install:all # installs root, backend, and frontend packages ``` -This installs root, backend, and frontend packages in one command. - -### 3. Configure backend environment +Configure the backend environment: ```bash cd backend -cp .env.example .env -``` - -Open `.env` and fill in your MySQL credentials: - +cp .env.example .env # then fill in your MySQL credentials ``` -DB_HOST=localhost -DB_PORT=3306 -DB_USER=root -DB_PASSWORD=your_mysql_password -DB_NAME=msms_db -JWT_SECRET=change_this_to_a_random_secret -PORT=5000 -``` - -### 4. Set up the MySQL database - -Open **MySQL Workbench** (or any MySQL client) and run the SQL files **in this exact order**: - -```sql --- Step 1: Create tables -SOURCE /path/to/msms/database/schema.sql; - --- Step 2: Insert sample data -SOURCE /path/to/msms/database/sample_data.sql; - --- Step 3: Create triggers -SOURCE /path/to/msms/database/triggers.sql; --- Step 4: Create stored procedures -SOURCE /path/to/msms/database/stored_procedures.sql; +## Database setup --- Step 5: Create views -SOURCE /path/to/msms/database/views.sql; - --- Step 6: Create indexes -SOURCE /path/to/msms/database/indexes.sql; -``` - -Or run them from the command line: +Run the SQL files in `database/` against your MySQL server in this order: ```bash mysql -u root -p < database/schema.sql @@ -160,181 +51,25 @@ mysql -u root -p msms_db < database/views.sql mysql -u root -p msms_db < database/indexes.sql ``` -### 5. Start the application - -```bash -cd .. -npm run dev -``` - -This runs both frontend and backend concurrently: - -- **Backend API:** http://localhost:5000 -- **Frontend:** http://localhost:5173 +(You can also `SOURCE` them from MySQL Workbench in the same order.) ---- +## Run -## 🔐 Default Login +From the project root: -| Username | Password | Role | -| -------- | ---------- | ----- | -| `admin` | `admin123` | Admin | - -> ⚠️ Change the default password immediately after first login in production. - ---- - -## 🗂 Project Structure - -``` -msms/ -├── README.md -├── package.json ← root (concurrently) -├── .gitignore -│ -├── docs/ -| ├── report.pdf -| ├── proposal.pdf -| ├── manual.pdf -| ├── ER_diagram.pdf -| -├── backend/ -│ ├── server.js ← Express entry point -│ ├── db.js ← MySQL connection pool -│ ├── .env.example -│ ├── routes/ -│ │ ├── auth.js ← POST /auth/login, GET /auth/me -│ │ ├── medicines.js -│ │ ├── categories.js -│ │ ├── manufacturers.js -│ │ ├── suppliers.js -│ │ ├── stock.js ← includes POST /restock -│ │ ├── customers.js -│ │ ├── doctors.js -│ │ ├── employees.js -│ │ ├── prescriptions.js -│ │ ├── orders.js ← includes bill + complete endpoints -│ │ ├── payments.js -│ │ └── reports.js ← calls all 4 views + dashboard stats -│ └── middleware/ -│ ├── auth.js ← JWT verify + role authorize -│ └── validate.js ← express-validator error handler -│ -├── frontend/ -│ └── src/ -│ ├── App.jsx ← all routes defined here -│ ├── api/index.js ← axios instance + all API helpers -│ ├── context/ -│ │ ├── AuthContext.jsx -│ │ └── CartContext.jsx -│ ├── components/ -│ │ ├── Layout/ ← Sidebar, Navbar, ProtectedRoute -│ │ ├── UI/ ← Modal, Badge, StatCard, SearchBar, ConfirmDialog, Pagination, CrudPage -│ │ └── Bill/ ← BillPreview, BillActions -│ └── pages/ -│ ├── Login.jsx -│ ├── Dashboard.jsx -│ ├── Inventory/ ← MedicineList, StockList -│ ├── Sales/ ← NewOrder (POS), OrderList, OrderDetail -│ ├── Customers/ -│ ├── Suppliers/ -│ ├── Doctors/ -│ ├── Employees/ -│ ├── Prescriptions/ -│ ├── Payments/ -│ └── Reports/ ← 4-tab report page with chart + CSV export -│ -└── database/ - ├── schema.sql ← 12 tables + 2 auxiliary tables - ├── sample_data.sql ← Pakistani context sample data - ├── triggers.sql ← 4 triggers - ├── stored_procedures.sql ← 4 procedures - ├── views.sql ← 7 views - └── indexes.sql ← performance indexes +```bash +npm run dev ``` ---- - -## 🌐 API Endpoints - -### Auth - -| Method | Endpoint | Description | -| ------ | -------------------- | -------------- | -| POST | `/api/v1/auth/login` | Login, get JWT | -| GET | `/api/v1/auth/me` | Current user | - -### Resources (all support GET / GET /:id / POST / PUT /:id / DELETE /:id) - -`/api/v1/categories`, `/api/v1/manufacturers`, `/api/v1/suppliers`, -`/api/v1/medicines`, `/api/v1/doctors`, `/api/v1/customers`, -`/api/v1/employees`, `/api/v1/prescriptions`, `/api/v1/payments` - -### Stock - -| Method | Endpoint | Description | -| ------ | ----------------------- | ------------------ | -| GET | `/api/v1/stock` | All stock records | -| POST | `/api/v1/stock/restock` | Restock a medicine | - -### Orders - -| Method | Endpoint | Description | -| ------ | ----------------------------- | --------------------------------- | -| GET | `/api/v1/orders` | List orders (paginated) | -| POST | `/api/v1/orders` | Place order + optional payment | -| GET | `/api/v1/orders/:id` | Order detail with items | -| GET | `/api/v1/orders/:id/bill` | Full bill (calls GenerateBill SP) | -| POST | `/api/v1/orders/:id/complete` | Complete payment | -| PUT | `/api/v1/orders/:id/cancel` | Cancel pending order | - -### Reports - -| Method | Endpoint | Description | -| ------ | -------------------------------------- | ---------------------- | -| GET | `/api/v1/reports/dashboard-stats` | 6 dashboard KPIs | -| GET | `/api/v1/reports/low-stock` | vw_LowStockAlert | -| GET | `/api/v1/reports/expiring-soon` | vw_ExpiringSoon | -| GET | `/api/v1/reports/sales-summary` | vw_SalesSummary | -| GET | `/api/v1/reports/top-medicines` | vw_TopSellingMedicines | -| GET | `/api/v1/reports/employee-performance` | vw_EmployeePerformance | - ---- - -## 🗄 Database Schema (12 Tables) - -| Table | Primary Key | Purpose | -| --------------- | ----------------- | ----------------------------------------- | -| `categories` | `category_id` | Medicine classifications | -| `manufacturers` | `manufacturer_id` | Pharma companies | -| `suppliers` | `supplier_id` | Stock suppliers with ratings | -| `medicines` | `medicine_id` | Core medicine catalog | -| `stock` | `stock_id` | Quantity, batch, expiry per medicine | -| `doctors` | `doctor_id` | Licensed doctors for prescriptions | -| `customers` | `customer_id` | Customer profiles | -| `employees` | `employee_id` | Staff with roles and credentials | -| `prescriptions` | `prescription_id` | Doctor → Customer prescriptions | -| `orders` | `order_id` | Master order with discount/tax | -| `order_items` | `item_id` | Line items (subtotal is GENERATED column) | -| `payments` | `payment_id` | Payment method and status per order | - ---- - -## 📸 Screenshots - -> _(Add screenshots here after first run)_ +This starts both servers concurrently — backend API at http://localhost:5000, +frontend at http://localhost:5173. You can also run them separately with +`npm run server` and `npm run client`. -- `screenshots/login.png` -- `screenshots/dashboard.png` -- `screenshots/pos.png` -- `screenshots/bill-preview.png` -- `screenshots/reports.png` +Default login: username `admin`, password `admin123`. Change it after first login. ---- +Project documents (proposal, manual, ER diagram) are in `docs/`. -## 👤 Author +## Credits -**Moavia Amir** -Student ID: 2k24_BSAI_72 -BS Artificial Intelligence — 4th Semester -Database Lab | Instructor: Sir Ahsan Ahmed +Moavia (Muawiya) Amir — 2k24_BSAI_72, BS Artificial Intelligence, 4th Semester. +Database Lab, Instructor: Sir Ahsan Ahmed. From 88ac7a87b721869fa57ce823a368129ecf22bce8 Mon Sep 17 00:00:00 2001 From: Muawiya Amir Date: Sun, 30 Aug 2026 23:52:41 +0500 Subject: [PATCH 09/13] CloudKernel: trim README to plain prose Cut from 130 to ~67 lines. Kept the concurrency model, config, and build/run steps (added a Linux/macOS equivalent to the PowerShell commands); dropped emoji headings and a stale file listing. Co-Authored-By: Claude Fable 5 --- CloudKernel/README.md | 164 +++++++++++++----------------------------- 1 file changed, 51 insertions(+), 113 deletions(-) diff --git a/CloudKernel/README.md b/CloudKernel/README.md index b93b93b..884c63d 100644 --- a/CloudKernel/README.md +++ b/CloudKernel/README.md @@ -1,129 +1,67 @@ # CloudKernel -CloudKernel is a Java concurrency simulator with a professional Swing dashboard that visualizes hypervisor-like VM scheduling, shared resource contention, and synchronization. - -## 📋 Project Information - -| Field | Details | -|-------|---------| -| **Subject** | Operating Systems | -| **Semester** | 4th Semester — BSAI 2k24 | -| **Institute** | NFC Institute of Engineering & Technology, Multan | -| **Department** | Artificial Intelligence | -| **Submitted To** | Mam Amara Nadeem — [ammara.visiting@nfciet.edu.pk](mailto:ammara.visiting@nfciet.edu.pk) | -| **Submission Date** | March 03, 2026 | - ---- - -## 👥 Team Members - -| Name | Roll Number | Email | -|------|-------------|-------| -| Muawiya Amir | 2k24_BSAI_72 | [2k24bsai72@undergrad.nfciet.edu.pk](mailto:2k24bsai72@undergrad.nfciet.edu.pk) | -| Ali Raza | 2k24_BSAI_44 | [2k24bsai44@undergrad.nfciet.edu.pk](mailto:2k24bsai44@undergrad.nfciet.edu.pk) | -| Muhammad Arslan Nasir | 2k24_BSAI_26 | [2k24bsai26@undergrad.nfciet.edu.pk](mailto:2k24bsai26@undergrad.nfciet.edu.pk) | -## Highlights - -- Dark-theme dashboard: Cloud hypervisor monitor layout. -- Boot orchestration with CountDownLatch. -- VM cycle synchronization with CyclicBarrier. -- Shared CPU, memory, and network resources with fair semaphores and timeout handling. -- Color-coded live logs streamed to terminal and GUI simultaneously. -- Live stats for cycles, operations, contentions, timeouts, and uptime. -- Configurable behavior through config.properties. - - -## Final Package Structure - -```text -CloudKernel/ - src/ - Main.java - config/ - ConfigLoader.java - core/ - BootManager.java - ClockSynchronizer.java - entities/ - ResourceManager.java - VirtualMachine.java - VMPriority.java - VMState.java - VMStats.java - shutdown/ - ShutdownManager.java - ui/ - BarrierPanel.java - CloudKernelGUI.java - ControlPanel.java - DashboardUpdater.java - LogPanel.java - ResourceMonitorPanel.java - StatsBar.java - VMCard.java - utils/ - GUILogger.java - StatsCollector.java - config.properties - ARCHITECTURE.md - doc/ - PROJECT_PROPOSAL.md - PROJECT_Report.md - Project_presentation.ppt - - -``` - -## GUI Overview - -Main window sections: - -- Header: title, digital clock, online indicator. -- Boot panel: resource chips and latch countdown. -- VM dashboard: one card per VM with state, priority, progress, and resource indicators. -- Left sidebar: semaphore slot view for CPU, memory, and network. -- Barrier panel: arrival dots and cycle display. -- Right sidebar: color-coded live event log. -- Bottom bars: statistics and controls. - -## Core Concurrency Model - -- Boot phase: CountDownLatch initialized to four boot tasks. -- Runtime phase: each VM executes for configured cycles. -- Resource phase: each VM requests CPU, memory, and network permits with timeout. -- Synchronization phase: all VMs rendezvous at a CyclicBarrier before the next cycle. +CloudKernel is a Java concurrency simulator with a Swing dashboard that models a +hypervisor managing virtual machines. A configurable number of VM threads boot +together, compete for shared CPU, memory, and network resources, and synchronize +at the end of each execution cycle, while the GUI shows their state, resource +usage, and a live event log in a dark-theme monitor layout. + + + +## How it works + +- Boot phase: a CountDownLatch holds the VMs until four boot tasks complete. +- Runtime phase: each VM runs a configured number of cycles with randomized + workload durations. +- Resource phase: VMs acquire CPU, memory, and network permits from fair + semaphores, with a timeout so contention never deadlocks. +- Synchronization phase: all VMs rendezvous at a CyclicBarrier before starting + the next cycle. + +The main window shows a header with a digital clock, a boot panel with the +latch countdown, one card per VM (state, priority, progress, held resources), +a semaphore slot view for each resource, a barrier panel with arrival dots, +a color-coded event log, and a stats/control bar. Logs stream to the terminal +and the GUI at the same time, and stats track cycles, operations, contentions, +timeouts, and uptime. Worker threads never touch Swing directly; all UI updates +go through SwingUtilities.invokeLater. + +Source lives under `src/` in packages: `config` (ConfigLoader), `core` +(BootManager, ClockSynchronizer), `entities` (VirtualMachine, ResourceManager, +VM state/priority/stats), `shutdown` (ShutdownManager), `ui` (the dashboard +panels), and `utils` (GUILogger, StatsCollector). `Main.java` is just the GUI +entry point. Design details are in `ARCHITECTURE.md`, and the proposal, report, +and slides are in `doc/`. ## Configuration -Edit config.properties before running: - -- vm.count -- cycle.count -- semaphore.cpu.permits -- semaphore.memory.permits -- semaphore.network.permits -- task.duration.min -- task.duration.max -- timeout.duration -- gui.enabled -- gui.theme -- gui.font -- logging.level -- stats.enabled +Edit `config.properties` before running. It sets the VM count, cycles per VM, +permit counts for the CPU/memory/network semaphores, min/max task duration, +acquire timeout, GUI options (enabled, theme, font), logging level, and whether +stats collection is on. -## Build And Run +## Build and run -From CloudKernel root: +From the CloudKernel root on Windows (PowerShell): ```powershell javac -encoding UTF-8 -d bin (Get-ChildItem -Recurse src -Filter *.java | ForEach-Object { $_.FullName }) java -cp "bin;." Main ``` -## Notes +On Linux/macOS the equivalent is: + +```bash +javac -encoding UTF-8 -d bin $(find src -name '*.java') +java -cp "bin:." Main +``` -- All UI updates triggered by worker threads are dispatched through SwingUtilities.invokeLater. -- Main.java contains only the GUI entry point. -- Legacy duplicate docs and unused legacy classes were removed to keep one canonical implementation path. +## Credits +Operating Systems project, 4th semester BSAI 2k24, Department of Artificial +Intelligence, NFC Institute of Engineering & Technology, Multan. +Submitted to Mam Amara Nadeem (ammara.visiting@nfciet.edu.pk) on March 03, 2026. +Team: Muawiya Amir (2k24_BSAI_72, 2k24bsai72@undergrad.nfciet.edu.pk), +Ali Raza (2k24_BSAI_44, 2k24bsai44@undergrad.nfciet.edu.pk), +Muhammad Arslan Nasir (2k24_BSAI_26, 2k24bsai26@undergrad.nfciet.edu.pk). From b74c5023471b28190d99c80b9d1cc01c0e509d32 Mon Sep 17 00:00:00 2001 From: Muawiya Amir Date: Sun, 30 Aug 2026 23:52:41 +0500 Subject: [PATCH 10/13] RC+: trim README, verify pins against the sketch Cut from 135 to ~67 lines. Pin mapping, AP credentials, and control flow now match the actual sketch and interface files. Kept team credits and links. Co-Authored-By: Claude Fable 5 --- CodingMoves-RCPlus/README.md | 198 ++++++++++++----------------------- 1 file changed, 65 insertions(+), 133 deletions(-) diff --git a/CodingMoves-RCPlus/README.md b/CodingMoves-RCPlus/README.md index 835990f..7bfc79c 100644 --- a/CodingMoves-RCPlus/README.md +++ b/CodingMoves-RCPlus/README.md @@ -1,135 +1,67 @@ # CodingMoves-RC+ -## 🚗 WiFi-Controlled RC Car using NodeMCU (ESP8266) -A fun IoT project where you control an RC car over WiFi using your mobile phone. This project uses a NodeMCU (ESP8266) board, L298N motor driver, and a basic HTML interface. - ---- - - -**Course:** Digital Logic Design (DLD) -**Semester:** 2rd -**Submitted To:** Engr. Romaisa Shamshad Khan -**Submitted By:** -- *Moavia Amir* (2k24_BSAI_72) -- *Muhammad Dawood* (2k24_BSAI_48) -- *Fatima Hassan* (2k24_BSAI_07) -- *JAVERIA BABAR* (2K24_BSAI_14) - ---- -## 📸 Final Project Snapshot - - - -Final RC Car -Final RC Car - ---- - -## 📂 Project Folder Structure - -Below is the folder structure for the WiFi-Controlled RC Car project: - -```markdown -iot-rc-car-controller/ -│ -├── code/ -│ └── rc_car_controller.ino # ESP8266 code in C++ -│ -├── interface/ -│ └── index.html # Controller code -│ -├── images/ -│ └── demo.jpg # Image of the final car setup -│ -├── docs/ -│ └── circuit_diagram.png # Circuit diagram for wiring -| └── Proposal.pdf -| └── Report.pdf -│ -└── README.md # This documentation file -``` - ---- - -## 🌐 Social Media Accounts - -Follow **Coding Moves** on all platforms for more fun projects: - -- 🧠 YouTube: [@Coding_Moves](https://www.youtube.com/@Coding_Moves) -- 👨‍💻 GitHub: [Muawiya-contact](https://github.com/Muawiya-contact) -- 💼 LinkedIn: [Moavia Amir](https://linkedin.com/in/contactmuawia) -- 📊 Kaggle: [Moavia Amir](https://www.kaggle.com/moaviaamir) - ---- - -## 🔧 Components - -***All components*** - -- **ESP8266 Module (NodeMCU)** - - - _Purpose:_ The heart of the project, the NodeMCU module provides WiFi connectivity, enabling the control of the RC car via commands sent from the web interface. - -- **L298N Motor Driver** - - - _Purpose:_ The L298N motor driver controls the speed and direction of the DC motors, allowing for precise movement of the RC car. It serves as the interface between the NodeMCU and the motors. - -- **DC Motors (4x)** - - - _Purpose:_ These four motors provide the necessary movement for the RC car, enabling it to move forward, backward, left, and right. - -- **Wheels (4x)** - - - _Purpose:_ These wheels, mounted on the DC motors, allow the RC car to drive across various surfaces. - -- **Chassis** - - - _Purpose:_ The chassis is the structural frame that holds all the components of the car, including the motors, wheels, and the NodeMCU. - -- **Battery Pack (7.4V)** - - - _Purpose:_ This battery pack powers the RC car and its components, providing the necessary voltage for the motors and electronics to function. - -- **Jumper Wires** - - - _Purpose:_ Jumper wires are used for making the necessary electrical connections between the NodeMCU, motor driver, and other components. - -- **Smartphone** - - - _Purpose:_ A smartphone is used to interact with the web interface for controlling the RC car via the NodeMCU's WiFi network. - ---- - -## 🛠️ Tools & Technologies - -- **NodeMCU ESP8266** -- **L298N Motor Driver** -- **DC Motors** -- **HTML + JavaScript (for UI)** -- **Arduino IDE** - ---- - -## 📌 How to Use - -1. Upload the `.ino` file to your NodeMCU. -2. Connect to the WiFi AP `NodeMCU Car`. -3. Open the web interface in your mobile browser. -4. Use directional buttons to control your car. - ---- - -## 🤝 Credits - -By **Coding Moves** -Passionately building cool projects that move! - ---- +A WiFi-controlled RC car built on a NodeMCU (ESP8266). The board runs as a +WiFi access point and serves HTTP commands; a small HTML/JavaScript page on +your phone sends direction and speed commands, and an L298N driver moves the +four DC motors. + +**Course:** Digital Logic Design (DLD), 2nd semester +**Submitted to:** Engr. Romaisa Shamshad Khan +**Team:** Moavia Amir (2k24_BSAI_72), Muhammad Dawood (2k24_BSAI_48), +Fatima Hassan (2k24_BSAI_07), Javeria Babar (2k24_BSAI_14) + +Final RC Car +Final RC Car + +## Parts + +- NodeMCU ESP8266 +- L298N motor driver +- 4x DC motors with wheels +- Chassis +- 7.4V battery pack +- Jumper wires +- A smartphone (or any browser) for control + +## Wiring + +Pin mapping used in `code/rc_car_controller.ino`: + +| L298N pin | GPIO | NodeMCU pin | Role | +|-----------|------|-------------|------| +| ENA | 14 | D5 | Right motor speed (PWM) | +| ENB | 12 | D6 | Left motor speed (PWM) | +| IN1 | 15 | D8 | Right motor direction | +| IN2 | 13 | D7 | Right motor direction | +| IN3 | 2 | D4 | Left motor direction | +| IN4 | 0 | D3 | Left motor direction | + +A circuit diagram, proposal, and report are in `docs/`. + +## Flash and run + +1. Open `code/rc_car_controller.ino` in the Arduino IDE (with ESP8266 board + support installed) and upload it to the NodeMCU. +2. Power the car. The board creates an access point named + `Coding Moves RC+` with password `codingmoves_123`. +3. Connect your phone to that network and open + `interface/index.html` in the browser. It sends requests to the board at + `192.168.4.1` as `http://192.168.4.1/?State=`. +4. Hold the arrow buttons to drive (forward, back, left, right); releasing + sends stop. The lightning buttons set speed levels (0-9 map to PWM values + 400-1023 in the sketch). + +## Repository layout + +- `code/rc_car_controller.ino` — ESP8266 firmware +- `interface/index.html` — control page +- `docs/` — circuit diagram, proposal, report +- `images/` — photos of the build + +## Credits + +A Coding Moves project. More at +[YouTube](https://www.youtube.com/@Coding_Moves), +[GitHub](https://github.com/Muawiya-contact), +[LinkedIn](https://linkedin.com/in/contactmuawia), +[Kaggle](https://www.kaggle.com/moaviaamir). From 77d62c40cac4fa06021ff0fc8a3dbc74e7ffd4fb Mon Sep 17 00:00:00 2001 From: Muawiya Amir Date: Sun, 30 Aug 2026 23:52:41 +0500 Subject: [PATCH 11/13] IoT_IDS: rewrite README to match actual folder contents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The old README listed code files that don't exist in the folder — it currently contains only the project proposal PDF. The README now says so honestly instead of documenting phantom code. Co-Authored-By: Claude Fable 5 --- IoT_IDS/README.md | 142 ++++++++-------------------------------------- 1 file changed, 23 insertions(+), 119 deletions(-) diff --git a/IoT_IDS/README.md b/IoT_IDS/README.md index 4995c8e..372315c 100644 --- a/IoT_IDS/README.md +++ b/IoT_IDS/README.md @@ -1,130 +1,34 @@ -# IoT Intrusion Detection System (Information Security Project) +# IoT Intrusion Detection System -**Course:** Information Security / Network Security -**Semester:** 3rd -**Submitted To:** Prof. Khalid Mehmood Khan -**Submitted By:** +A lightweight, classroom-safe intrusion detection system for IoT networks. An ESP8266/NodeMCU sensor publishes temperature readings over MQTT, and a Python IDS running alongside a Mosquitto broker watches the traffic for anomalies — message-rate floods, large-payload (byte-rate) floods, and tampering — raising real-time alerts on a local Flask dashboard. Built as an Information Security course project to demonstrate how a simple IDS helps preserve the integrity and availability of resource-constrained IoT deployments. This repository currently contains the project proposal (`IoT_IDS-Proposal.pdf`); see it for the full design. -- 🧠 _Moavia Amir_ (2k24_BSAI_72) — [📧 contactmuawia@gmail.com](mailto:contactmuawia@gmail.com) -- ⚙️ _Muhammad Ramzam_ (2k24_BSAI_31) — [📧 ramzan381.biz@gmail.com](mailto:ramzan381.biz@gmail.com) +## How it works ---- +1. The ESP sensor publishes JSON messages to `home/sensor/temp` about once per second. +2. A laptop runs the Mosquitto broker and the IDS, which subscribes to `home/sensor/#` and tracks messages/sec and bytes/sec per topic. +3. When either rate exceeds its threshold (defaults: 30 msg/s, 4000 B/s), the IDS raises an alert and the web UI at `http://:5000` turns red. +4. Attacks are simulated with a second ESP or a phone (MQTT app or Termux): a ~50 ms publish interval triggers the message-rate alert; ~900 B payloads every 200 ms trigger the byte-rate alert. Stopping the attacker returns the status to OK. A proxy (MITM) simulation demonstrates tampering. -## 📘 Project Overview +## Requirements -**IoT Intrusion Detection System** is a lightweight, classroom‑safe IDS that monitors MQTT traffic from ESP8266/NodeMCU sensors, detects anomalous behaviours (message‑rate floods, large‑payload floods, and tampering), and displays real‑time alerts on a local dashboard. The project demonstrates practical information security techniques for protecting IoT deployments and is intended for educational demonstration on owned devices and isolated networks. +- ESP8266 / NodeMCU (sensor), plus an optional second ESP or smartphone as the attacker +- Laptop with Wi-Fi: Mosquitto MQTT broker, Python 3.8+ with `paho-mqtt` and `Flask` +- Arduino IDE for flashing the ESP ---- +## Running the demo -## 🔍 Problem Statement +1. Install and start Mosquitto on the laptop. +2. Flash the sensor sketch to the ESP with `BROKER_IP` set to the laptop's IP. +3. Start the IDS/web script with Python 3 and open `http://:5000`. +4. Run the flood simulations from the second device and watch the alerts fire. -IoT devices are often resource‑constrained and poorly secured, making them vulnerable to message floods, tampering, and spoofing. These attacks can degrade service availability, corrupt telemetry, and open attack surfaces in smart systems. This project demonstrates how a simple IDS can detect such conditions and help preserve **integrity** and **availability** of IoT systems. +Thresholds can be tuned to match the local network. Only run the attack simulations on your own devices and an isolated network — never on external or institutional networks. ---- +## Credits -## 🎯 Objectives +Course: Information Security / Network Security, 3rd semester +Instructor: Prof. Khalid Mehmood Khan -- Build a reproducible IDS that monitors MQTT topics from ESP sensors. -- Detect two core attack types: - 1. **Message‑rate flood** — many small messages per second. - 2. **Byte‑rate flood** — large payloads causing bandwidth spikes. -- Demonstrate tampering/spoofing and an optional proxy (MITM) simulation. -- Provide a minimal web UI showing live sensor data and alert status. -- Ensure the demo is safe and limited to owned/isolated networks. - ---- - -## 🧠 System Overview - -| Component | Purpose | -| --------------------- | ----------------------------------------------------------- | -| **ESP8266 / NodeMCU** | Sensor (publishes temperature) and optional attacker device | -| **Laptop** | Runs Mosquitto MQTT broker, IDS (Python), and Flask web UI | -| **Phone** | Optional attacker (MQTT app or Termux) to simulate attacks | -| **Software stack** | Mosquitto, Python (paho-mqtt, Flask), Arduino IDE | - ---- - -## 🔬 Working Principle (Simple) - -1. ESP sensor publishes JSON messages to `home/sensor/temp` at 1 msg/sec. -2. Laptop (broker + IDS) subscribes to `home/sensor/#` and measures: - - messages/sec per topic (msg_rate) - - bytes/sec per topic (byte_rate) -3. If `msg_rate` or `byte_rate` exceeds set thresholds → IDS raises an **ALERT** and the web UI shows a red warning. -4. Attacks are simulated safely using a second ESP or a phone (MQTT app / Termux). - ---- - -## 🛠 Hardware & Software Requirements - -**Hardware** - -- ESP8266 / NodeMCU (sensor) -- Optional second ESP (attacker) or smartphone -- Laptop with Wi‑Fi and USB port - -**Software** - -- Mosquitto MQTT broker -- Python 3.8+ with `paho-mqtt` and `Flask` -- Arduino IDE (for flashing ESP) -- (Optional) Termux or MQTT mobile app - ---- - -## 🚀 Quick Start (classroom demo) - -1. Install and start Mosquitto on laptop. -2. Upload `esp_sensor.ino` to an ESP and set `BROKER_IP` to your laptop IP. -3. Run `python3 ids_web.py` on laptop (default thresholds: `MSG_THRESHOLD=30 msg/s`, `BYTES_THRESHOLD=4000 B/s`). -4. Open the UI: `http://:5000` — confirm **OK** status. -5. Simulate attacks: - - **Message‑rate flood:** start phone/ESP attacker with interval `50 ms` → IDS triggers message‑rate alert. - - **Byte‑rate flood:** phone (Termux) publishes ~900B every `200 ms` → IDS triggers byte‑rate alert. -6. Stop attacker → status returns to OK. - -> **Safety:** Only run tests on your own devices and local network. Do not run attacks on external or institutional networks. - ---- - -## 📂 Folder Structure - -``` -IoT_IDS/ -├─ README.md # (this file) -├─ requirements.txt # paho-mqtt, Flask -├─ esp/ -│ ├─ esp_sensor.ino -│ └─ esp_attacker.ino -├─ python/ -│ ├─ ids_web.py -│ ├─ phone_attacker.py -│ └─ mqtt_proxy.py -└─ slides/ -└─ one_slide.txt -``` - ---- - -## 🔧 Tuning & Extensions - -- Adjust `MSG_THRESHOLD` and `BYTES_THRESHOLD` in `ids_web.py` to match your classroom network. -- Possible extensions: add rate‑limiting actions (block/quarantine), store alerts to CSV for the report, integrate cloud dashboards (ThingSpeak/Blynk), or add authentication and TLS for MQTT. - ---- - -## 🧾 Deliverables & Evaluation Evidence - -- Live demo (2–3 minutes): normal → message flood → large‑payload flood → tamper/proxy. -- Source code: ESP sketches + Python scripts in the repo. -- Report / screenshots showing alert and logs. - ---- - -## 📫 Contact - -- Moavia Amir — contactmuawia@gmail.com -- Muhammad Ramzam — Ramzam@gmail.com - ------ +Team: +- Moavia Amir (2k24_BSAI_72) — contactmuawia@gmail.com +- Muhammad Ramzam (2k24_BSAI_31) — ramzan381.biz@gmail.com From 74ead64a18f1cb18b8c0d566a384284e447a47ba Mon Sep 17 00:00:00 2001 From: Muawiya Amir Date: Sun, 30 Aug 2026 23:52:41 +0500 Subject: [PATCH 12/13] ResQTemp: rewrite README to match the actual code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The old README described an Arduino UNO + main.asm + SIM900A setup; the code is an ESP8266 sketch (assembly/esp.c++) with a 33 °C threshold, GSM AT-command alerts, and a web dashboard. Kept course, instructor, and team credits. Co-Authored-By: Claude Fable 5 --- ResQTemp/README.md | 211 ++++++++++++--------------------------------- 1 file changed, 53 insertions(+), 158 deletions(-) diff --git a/ResQTemp/README.md b/ResQTemp/README.md index 4e01a41..e453b02 100644 --- a/ResQTemp/README.md +++ b/ResQTemp/README.md @@ -1,158 +1,53 @@ -# ⚙️ ResQTemp — Smart Temperature & Rescue Alert System - -**Course:** Computer Organization & Assembly Language (COAL) -**Semester:** 3rd -**Submitted To:** Prof. Ghulam Mustafa -**Submitted By:** -- 🧠 *Moavia Amir* (2k24_BSAI_72) — [📧 contactmuawia@gmail.com](mailto:contactmuawia@gmail.com) -- ⚙️ *Muhammad Dawood* (2k24_BSAI_31) — [📧 Mirzamuhammaddawood0098@gmail.com](mailto:Mirzamuhammaddawood0098@gmail.com) - ---- - -## 📘 Project Overview - -**ResQTemp** is a microcontroller-based **smart temperature control and rescue alert system** integrating **Assembly-level programming** with **IoT and GSM communication**. -It demonstrates how **low-level hardware control** (in Assembly) can synchronize with **modern IoT automation** to enhance safety and real-time monitoring. - -The project monitors temperature using an **LM35 sensor**, controls **fan and LED** responses, and triggers **rescue alerts via SMS and IoT dashboard** after a safety delay if overheating persists. -Through an **ESP8266 web interface**, users can remotely view temperature data, device status, and location-based alerts in emergency mode. - ---- - -## 🧩 Problem Statement - -Conventional temperature monitoring systems lack **intelligent decision logic** and **remote visibility**. -In industrial or laboratory environments, a delayed response to overheating can lead to serious equipment or safety issues. - -**ResQTemp** bridges this gap by merging: -- **Precision hardware control** (Assembly-level logic) -- **Smart IoT connectivity** -- **Real-time rescue response** via automated SMS and web alerts - ---- - -## 🎯 Objectives - -- Implement a temperature monitoring system using Assembly language on Arduino. -- Activate safety outputs (LED/Fan) when temperature crosses threshold. -- Introduce a 15-second delay before triggering emergency mode (avoiding false alerts). -- Send a **rescue SMS using SIM900A** and update IoT dashboard via ESP8266 after the delay. -- Display live readings and system status on a hosted IoT web page. -- Optionally share GPS/location data for emergency tracking. - ---- - -## 🧠 System Overview - -| Component Type | Description | -|----------------|-------------| -| **Microcontroller** | Arduino UNO programmed in Assembly (COAL core) | -| **Sensor** | LM35 – Temperature sensor (analog input) | -| **Outputs** | LED indicator, Cooling Fan, Buzzer | -| **IoT Module** | ESP8266 Wi-Fi Module | -| **GSM Module** | SIM900A — sends rescue SMS automatically | -| **Web Page** | HTML + CSS dashboard showing live data & alerts | -| **Language Stack** | Assembly (Arduino), C++ (IoT & GSM logic), HTML/CSS (Web UI) | - ---- - -## 🔬 Working Principle - -1. The **LM35 sensor** outputs an analog voltage proportional to temperature. -2. Arduino executes **Assembly instructions** to: - - Compare current temperature with threshold - - Control fan/LED indicators - - Start a **15-second timer** if overheating continues -3. If temperature remains high after 15 seconds: - - Arduino signals the **ESP8266** to update IoT dashboard - - Arduino triggers the **SIM900A module** to send a **rescue SMS** to predefined numbers -4. The ESP8266 dashboard displays: - - Current temperature - - System status: *Normal / Overheat / Rescue Mode* -5. Users can monitor and control the system remotely via the IoT dashboard while receiving immediate SMS alerts. - ---- - -## 🧰 Hardware Requirements - -- Arduino UNO -- LM35 Temperature Sensor -- ESP8266 Wi-Fi Module -- SIM900A GSM Module -- LED, Fan, Buzzer -- Breadboard, Jumper Wires, Resistors -- Power Supply (5V) - ---- - -## 💻 Software Requirements - -- Arduino IDE -- Assembly/C++ Compiler Support -- HTML + CSS for Web Dashboard -- Serial Monitor or Web Browser for live data - ---- - -## 🚀 Expected Outcomes - -- Fully functional hardware prototype controlling temperature automatically. -- Real-time monitoring via IoT dashboard hosted on ESP8266. -- Automated **rescue SMS alerts** via SIM900A module. -- Demonstration of Assembly-level timing and control accuracy. -- Proof of concept for combining **COAL + IoT + GSM** principles. - ---- - -## 🔮 Future Enhancements - -- Add ultrasonic sensor for object detection. -- Integrate camera module for live streaming. -- Build a mobile app for remote monitoring. -- Connect to platforms like **ThingSpeak** or **Blynk** for cloud storage. - ---- - -## 🧾 Folder Structure - -```txt -COAL-ResQTemp/ -│ -├── assembly/ -│ └── main.asm -│ -├── esp_web/ -│ ├── index.html -│ └── style.css -│ -├── circuits/ -│ └── circuit_diagram.png -│ -├── RQT-Proposal.pdf -├── RQT-Report.pdf -└── README.md ← (this file) -``` -## 🧩 Learning Impact - -This project combines ***Computer Organization & Assembly Language*** concepts with ***IoT-based automation + GSM automation***, demonstrating: - -+ Real-world integration of low-level control and networked intelligence - -+ Strong understanding of hardware-software interfacing - -+ Application of COAL principles in modern embedded systems - -## 🏁 Conclusion - -***ResQTemp*** showcases the power of **combining Assembly programming** precision with **IoT and GSM innovation**. -It reflects the **NFC IET vision** — merging faith, innovation, and engineering excellence to create impactful, **intelligent systems**. - -## 📫 Contact - -For collaboration or guidance, connect via: - -- [🌐 GitHub Profile](https://github.com/Muawiya-contact) -- [🎥 YouTube Channel — Coding Moves](https://www.youtube.com/@Coding_Moves) -- [📧 Email](mailto:contactmuawia@gmail.com) - ---- \ No newline at end of file +# ResQTemp + +A temperature monitoring and rescue-alert system built as a semester project for +Computer Organization & Assembly Language (COAL). An ESP8266 reads an LM35 +temperature sensor, serves a small web dashboard over its own Wi-Fi access +point, and if the temperature stays above a safe threshold for too long it +drives a GSM module with AT commands to send an emergency SMS and place a call. + +## How it works + +- The LM35 on pin A0 is sampled every 500 ms; the safe limit is 33 °C. +- Below the threshold a green LED stays on. Above it, the red LED and buzzer + activate and a hold timer starts (5 s in real mode, 10 s in demo mode). +- If the temperature is still high when the timer expires, the ESP8266 steps + through a GSM sequence over serial (`AT+CMGF`, `AT+CMGS` to text the + configured phone number, then `ATD` to call and `ATH` to hang up). +- The dashboard, served on port 80, shows the live temperature and state + (Normal / Alert / Calling) and has buttons to toggle demo mode (persisted in + EEPROM), cancel an in-progress call, and reset the ESP. +- Demo mode simulates a rising temperature so the alert flow can be shown + without actually heating the sensor. + +## Repository layout + +- `assembly/esp.c++` — the full Arduino sketch for the ESP8266 (sensor + reading, web server, embedded dashboard page, GSM state machine). +- `esp_web/main.html` — standalone copy of the dashboard page. +- `Circuit/circuit-diagram.jpeg` — wiring diagram. +- `doc/RQT-Proposal.pdf`, `doc/RQT-Report.pdf` — project proposal and report. + +## Hardware + +ESP8266 (NodeMCU-style board), LM35 temperature sensor on A0, green/red/blue +LEDs on D1–D3, buzzer on D4, and a GSM module wired to the ESP's serial pins. +Powered at 5 V with the usual breadboard, jumpers, and resistors. + +## Build and run + +1. Open `assembly/esp.c++` in the Arduino IDE with the ESP8266 board package + installed, plus the ArduinoJson library. +2. Adjust `phoneNumber` (and the AP credentials if you like) near the top of + the sketch, then flash it to the board. +3. Connect to the Wi-Fi access point `ResQTemp` (password in the sketch) and + open the ESP's IP in a browser (192.168.4.1 by default) to see the + dashboard. + +## Credits + +Course: Computer Organization & Assembly Language (COAL), 3rd semester, +NFC IET Multan. Submitted to Prof. Ghulam Mustafa. + +Team: Moavia Amir (2k24_BSAI_72, contactmuawia@gmail.com) and +Muhammad Dawood (2k24_BSAI_31, Mirzamuhammaddawood0098@gmail.com). From b22c0fee84ecff8230d6cf6633a226d50244b0fe Mon Sep 17 00:00:00 2001 From: Muawiya Amir Date: Sun, 30 Aug 2026 23:52:41 +0500 Subject: [PATCH 13/13] SFS: trim README, fix paths, drop mismatched sections Corrected the manage.py path (backend/backend/sfs_backend), removed a setup step for a nonexistent .env.example, and deleted a duplicated Vercel/Netlify/Gemini marketing section that didn't match the Django backend. Co-Authored-By: Claude Fable 5 --- SFS/README.md | 141 ++++++++++++-------------------------------------- 1 file changed, 32 insertions(+), 109 deletions(-) diff --git a/SFS/README.md b/SFS/README.md index c3f7f6a..c109cb6 100644 --- a/SFS/README.md +++ b/SFS/README.md @@ -1,140 +1,63 @@ - # Secure File System (SFS) -This repository contains a Django + DRF backend for a Secure File System and a minimal frontend using Bootstrap and Axios. +A Django + Django REST Framework backend for encrypted file storage, with a +small template-based frontend (Bootstrap + Axios) served by Django. Users +register, log in with JWT, and upload files that are encrypted at rest; +each operation is recorded in an activity log. The repository also contains +an experimental React/Vite client prototype at the root (`App.tsx`, +`services/`), which is separate from the Django app. ## Features -- User registration + JWT authentication (djangorestframework-simplejwt) -- AES-256 encrypted files, RSA-2048 per-user key pairs, HMAC-SHA256 integrity -- Upload / download / delete files -- Local, Firebase and S3 storage options (local implemented) -- Activity logs +- User registration and JWT authentication (djangorestframework-simplejwt) +- AES-256 file encryption, RSA-2048 per-user key pairs, HMAC-SHA256 integrity checks +- Upload, download, and delete endpoints (`/api/files/`) +- Local storage implemented; Firebase and S3 hooks included but not wired up +- Activity logging of file and auth operations -## Quick setup (development) +## Setup -1. Create virtual environment and activate +Requires Python 3. From the repository root: -```powershell +```bash python -m venv venv -.\venv\Scripts\Activate.ps1 -``` - -2. Install backend dependencies - -```powershell +source venv/bin/activate # Windows: .\venv\Scripts\Activate.ps1 pip install -r backend/requirements.txt ``` -3. Setup env +Configuration is read from environment variables (optionally via a `.env` +file next to `manage.py`): `DJANGO_SECRET_KEY`, `DJANGO_DEBUG`, +`DJANGO_ALLOWED_HOSTS`, and `POSTGRES_*` for PostgreSQL. Defaults use +SQLite with debug on, so no configuration is needed for development. -```powershell -copy backend/sfs_backend/.env.example backend/sfs_backend/.env -# edit .env if needed -``` - -4. Apply migrations and create superuser - -```powershell -cd backend/sfs_backend +```bash +cd backend/backend/sfs_backend python manage.py migrate python manage.py createsuperuser -``` - -5. Run server - -```powershell python manage.py runserver ``` -Access: +Then open: - API root: http://127.0.0.1:8000/api/ - Frontend: http://127.0.0.1:8000/login.html - Admin: http://127.0.0.1:8000/admin/ -## Production notes - -- Set `DJANGO_DEBUG=False` and configure `POSTGRES_*` env vars for PostgreSQL -- Use a secure `DJANGO_SECRET_KEY` and handle FILE master key -- Configure proper CORS origins -- Serve static files with WhiteNoise or from a CDN - -## Project layout - -(see project description in your IDE) - ## Tests -Run tests with - -```powershell -cd backend/sfs_backend +```bash +cd backend/backend/sfs_backend python manage.py test ``` +## Production notes -### Information Security Project – 3rd Semester -**Under the supervision of Sir Khalid Mehmood** - ---- - -## 👥 Project Team -- **Moavia Amir** -- **Mirza Muhammad Dawood** -- **Arslan Nasir** -- **Ali Raza** - ---- - -## 📌 Project Overview - -**SFS (Secure File System)** is a professional-grade, zero-knowledge encrypted file storage and sharing platform developed as part of the **Information Security course (3rd Semester)**. - -The system utilizes the browser’s native **WebCrypto API** to perform **client-side encryption**, ensuring that all data is encrypted before being transmitted or stored. At no point are plaintext files or private cryptographic keys exposed to the server. - ---- - -## 🚀 Deployment Guide - -### 1. Prepare GitHub Repository -- Initialize the repository: - ```bash - git init - ``` - -### 2. Vercel Deployment (Recommended) -- Connect the GitHub repository to **Vercel** -- Set the environment variable `API_KEY` with your **Google AI Studio API key** -- The project auto-configures using the included `vercel.json` - -### 3. Netlify Deployment -- Connect the GitHub repository to **Netlify** -- Set the `API_KEY` in **Site Settings → Environment Variables** -- Routing and security headers are managed using `netlify.toml` and `_redirects` - ---- - -## 🛡️ Security Specifications -- **Symmetric Encryption**: AES-256-GCM (file content encryption) -- **Asymmetric Encryption**: RSA-2048-OAEP (secure key wrapping) -- **Hash Algorithm**: SHA-256 (data integrity verification) -- **Zero-Knowledge Architecture**: - - No plaintext files stored - - No private keys transmitted - - No sensitive data exposed on the server - ---- - -## 🛠️ Key Features -- **Identity Provisioning**: Automatic RSA key-pair generation during user registration -- **Secure File Sharing**: RSA-based key re-encryption for authorized recipients -- **Neural Security Logic**: Gemini-3-Flash integration for cryptographic analysis -- **Immutable Audit Logging**: Real-time logging of security-sensitive operations - ---- - +- Set `DJANGO_DEBUG=False` and the `POSTGRES_*` variables for PostgreSQL +- Use a strong `DJANGO_SECRET_KEY` and protect the file master key +- Restrict CORS origins and serve static files with WhiteNoise or a CDN -© 2025 **Coding Moves – Engineering Branch** -Developed for academic purposes under the **Information Security curriculum**. +## Credits +Information Security course project, 3rd semester, under the supervision of +Sir Khalid Mehmood. Team: Moavia Amir, Mirza Muhammad Dawood, Arslan Nasir, +Ali Raza. Coding Moves, Engineering Branch, 2025.