This project provides a web API to upload and manage images and files directly to Google Drive, offering convenient, secure, and easily accessible data storage from multiple platforms and applications.
Dự án này cung cấp một API web để tải lên và quản lý hình ảnh, file trực tiếp lên Google Drive, giúp lưu trữ dữ liệu một cách tiện lợi, an toàn và dễ dàng truy cập từ nhiều nền tảng và ứng dụng khác nhau.
- Backend: Node.js, Express.js
- File Storage: Google Drive API
- Authentication: OAuth2, Google Cloud Platform Credentials
-
Upload files (images and other file types) directly to Google Drive.
-
Easily manage folder structures.
-
Simple API endpoint for easy integration into multiple frontends and applications.
-
Upload file (hình ảnh và các file khác) trực tiếp lên Google Drive.
-
Quản lý thư mục lưu trữ file dễ dàng.
-
API endpoint để upload file đơn giản, dễ tích hợp vào nhiều frontend và ứng dụng khác nhau.
Uploaded files will be stored in the main folder named Chat App
on Google Drive.
Các file được upload sẽ được lưu vào thư mục chính là Chat App
trên Google Drive.
Google Drive
└── Chat App
├── images
└── files
- URL:
/upload
- Method (Phương thức):
POST
- Params:
file
(multipart/form-data) - Response:
{
"filename": "file-1739897499183.jpg",
"message": "File đã nhận thành công!",
"mimetype": "image/jpeg",
"path": "uploads/file-1739897499183.jpg",
"success": true,
"url": "https://lh3.googleusercontent.com/d/1EBktmr9DOloefmGUq9d8p3gSf5TE-U7d=s220",
"webContentLink": "https://drive.google.com/uc?id=1EBktmr9DOloefmGUq9d8p3gSf5TE-U7d&export=download",
"webViewLink": "https://drive.google.com/file/d/1EBktmr9DOloefmGUq9d8p3gSf5TE-U7d/view?usp=drivesdk"
}
- Clone the project (Clone dự án)
git clone <url-repo>
cd project-folder
npm install
- Configure environment variables (Cấu hình biến môi trường)
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
GOOGLE_REDIRECT_URI=your-redirect-uri
GOOGLE_REFRESH_TOKEN=your-refresh-token
- Start the server (Chạy server)
npm start
-
File storage for chat applications
-
Image storage and management for websites and mobile apps
-
Data storage system for various frontend or backend applications
-
Lưu trữ file cho các ứng dụng chat
-
Lưu trữ và quản lý hình ảnh cho các website, ứng dụng di động
-
Hệ thống lưu trữ dữ liệu từ nhiều ứng dụng frontend hoặc backend khác nhau
-
Add features to delete and update files.
-
Manage file and folder access permissions on Google Drive.
-
Support multiple Google Drive accounts.
-
Thêm tính năng xóa, cập nhật file.
-
Quản lý quyền truy cập file và thư mục trên Google Drive.
-
Mở rộng hỗ trợ nhiều tài khoản Google Drive.