A modern, distributed file system built with the MERN stack (MongoDB, Express, React, Node.js) that mimics Google Drive's functionality and UI.
- 🔐 User Authentication (Register/Login with JWT)
- 📁 File Upload with drag-and-drop support
- 📂 Folder Management (Create, Rename, Delete)
- ⭐ Star/Unstar files and folders
- 🗑️ Trash system for deleted items
- 📊 Storage quota tracking
- 📥 File Download
- 🎨 Modern, professional UI similar to Google Drive
- 📱 Responsive design
- Node.js & Express.js
- MongoDB with Mongoose
- JWT Authentication
- Multer for file uploads
- bcryptjs for password hashing
- React.js
- Material-UI (MUI) for components
- React Router for navigation
- Axios for API calls
- React Dropzone for file uploads
- Node.js (v14 or higher)
- MongoDB (local or MongoDB Atlas)
- npm or yarn
-
Clone the repository
cd filesystem -
Install backend dependencies
npm install
-
Install frontend dependencies
cd client npm install cd ..
-
Configure environment variables
Create a
.envfile in the root directory:MONGODB_URI=mongodb://localhost:27017/filesystem JWT_SECRET=your-super-secret-jwt-key-change-this-in-production PORT=5000
-
Start MongoDB
Make sure MongoDB is running on your system. If using MongoDB Atlas, update the
MONGODB_URIin.env. -
Run the application
To run both server and client concurrently:
npm run dev
Or run them separately:
Backend:
npm run server
Frontend:
npm run client
-
Access the application
Open your browser and navigate to
http://localhost:3000
filesystem/
├── server/
│ ├── models/
│ │ ├── User.js
│ │ ├── File.js
│ │ └── Folder.js
│ ├── routes/
│ │ ├── auth.js
│ │ ├── files.js
│ │ └── folders.js
│ ├── middleware/
│ │ └── auth.js
│ ├── uploads/
│ └── index.js
├── client/
│ ├── public/
│ ├── src/
│ │ ├── components/
│ │ │ ├── Auth/
│ │ │ └── Dashboard/
│ │ ├── context/
│ │ └── App.js
│ └── package.json
├── package.json
└── README.md
POST /api/auth/register- Register a new userPOST /api/auth/login- Login user
GET /api/files- Get all filesPOST /api/files/upload- Upload a fileGET /api/files/download/:id- Download a fileDELETE /api/files/:id- Delete a filePATCH /api/files/:id/rename- Rename a filePATCH /api/files/:id/star- Star/Unstar a file
GET /api/folders- Get all foldersPOST /api/folders- Create a folderGET /api/folders/:id- Get folder by IDDELETE /api/folders/:id- Delete a folderPATCH /api/folders/:id/rename- Rename a folderPATCH /api/folders/:id/star- Star/Unstar a folder
Each user gets 10GB of storage by default. This can be modified in the User model.
- Password hashing with bcryptjs
- JWT token-based authentication
- File access restricted to owners
- Input validation and sanitization
- File sharing with other users
- File preview (images, PDFs, etc.)
- Search functionality
- File versioning
- Real-time collaboration
- Cloud storage integration (AWS S3, Google Cloud Storage)
ISC
Contributions are welcome! Please feel free to submit a Pull Request.