This project implements a simple Distributed File System (DFS) with a server-client-replica architecture. The system is designed for basic distributed file management, ensuring availability by replicating files across multiple servers.
- User authentication: Login and registration for clients.
- File operations:
- Upload files to the system.
- Download files, with automatic fallback to replicas in case of unavailability on the main server.
- Delete files, ensuring removal from all replicas.
- File listing: Retrieve a list of available files.
- Replica management:
- Distribute files to replicas for redundancy.
- Handle requests to fetch files from replicas when needed.
- Connects to the
MainServerand sends heartbeat notifications to confirm availability. - Regularly synchronizes its data with the
MainServer. - If the
MainServerbecomes unresponsive:- Attempts to connect to known replicas.
- Assumes the role of a server, providing availability and updating other replicas as needed.
- Synchronize files with the main server.
- Serve as backup storage for file retrieval when the other ones is unavailable.
- Handle file deletion requests from the main server.
- Easy-to-use commands for interacting with the DFS:
- File upload, download, and deletion.
- Fetch a list of files.
- For each user, an administrator can assign read (r), write (w), and delete (d) permissions. These permissions determine which actions can be performed on visible files.
- Administrators can create or modify user groups and assign users to these groups.
- Administrators can promote users to administrators, granting them access to management functions.
- In case of need, administrators can remove a user's account from the system.
- Programming Language: C++ with Qt framework.
- Database: SQLite.
- Qt Core and Network modules (e.g.,
QTcpServer,QTcpSocket). - Qt SQL module for database integration.
-
Individual Builds:
Navigate to the desired subproject directory (e.g.,MainServer,FollowerServer,ReplicaServer, orDFS) and runbuild.batto compile the project for that specific part. -
Build All at Once:
Alternatively, you can build the entire system at once by using thebuild.batscript located in the root of the repository. Running this script will:- Compile each part of the system (MainServer, FollowerServer, ReplicaServer, and DFS) individually.
- All binaries will be placed in the
build_ninjadirectory, with separate folders for each subproject, containing the corresponding executable files (MainServer.exe,FollowerServer.exe,ReplicaServer.exe, andDFS.exe).
- After building, locate the
build_ninjafolder in the root directory. - Inside the
build_ninjafolder, you will find individual folders for each subproject. - Run the respective executable files (
MainServer.exe,FollowerServer.exe,ReplicaServer.exe, orDFS.exe) from their corresponding subfolder.
- Start the main server and replicas first to ensure proper system initialization.
- Launch the client application to interact with the DFS.
- After starting the servers, log in to the
DFSclient application and create a new user. - Then log in with the credentials
admin(username) and!For@each(password). - Assign the newly created user as an administrator to give them access to management functions.
- For security purposes, delete the old administrator account after the new admin account is set up.
- Once the new administrator is in place, you can grant permissions and provide access to other participants.