Swinburne University of Technology
The following GitHub Repository contains a Full-Stack Web Deployment for SPAM Detection in Cybersecurity Scenarios - curated for purpose of assessment of the Computing Technology Innovation Project course COS30049.
- Datasets
- Data Processing
- Machine Learning Model/Algorithms
Fast APIIntegrationNode.js/ReactApplication- Running Specifications
To run the Frontend Application you will need Node.js installed on your machine to host the development server. Additionally you will need Python to install the library dependencies for the interactive features and localhost required to access the Fast API Backend.
| UI | Description |
|---|---|
![]() |
This is a sample of the SPAM Detection application user interface. |
(i) You can install the following libraries by running the commands in the terminal of your preferred IDE once
Pythonis installed:
| Python Libraries | Node Package Manger |
|---|---|
pip install pip fastapi |
npm install plotly.js-dist-min |
pip install uvicorn |
npm install (Configuration check) |
pip install joblib |
- |
pip install scikit-learn |
- |
pip install scipy |
- |
pip install pydantic |
- |
Once installed you will need to run both the Frontend and Backend servers before viewing the application - starting with the Frontend.
- cd into the
frontendfolder of the project directory via the IDE terminal. - Run:
npm start
This will take a couple seconds to initialize. The page will automatically open in the browser when complete.
- Open a new Terminal. cd into the
backendfolder. - Run:
uvicorn main:app --reload
This will take a couple seconds to initialize. Once the '
Application startup complete.' prints to the terminal the API is active in the Web Application.
The Application is now functional for testing with email inputs. To close the application simply close the IDE.
NOTICE: If you experience an error: ['react-scripts' is not recognized as an internal or external command, operable program or batch file.] after running
npm start. You will need to change yourExecution PolicyviaWindow's PowerShellin Administrative Mode, to '[A] Yes to All' (Allow trusted scrips to run). Command:set-executionpolicy remotesigned. Please be advised *the execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose you to the security risks.
The following Machine Leaning Models were developed using Python therefore you will need to install the Python Environment before accessing the model. Additionally you will need to configure and install the dependency's as follows.
(i) You can install the following libraries by running the commands in the terminal of your preferred IDE once
Pythonis installed:
pip install matplotlibpip install pandaspip install joblibpip install scipypip install scikit-learnpip install numpy
Once the dependencies are installed you have the option of training two models. To train a model open the terminal and cd into the project directory in your computer, then run the following:
dataRegression.py(A Regression based algorithm) Command:python dataRegression.pydataClassification.py(A Decision Tree Classification algorithm) Command:python dataClassification.py
NOTE: Once successful the terminal will output the results and evaluations in a text string, while the
matplotliblibrary will open graphical data visualizations in a separate window. On closing the visualizations the model will serialize itself into the 'models' directory and exit, from the serialized model data predictions can be tested via the Web Application Interface.
Example Outputs:
| Confusion Matrix | Distribution Graph |
|---|---|
![]() |
![]() |
- Ameer Musharraf Noor Musaddik |
104841025 - Ashraf Anwar |
105397820 - Eloise Ridder-Strickland |
104934718


