A Next.js 14 application that leverages machine learning models to detect malicious code in uploaded files, featuring a FastAPI backend.
The Malicious Code Scanner is a robust web app developed using Next.js and FastAPI, designed to enable users to upload files in various formats and scan for potential malicious code. It features a user-friendly, dashboard-like UI for selecting models, monitoring upload progress, and displaying scan results. This tool is ideal for developers and security teams needing quick, reliable file safety assessments using custom AI/ML models.
The Python/FastAPI backend handles the AI/ML models, seamlessly integrated with the Next.js frontend through /api/
endpoints. File uploads trigger model-based scans, with results presented in a structured dashboard format.
The integration is facilitated through next.config.js
rewrites, routing requests to /api/py/:path*
directly to FastAPI.
Locally, the FastAPI server runs at 127.0.0.1:8000
, while in production, it operates as serverless Python functions on Vercel.
Explore the live demo here: Malicious Code Scanner
Clone & deploy it to Vercel in one click:
Set up the repository with:
npx create-next-app malicious-code-scanner --example "https://github.com/vanthaita/IE105-Malicious-Code-Scanner.git"
python3 -m venv venv
source venv/bin/activate
For the frontend, run:
npm install
# or
yarn
# or
pnpm install
For the backend, install Python packages listed in requirements.txt
.
Start the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
Access the app at http://localhost:3000, with the FastAPI backend running at http://127.0.0.1:8000. Update the port in package.json
and next.config.js
as needed.
- File Uploads: Supports PDF and other common file formats.
- Model Selection: Allows users to choose from multiple models (in
.h5
format) for scanning. - Progress & Results Display: Visualize scan progress and results in a dashboard format with graphical displays.
For further resources, check out:
We welcome your feedback and contributions via our GitHub repository!