A file-sharing system with a name inspired by Leah Dou‘s「同一片天空下」
Using drogon that is a C++17/20 based HTTP application framework as the back end. And the front end is Vue3.
- Upload and Download files.
- Share files with others.
- Export files information.
- Get information of users and files.(Admin)
- Modify user information and delete files. (Admin)
You should move ./examples/config.json
to ./config.json
and modify your password of database.
And you can config more details on config.json, such as the maximun of file and the port of database.
docker pull drogonframework/drogon
docker pull mariadb
docker network create cloud
docker run -d --network cloud -v /real/path/to/mariadb:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=your-password -it -p 3306:3306 mariadb:latest
docker exec -it the-id-of-mariadb mariadb -u root -p
docker ps
docker inspect the-id-of-mariadb
Make sure that the IPAddress is equal to the host of db_clients in config.json.
CREATE TABLE drogon.fileOfUser (
userId INT NOT NULL,
fileId INT NOT NULL,`path` varchar(100) NOT NULL,fileName varchar(100) NOT NULL,
`time` DATETIME NOT NULL,fileSize INT NOT NULL, folderId int not null,
CONSTRAINT fileOfUser_PK PRIMARY KEY (userId,fileId)
)
ENGINE=InnoDB
DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_general_ci;
CREATE TABLE drogon.share (shareId INT auto_increment NOT NULL,
userId INT NOT NULL,
fileId INT NOT NULL,
`time` DATETIME NOT NULL, code varchar(10) NOT NULL,
CONSTRAINT share_PK PRIMARY KEY (shareId)
)
ENGINE=InnoDB
DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_general_ci;
CREATE TABLE drogon.folderOfUser (
folderId INT NOT NULL,
userId int not null,
CONSTRAINT folderOfUser_PK PRIMARY KEY (folderId, userId)
)
ENGINE=InnoDB
DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_general_ci;
CREATE TABLE drogon.file (
id INT auto_increment NOT NULL,
MD5 varchar(100) NOT NULL,
fileExtension varchar(100) NOT NULL,
CONSTRAINT file_PK PRIMARY KEY (id)
)
ENGINE=InnoDB
DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_general_ci;
CREATE TABLE drogon.`user` (
id INT auto_increment NOT NULL,
userName varchar(100) NOT NULL,
passWord varchar(100) NOT NULL,
permissions INT NOT NULL,
capacity DOUBLE NOT NULL,
remaining DOUBLE NOT NULL,
CONSTRAINT user_PK PRIMARY KEY (id)
)
ENGINE=InnoDB
DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_general_ci;
CREATE TABLE drogon.folder (
folderId INT auto_increment NOT NULL,
folderName varchar(100) NOT NULL,
fatherFolderId int not null,
CONSTRAINT folder_PK PRIMARY KEY (folderId)
)
ENGINE=InnoDB
DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_general_ci;
docker run -p 5555:5555 -v /real/path/to/share-the-sky:/data/drogon --network cloud -it drogonframework/drogon
cd /data/drogon/relative/path/to/project/build
cmake ..
./stk
http://localhost:8080/login
see more ip and port on front end
- breakpoint transmission