A minimal Google Drive-like file storage web application built with Node.js, Express, MongoDB, and Firebase Storage. Users can register, log in, upload files, and download their files securely.
- User registration and authentication (JWT-based)
- Secure password hashing with bcrypt
- File upload and storage using Firebase Storage
- File metadata stored in MongoDB
- Download files with signed URLs (secure, time-limited access)
- Responsive UI using Tailwind CSS and Flowbite
- Input validation with express-validator
- Protected routes (only authenticated users can access their files)
- Backend: Node.js, Express.js
- Database: MongoDB (via Mongoose)
- File Storage: Firebase Storage
- Authentication: JWT (jsonwebtoken), bcrypt
- Frontend: EJS templates, Tailwind CSS, Flowbite
- Validation: express-validator
drive-express-mini-project/
│
├── models/ # Mongoose models (User, File)
├── routes/ # Express route handlers
├── utils/ # Utility modules (Firebase, Multer, DB connection)
├── middlewares/ # Custom Express middlewares (auth)
├── views/ # EJS templates for UI
├── .env # Environment variables (not committed)
├── package.json
└── README.md
git clone <repo-url>
cd drive-express-mini-projectnpm installCreate a .env file in the root directory with the following variables:
PORT=3000
MONGODB_URI=<your-mongodb-uri>
JWT_SECRET=<your-jwt-secret>
FIREBASE_PROJECT_ID=<your-firebase-project-id>
FIREBASE_CLIENT_EMAIL=<your-firebase-client-email>
FIREBASE_PRIVATE_KEY=<your-firebase-private-key>
FIREBASE_STORAGE_BUCKET=<your-firebase-storage-bucket>
Note: For
FIREBASE_PRIVATE_KEY, replace actual newlines with\nin the.envfile.
npm startThe server will start on http://localhost:3000 (or your specified port).
- Register: Go to
/user/registerto create a new account. - Login: Go to
/user/loginto log in. - Home: After login, access
/hometo upload and view your files. - Upload: Use the upload form to select and upload files.
- Download: Click the download icon next to a file to get a secure, time-limited download link.
- Passwords are hashed before storage.
- JWT tokens are used for session management.
- File downloads use signed URLs for secure, temporary access.
- All file and user actions are protected by authentication middleware.