diff --git a/Dockerfile b/Dockerfile
index b7627cb8..c8d5ecbf 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -9,7 +9,7 @@ RUN npm ci
# This is where because may be the case that you would try
# to build the app based on some `X_TAG` in my case (Git commit hash)
# but the code hasn't changed.
-FROM node:lts AS builder
+FROM node:18 AS builder
WORKDIR /opt/app
COPY . .
diff --git a/README.md b/README.md
index d8347dde..c9856228 100644
--- a/README.md
+++ b/README.md
@@ -1,22 +1,25 @@
-
# Fairdrive
+
At the intersection of innovation, interoperability, and decentralization, Fairdrive emerges for the cause of fair data. This initiative, driven by the community, is dedicated to promoting freedom. By facilitating decentralized storage, it allows developers to construct interoperable, decentralized, and open-source dApps. This, in turn, enables users to regain their privacy, assume ownership of their data, and control their digital identity.
[Login here](https://app.fairdrive.fairdatasociety.org)
### What is Fairdrive
-Fairdrive is a decentralized application (dApp) that facilitates distributed storage on the Swarm network. It features a "Drive" interface for managing pods, files and folders. Internally, Fairdrive uses Fair Data Protocol, which is built on top of Ethereum Swarm.
+Fairdrive is a decentralized application (dApp) that facilitates distributed storage on the Swarm network. It features a "Drive" interface for managing pods, files and folders. Internally, Fairdrive uses Fair Data Protocol, which is built on top of Ethereum Swarm.
### Why Fairdrive
+
#### Pros
+
- **Data Encryption**: Fairdrive encrypts all data by default, providing an additional layer of security for your files.
- **Data Ownership**: Unlike traditional cloud storage services, where your data is technically owned by the service provider, with Fairdrive, you are the sole owner of your data.
- **Decentralized Storage**: Fairdrive stores data on the Swarm decentralized network. This means your data isn't stored in a single location, but is distributed across multiple nodes, enhancing data security and reliability.
- **User Control**: Only you have access to your data. You control who can access your data and how it's used.
#### Cons
+
- **Speed**: Due to its decentralized nature, Fairdrive can be slower than traditional cloud storage services. This is because data isn't stored in a single location, but is distributed across multiple nodes in the Swarm network. As a result, it can take longer to retrieve data.
- **Learning Curve**: As a decentralized application (dApp), Fairdrive might have a steeper learning curve for users who are not familiar with blockchain technology and decentralized networks.
- **Dependence on Swarm Network**: The performance and reliability of Fairdrive are dependent on the Swarm network. If there are issues with the network, it could affect the availability and performance of Fairdrive.
@@ -24,15 +27,17 @@ Fairdrive is a decentralized application (dApp) that facilitates distributed sto
## Getting Help
-If you need help using Fairdrive as user, check out [User Guide](docs/USER-GUIDE.md) and [FAQ](docs/FAQ.md). See [Getting Started](docs/GETTING-STARTED.md).
-Technical overview of [Design](docs/DESIGN.md), [Functionality](docs/FUNCTIONALITY.md) and [Architecture](docs/ARCHITECTURE.md).
+If you need help using Fairdrive as user, check out [User Guide](docs/USER-GUIDE.md) and [FAQ](docs/FAQ.md). See [Getting Started](docs/GETTING-STARTED.md).
+Technical overview of [Design](docs/DESIGN.md), [Functionality](docs/FUNCTIONALITY.md) and [Architecture](docs/ARCHITECTURE.md).
If you can't find the answer to your question, feel free to [contact us](docs/CONTACT.md).
## Development
+
See [**Development instructions**](docs/DEVELOPMENT.md) for information how to install and develop on local machines.
## Join Us in Building Fairdrive
+
Fairdrive is a community-driven initiative, and we welcome contributions from anyone who shares our vision for a decentralized, user-controlled digital world. Whether you're a developer, a designer, a writer, or just someone who's interested in what we're doing, there are many ways you can contribute to Fairdrive.
If you're a developer, you can help us improve the Fairdrive application by fixing bugs, adding new features, or improving our documentation. Check out our [open issues](https://github.com/fairDataSociety/fairdrive-theapp/issues) to see what we're currently working on.
@@ -47,8 +52,8 @@ We believe that everyone has something valuable to contribute, and we're committ
Together, we can make Fairdrive the best it can be!
-
## Development Stage Notice for Fairdrive
+
Please be aware that Fairdrive is currently in its development stage. This means that the application is still undergoing substantial updates, modifications, and improvements. As a result, certain functionalities may change, be added, or removed without prior notice.
During this development stage, there's also a risk of data loss. While we strive to ensure the integrity and security of all data stored on Fairdrive, the decentralized nature of the application and the ongoing development work mean that we cannot guarantee complete data preservation.
@@ -64,4 +69,4 @@ We strongly recommend that you keep backups of any critical data you store on Fa
- **Testnet**: https://app.fairdrive.fairdatasociety.org
- **Development**: https://app.fairdrive.dev.fairdatasociety.org
-Current testnet deployment is on: Sepolia.
\ No newline at end of file
+Current testnet deployment is on: Sepolia.
diff --git a/docs/USER-GUIDE.md b/docs/USER-GUIDE.md
index b75c14ed..0a3163fa 100644
--- a/docs/USER-GUIDE.md
+++ b/docs/USER-GUIDE.md
@@ -19,38 +19,45 @@ Welcome to the Fairdrive User Guide! This guide will walk you through all the fe
To use Fairdrive, you'll need to create an account using any of below options. Here's how:
#### 1. Using Metamask
+
1. Click Connect
-2. Select Metamask
-3. Type passphrase
-4. Connect Metamask to site with your preffered account
+2. Select Metamask
+3. Type passphrase
+4. Connect Metamask to site with your preferred account
5. Sign Message
#### 2. Using FDP Portable account
+
1. Go to the Fairdrive website.
2. Click on the "Register New Account" button.
3. Fill out the registration form with your details.
4. When you finish procedure your FDP account will be ready
-4. Login into Fairdrive using your username/password
+5. Login into Fairdrive using your username/password
#### 3. Using Bloosom extension
+
1. Make sure you are logged in inside Blossom extension
2. Click Connect
3. Select Blossom
4. Allow Fairdrive full access of your personal storage
## Logging In
+
**Metamask** account:
+
1. Click Connect
2. Enter passphrase
-3. Sign message
+3. Sign message
**FDP Portable account** to log in to Fairdrive:
+
1. Go to the Fairdrive website.
2. Click on the "Log In" button.
3. Enter your username and password.
4. Click "Submit" to log in.
## Account Migration
+
You have the option to transition your Metamask-created Lite account to an FDP Portable account. This transition enables you to utilize a username/password combination to access your data from mobile devices or other devices where Metamask isn't installed. Your Lite account will be connected with your new Portable account.
During this transition process, you'll be given a new mnemonic. It's crucial to note this down and keep it in a secure location, as it will serve as your mnemonic for your Portable account recovery.
@@ -59,6 +66,7 @@ During this transition process, you'll be given a new mnemonic. It's crucial to
## Manage Your Profile
You can view your profile information at any time:
+
1. Click on Blockie in the top right corner of the screen.
2. Dropdown menu will display available options.
@@ -99,15 +107,13 @@ To search your pods, files, and directories:
To change the theme of Fairdrive:
-1. Click on Blockie in the top right corner of the screen.
+1. Click on Blockie in the top right corner of the screen.
2. Click Theme Toggle.
## Getting Help
-## Getting Help
-
-If you need help using Fairdrive, check out our [User Guide](USER-GUIDE.md) and [FAQ](FAQ.md).
-Start [here](GETTING-STARTED.md) or see [Design](DESIGN.md), [Functionality](FUNCTIONALITY.md) or [Architecture](ARCHITECTURE.md).
+If you need help using Fairdrive, check out our [User Guide](USER-GUIDE.md) and [FAQ](FAQ.md).
+Start [here](GETTING-STARTED.md) or see [Design](DESIGN.md), [Functionality](FUNCTIONALITY.md) or [Architecture](ARCHITECTURE.md).
Developers can check [Development Instructions](DEVELOPMENT.md).
If you can't find the answer to your question, feel free to [contact us](CONTACT.md).
diff --git a/package-lock.json b/package-lock.json
index 699ae0c4..73874493 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -12,7 +12,7 @@
"@emotion/react": "^11.4.1",
"@emotion/styled": "^11.3.0",
"@fairdatasociety/blossom": "^0.5.0",
- "@fairdatasociety/fdp-storage": "^0.11.0",
+ "@fairdatasociety/fdp-storage": "^0.13.0",
"@headlessui/react": "^1.7.14",
"@metamask/sdk": "^0.5.6",
"@types/react-blockies": "^1.4.1",
@@ -3055,21 +3055,37 @@
"@fairdatasociety/fdp-storage": "^0.11.0"
}
},
+ "node_modules/@fairdatasociety/blossom/node_modules/@fairdatasociety/fdp-storage": {
+ "version": "0.11.0",
+ "resolved": "https://registry.npmjs.org/@fairdatasociety/fdp-storage/-/fdp-storage-0.11.0.tgz",
+ "integrity": "sha512-Na56ZOmb2cBpm1Z4RaIn0ASJXlLrN/FBg3IfI9ExPDBVxd1jdeMg7P4YY2pQkHRp3fKOtHK/bB4v0nB+tHZIKQ==",
+ "dependencies": {
+ "@ethersphere/bee-js": "^6.2.0",
+ "@fairdatasociety/fdp-contracts-js": "^3.7.1",
+ "crypto-js": "^4.1.1",
+ "ethers": "^5.5.2",
+ "js-sha3": "^0.8.0"
+ },
+ "engines": {
+ "node": ">=16.0.0",
+ "npm": ">=8.0.0"
+ }
+ },
"node_modules/@fairdatasociety/fdp-contracts-js": {
- "version": "3.7.1",
- "resolved": "https://registry.npmjs.org/@fairdatasociety/fdp-contracts-js/-/fdp-contracts-js-3.7.1.tgz",
- "integrity": "sha512-G1TMIAJPIsfxEvubZh2qiiQb4XJx07jdmwUIvBNR2+PCdN2KnCNYQo1b4xkSFxk8BzY7hnXtricmIlNUmv3N0w==",
+ "version": "3.8.0",
+ "resolved": "https://registry.npmjs.org/@fairdatasociety/fdp-contracts-js/-/fdp-contracts-js-3.8.0.tgz",
+ "integrity": "sha512-Lfr/kxCBZ4IYWwAkeRa2fSi9suYd5DxTG5xunfuwMm32FeB99fL7tI19sb5tjPyRj6bphJPaRWmFCdPJ+yfZsg==",
"peerDependencies": {
"ethers": ">=5.6.4"
}
},
"node_modules/@fairdatasociety/fdp-storage": {
- "version": "0.11.0",
- "resolved": "https://registry.npmjs.org/@fairdatasociety/fdp-storage/-/fdp-storage-0.11.0.tgz",
- "integrity": "sha512-Na56ZOmb2cBpm1Z4RaIn0ASJXlLrN/FBg3IfI9ExPDBVxd1jdeMg7P4YY2pQkHRp3fKOtHK/bB4v0nB+tHZIKQ==",
+ "version": "0.13.0",
+ "resolved": "https://registry.npmjs.org/@fairdatasociety/fdp-storage/-/fdp-storage-0.13.0.tgz",
+ "integrity": "sha512-7AWAC/enq1SQCisMuD3wT5cKSOxe8KdC5f3nolWcruCUpdWcwe65YtjDeL88m/E/kcituQGAl2IgWGkqoysB/g==",
"dependencies": {
"@ethersphere/bee-js": "^6.2.0",
- "@fairdatasociety/fdp-contracts-js": "^3.7.1",
+ "@fairdatasociety/fdp-contracts-js": "^3.8.0",
"crypto-js": "^4.1.1",
"ethers": "^5.5.2",
"js-sha3": "^0.8.0"
@@ -24969,21 +24985,35 @@
"integrity": "sha512-IoKkn2GEuD95yJ763AWuUA153oZEjKH5DOJgGTf48QFkiyuLlLc1OCGveh9tj5fE0LavK0M78x4ZqMKVlmT8BQ==",
"requires": {
"@fairdatasociety/fdp-storage": "^0.11.0"
+ },
+ "dependencies": {
+ "@fairdatasociety/fdp-storage": {
+ "version": "0.11.0",
+ "resolved": "https://registry.npmjs.org/@fairdatasociety/fdp-storage/-/fdp-storage-0.11.0.tgz",
+ "integrity": "sha512-Na56ZOmb2cBpm1Z4RaIn0ASJXlLrN/FBg3IfI9ExPDBVxd1jdeMg7P4YY2pQkHRp3fKOtHK/bB4v0nB+tHZIKQ==",
+ "requires": {
+ "@ethersphere/bee-js": "^6.2.0",
+ "@fairdatasociety/fdp-contracts-js": "^3.7.1",
+ "crypto-js": "^4.1.1",
+ "ethers": "^5.5.2",
+ "js-sha3": "^0.8.0"
+ }
+ }
}
},
"@fairdatasociety/fdp-contracts-js": {
- "version": "3.7.1",
- "resolved": "https://registry.npmjs.org/@fairdatasociety/fdp-contracts-js/-/fdp-contracts-js-3.7.1.tgz",
- "integrity": "sha512-G1TMIAJPIsfxEvubZh2qiiQb4XJx07jdmwUIvBNR2+PCdN2KnCNYQo1b4xkSFxk8BzY7hnXtricmIlNUmv3N0w==",
+ "version": "3.8.0",
+ "resolved": "https://registry.npmjs.org/@fairdatasociety/fdp-contracts-js/-/fdp-contracts-js-3.8.0.tgz",
+ "integrity": "sha512-Lfr/kxCBZ4IYWwAkeRa2fSi9suYd5DxTG5xunfuwMm32FeB99fL7tI19sb5tjPyRj6bphJPaRWmFCdPJ+yfZsg==",
"requires": {}
},
"@fairdatasociety/fdp-storage": {
- "version": "0.11.0",
- "resolved": "https://registry.npmjs.org/@fairdatasociety/fdp-storage/-/fdp-storage-0.11.0.tgz",
- "integrity": "sha512-Na56ZOmb2cBpm1Z4RaIn0ASJXlLrN/FBg3IfI9ExPDBVxd1jdeMg7P4YY2pQkHRp3fKOtHK/bB4v0nB+tHZIKQ==",
+ "version": "0.13.0",
+ "resolved": "https://registry.npmjs.org/@fairdatasociety/fdp-storage/-/fdp-storage-0.13.0.tgz",
+ "integrity": "sha512-7AWAC/enq1SQCisMuD3wT5cKSOxe8KdC5f3nolWcruCUpdWcwe65YtjDeL88m/E/kcituQGAl2IgWGkqoysB/g==",
"requires": {
"@ethersphere/bee-js": "^6.2.0",
- "@fairdatasociety/fdp-contracts-js": "^3.7.1",
+ "@fairdatasociety/fdp-contracts-js": "^3.8.0",
"crypto-js": "^4.1.1",
"ethers": "^5.5.2",
"js-sha3": "^0.8.0"
diff --git a/package.json b/package.json
index d3c19caa..f1cd9020 100644
--- a/package.json
+++ b/package.json
@@ -25,7 +25,7 @@
"@emotion/react": "^11.4.1",
"@emotion/styled": "^11.3.0",
"@fairdatasociety/blossom": "^0.5.0",
- "@fairdatasociety/fdp-storage": "^0.11.0",
+ "@fairdatasociety/fdp-storage": "^0.13.0",
"@headlessui/react": "^1.7.14",
"@metamask/sdk": "^0.5.6",
"@types/react-blockies": "^1.4.1",
diff --git a/src/@types/fdp-storage.d.ts b/src/@types/fdp-storage.d.ts
new file mode 100644
index 00000000..98964aac
--- /dev/null
+++ b/src/@types/fdp-storage.d.ts
@@ -0,0 +1,13 @@
+import type {
+ DirectoryItem as FdpDirectoryItem,
+ FileItem as FdpFileItem,
+} from '@fairdatasociety/fdp-storage';
+
+declare module '@fairdatasociety/fdp-storage' {
+ interface DirectoryItem extends FdpDirectoryItem {
+ path?: string;
+ }
+ interface FileItem extends FdpFileItem {
+ path?: string;
+ }
+}
diff --git a/src/api/directory.ts b/src/api/directory.ts
index 7b09f900..e9980284 100644
--- a/src/api/directory.ts
+++ b/src/api/directory.ts
@@ -13,7 +13,10 @@ export async function createDirectory(
directory = '';
}
- await fdp.directory.create(podName, combine(directory, directoryName));
+ await fdp.directory.create(
+ podName,
+ combine(...directory.split('/'), directoryName)
+ );
const time = getUnixTimestamp();
return {
name: directoryName,
diff --git a/src/api/files.ts b/src/api/files.ts
index 8b87ae39..99ace5d3 100644
--- a/src/api/files.ts
+++ b/src/api/files.ts
@@ -1,4 +1,8 @@
-import { FdpStorage, FileItem } from '@fairdatasociety/fdp-storage';
+import {
+ FdpStorage,
+ FileItem,
+ UploadProgressInfo,
+} from '@fairdatasociety/fdp-storage';
import { formatUrl } from '@utils/url';
interface DownloadFileData {
@@ -78,7 +82,8 @@ export async function shareFile(
export async function uploadFile(
fdp: FdpStorage,
- data: UploadFileData
+ data: UploadFileData,
+ progressCallback?: (info: UploadProgressInfo) => void
): Promise {
const writePath =
data.directory === 'root' ? '' : '/' + formatUrl(data.directory);
@@ -87,7 +92,8 @@ export async function uploadFile(
const fileMetadata = await fdp.file.uploadData(
data.podName,
`${writePath}/${data.file.name}`,
- fileBytes
+ fileBytes,
+ progressCallback && { progressCallback }
);
// todo remove this when fdp-storage implements this https://github.com/fairDataSociety/fdp-storage/issues/229
diff --git a/src/api/pod.ts b/src/api/pod.ts
index 195fe655..3e0cb8a9 100644
--- a/src/api/pod.ts
+++ b/src/api/pod.ts
@@ -29,6 +29,10 @@ export function getFdpPathByDirectory(directory: string): string {
return '/';
}
+ if (directory.startsWith('/')) {
+ return directory;
+ }
+
return '/' + directory;
}
diff --git a/src/components/Buttons/MainSideBarItem/MainSideBarItem.tsx b/src/components/Buttons/MainSideBarItem/MainSideBarItem.tsx
index 1e3dac34..1de43878 100644
--- a/src/components/Buttons/MainSideBarItem/MainSideBarItem.tsx
+++ b/src/components/Buttons/MainSideBarItem/MainSideBarItem.tsx
@@ -18,13 +18,19 @@ interface MainSideBarItemProps {
label: string;
link: string;
driveSideBarToggle: any;
+ onClick?: () => void;
+ className?: string;
}
+const DRIVE_PATH = '/drive';
+
const MainSideBarItem: FC = ({
icons,
label,
link,
driveSideBarToggle,
+ onClick,
+ className,
}) => {
const { theme } = useContext(ThemeContext);
@@ -39,27 +45,28 @@ const MainSideBarItem: FC = ({
}, [link]);
useEffect(() => {
- if (router.pathname === '/drive') {
+ if (router.pathname === DRIVE_PATH) {
driveSideBarToggle();
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return (
-