DEVELOPERS
Navigating the Architecture
graph LR
A[Start] --> B{Scan location specified?};
B --> |Yes| C[Start scan];
C --> |Start Loop| D[File found];
D --> E[Create Hash];
E --> F[Compare Hash];
F --> G{Hash found in DB?};
G --> |Yes| H[Flag as Malware];
G --> |No| I[Flag as Safe];
H & I --> J[Continue iteration];
J --> K{Last file?};
K --> |Yes| L[Stop scanner];
L --> M[Display Results];
K --> |No| N[Start again];
N --> D;
B --> |No| O[Stop]
Raspirus is structured into two integral components: frontend and backend. These components, built using distinct languages and frameworks, are interconnected via a third-party framework called Tauri. This framework not only facilitates communication between the frontend and backend but also enables us to incorporate Rust functions into the frontend. Furthermore, Tauri empowers the distribution of Raspirus across various operating systems.
Starting Your Development Journey
- Clone the repository
- Install Tauri and Prerequisites
- Install npm
- Install Next.js with
npm install next@latest react@latest react-dom@latest
- Install npm dependencies with:
npm i
- Start development with
cargo tauri dev
- or build Raspirus with
cargo tauri build
- Clone the Repository
- Execute
make install
- Run the application with
raspirus
- Clone the repository
- Install Tauri and Prerequisites
- Install npm
- Install Next.js with
npm install next@latest react@latest react-dom@latest
- Install npm dependencies with:
npm i
- Start development with
cargo tauri dev
- or build Raspirus with
cargo tauri build
Should you encounter any hiccups during your initial run or build, ensure that you've followed each step diligently. Confirm the accurate creation of both logs and config files.
Exploring the Backend
classDiagram
Main <|-- DBOps
Main <|-- Configs
Main <|-- FileLogs
Main <|-- Scanner
Main: +Config config_file
class DBOps {
+Connection db_conn
+String db_file
+TauriWindow t_win
+new()
+update_db()
+hash_exists()
}
class Configs {
+Data data
+new()
+save()
+load()
}
class FileLogs {
+File file
+log()
+create_file()
}
class Scanner {
+String scan_loc
+DbOps db_ops
+Vec malware_list
+search_files()
+create_hash()
+get_folder_size()
}
The backend, an essential cog in the Raspirus machinery, is meticulously crafted in Rust for superior performance. The primary file houses functions accessible from the frontend, which must yield JSON-compatible outcomes. For a detailed breakdown, reference the graph above outlining the backend's modular arrangement.
Unpacking the Frontend
Our frontend, developed with JavaScript via the Next.js framework, emphasizes user-friendliness and functionality. Comprising components and pages, it mirrors the simplicity and robustness of Next.js. Refer to the illustrated graph above for an approximate visual representation of the frontend's architecture.
Evaluating Test Coverage
- Backend tests, authored in Rust, can be executed via the
cargo test
command. Access these tests in the tests directory. Check test coverage on Codecov. - Frontend tests, created with Selenium, are currently in development.
Thank you for your interest in contributing to Raspirus's development. Your expertise fuels our progress.