A decentralized file management system integrating IPFS for file storage and MongoDB for metadata and version control.
Built using Node.js, Express.js, IPFS, and MongoDB.
This project is a Decentralized File Metadata Management System that securely stores files on IPFS while maintaining structured metadata and version history in MongoDB.
It provides a RESTful backend to:
- Upload files to IPFS
- Manage metadata, versions, and ownership
- Verify data integrity with SHA-256
- Search, download, and soft-delete files
Designed for real-world decentralized applications where data immutability, traceability, and verifiability matter.
src/
βββ config/
β βββ db.js
βββ controllers/
β βββ fileController.js
βββ models/
β βββ fileMetadata.js
βββ routes/
β βββ fileRoutes.js
βββ services/
β βββ ipfsService.js
βββ utils/
β βββ hashUtils.js
βββ app.js
.env
package.json
Uploaded file pinned successfully:

File metadata stored with owner, versions, and timestamps:

- β‘ Decentralized Storage via IPFS β Files stored on your local or remote IPFS node.
- π§Ύ MongoDB Metadata Layer β Tracks file name, owner, version history, description, and tags.
- π Version Control System β Automatically increments version numbers on new uploads.
- π§© Integrity Verification β Uses SHA-256 hashing to detect duplicates and verify file content.
- π Metadata Search β Query files by owner, tags, or content description.
- ποΈ Soft Delete System β Marks files inactive instead of deleting permanently.
- π Health Monitoring β IPFS node and MongoDB connection status endpoint.
- π§° Rate Limiting β Protects against excessive upload/download requests.
| Layer | Technology |
|---|---|
| Backend Framework | Node.js + Express.js |
| Database | MongoDB (Atlas) |
| Decentralized Storage | IPFS (ipfs-http-client) |
| Security / Integrity | SHA-256 Hashing |
| Request Control | express-rate-limit |
| Environment Config | dotenv |
| File Uploads | multer |
git clone https://github.com/adwityac/decentralized-file-metadata-manager.git
cd decentralized-file-metadata-managernpm installExample configuration:
# Server
PORT=3000
NODE_ENV=development
# MongoDB
MONGODB_URI=mongodb+srv://<username>:<password>@cluster0.mongodb.net/filedatamanager?retryWrites=true&w=majority
# IPFS (Local Node)
IPFS_HOST=127.0.0.1
IPFS_PORT=5001
IPFS_PROTOCOL=http
IPFS_API_URL=http://127.0.0.1:5001
# (Optional)
JWT_SECRET=your_secret_key_hereIf using IPFS Desktop (Windows):
- Open IPFS Desktop β Settings β Enable βAPI Serverβ.
- It should be accessible at:
http://127.0.0.1:5001/webui
npm run devYou should see:
π Server running on port 3000
ποΈ MongoDB Connected
π‘ IPFS: http://127.0.0.1:5001
β
IPFS client initialized successfully
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/files/upload |
Upload a new file to IPFS + MongoDB |
| GET | /api/files/:fileId |
Get metadata for a specific file |
| GET | /api/files/download/:fileId/:versionIndex? |
Download file by ID or version |
| POST | /api/files/update/:fileId |
Upload a new version of an existing file |
| GET | /api/files/verify/:fileId/:versionIndex |
Verify file integrity on IPFS |
| GET | /api/files/owner/:owner |
Retrieve files uploaded by a specific owner |
| DELETE | /api/files/:fileId |
Soft delete a file |
| GET | /api/files/system/status |
IPFS & MongoDB health status |
| GET | /api/files/system/search |
Search files by query, owner, or tags |
Request:
POST /api/files/upload
Form Data:
file: <sample.txt>
owner: adwitResponse:
{
"success": true,
"message": "File uploaded successfully",
"data": {
"fileId": "85fdebed78756e62de5fa468beccf598",
"originalFileName": "sample.txt",
"sha256Hash": "5e8ec69c8858f6a1ee31cdea70837b9154d70a6873fbe91e61cc2135a614fd48",
"ipfsHash": "QmQ8k3siDa7kuCUm34C6Mgoav4gsYXGNjamkNLzp98zymc"
}
}Request:
GET /api/files/system/statusResponse:
{
"success": true,
"message": "IPFS service is running",
"data": {
"connected": true,
"version": "0.37.0",
"repoUsagePercent": "0.03%"
}
}Request:
DELETE /api/files/85fdebed78756e62de5fa468beccf598
Body (JSON):
{
"owner": "adwit"
}Response:
{
"success": true,
"message": "File deleted successfully"
} ββββββββββββββ
β Client β
βββββββ¬βββββββ
β
βΌ
βββββββββββββββββ
β Express API β
βββββββββββββββββ€
β Upload / GET β
β Delete / Verifyβ
ββββββββ¬βββββββββ
β
βββββββββ΄βββββββββ
β β
βΌ βΌ
βββββββββββββ ββββββββββββββββ
β IPFS β β MongoDB β
β (Decentralized) β (Metadata DB) β
βββββββββββββ ββββββββββββββββ
This project is licensed under the MIT License β feel free to fork, modify, and build upon it.
MIT License Β© 2025 Adwitya Chakraborty
If you like this project, please β star the repository β it helps support continued open-source development!