This project is a decentralized file storage system that leverages blockchain technology and distributed storage solutions. It aims to provide secure, transparent, and efficient file management capabilities.
- User Authentication
- File Upload and Storage
- File Retrieval
- File Sharing
- File Transfer
- File Deletion
- File History Tracking
- Blockchain Integration for File Metadata
- Distributed Storage using Storj
- Backend: Node.js with Express.js
- Database: MongoDB
- Blockchain: Ethereum (Sepolia testnet)
- Smart Contracts: Solidity
- Distributed Storage: Storj
- File Handling: Multer
- Authentication: JWT
- Environment Variables: dotenv
backend/
├── config.env
├── contracts/
│ └── FileRegistry.sol
├── controllers/
│ ├── FileController.js
│ └── UserController.js
├── models/
│ ├── File.js
│ └── User.js
├── routes/
│ ├── FileRoutes.js
│ └── UserRoutes.js
├── scripts/
│ └── deploy.js
├── utils/
│ ├── authorization.js
│ ├── blockchainUtils.js
│ └── storj.js
├── db_connection.js
└── server.js
This project is currently in active development. Features are being implemented and tested. The current focus is on:
- Completing and testing all API endpoints
- Enhancing blockchain integration
- Improving error handling and security measures
- Implementing front-end interface (planned)
- POST
/user/signup
: Create a new user - POST
/user/login
: User login - GET
/user/profile
: Get user profile (authenticated) - PUT
/user/:id
: Update user profile (authenticated) - GET
/user/logout
: User logout (authenticated)
- POST
/file/upload
: Upload a file (authenticated) - GET
/file/:id
: Retrieve a file by ID - POST
/file/share
: Share a file with another user - POST
/file/transfer
: Transfer file ownership - GET
/file/history/:id
: Get file history - DELETE
/file/:id
: Delete a file
The FileRegistry
smart contract (located in contracts/FileRegistry.sol
) manages file metadata on the blockchain. It includes functions for:
- Uploading files
- Deleting files
- Updating file access
- Transferring file ownership
- Retrieving file information
- Checking file access permissions
Blockchain utilities are implemented in utils/blockchainUtils.js
, providing functions to interact with the smart contract for various file operations.
File storage is handled using Storj, with utility functions in utils/storj.js
for uploading and retrieving files.
MongoDB is used for storing user information and additional file metadata. Database connection is managed in db_connection.js
.
JWT-based authentication is implemented, with middleware for checking user authentication and authorization in utils/authorization.js
.
- Implement file encryption
- Add support for file versioning
- Develop a user-friendly front-end interface
- Implement additional blockchain features (e.g., tokenization)
- Enhance scalability and performance optimizations
As this project is in development, contributions are welcome. Please follow standard GitHub pull request procedures for any contributions.