A full-stack cloud storage application with file management, sharing capabilities, and Google OAuth authentication.
- π File & Folder Management - Upload, organize, and manage your files
- π Google OAuth Authentication - Secure login with Google
- π€ File Upload/Download - Seamless file operations
- π File Sharing - Generate shareable links for your files
- ποΈ Trash & Restore - Safely delete and recover files
- β Starred Files - Mark important files for quick access
- π Storage Tracking - Monitor your storage usage
- π± Responsive Design - Works on all devices
- Next.js 14 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first styling
- Zustand - State management
- Lucide React - Icon library
- Node.js - JavaScript runtime
- Express - Web framework
- Passport.js - Authentication middleware
- Multer - File upload handling
- Supabase - PostgreSQL database
- Supabase Storage - File storage solution
- Google OAuth 2.0 - Social authentication
- Node.js 18+ and npm
- Supabase account
- Google Cloud Console project (for OAuth)
- Domain name (for production deployment)
git clone https://github.com/KUNDANIOS/CloudDrive.git
cd CloudDrive# Install backend dependencies
cd backend
npm install
# Install frontend dependencies
cd ../frontend
npm installCreate a .env file based on .env.example:
# Database
DATABASE_URL=your_supabase_connection_string
SUPABASE_URL=your_supabase_project_url
SUPABASE_ANON_KEY=your_supabase_anon_key
# Google OAuth
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_CALLBACK_URL=http://localhost:5000/auth/google/callback
# Session
SESSION_SECRET=your_random_session_secret
# Server
PORT=5000
NODE_ENV=development
FRONTEND_URL=http://localhost:3000Create a .env.local file:
NEXT_PUBLIC_API_URL=http://localhost:5000
NEXT_PUBLIC_GOOGLE_CLIENT_ID=your_google_client_id- Create a new project at supabase.com
- Run the database schema (provided in
/backend/database/schema.sql) - Enable Storage and create a bucket named
files - Copy your project URL and anon key to
.envfiles
- Go to Google Cloud Console
- Create a new project or select existing one
- Enable Google+ API
- Create OAuth 2.0 credentials
- Add authorized redirect URIs:
http://localhost:5000/auth/google/callback(development)https://api.yourdomain.com/auth/google/callback(production)
- Copy Client ID and Secret to
.envfiles
# Terminal 1 - Backend
cd backend
npm run dev
# Terminal 2 - Frontend
cd frontend
npm run devVisit http://localhost:3000
CloudDrive/
βββ backend/
β βββ src/
β β βββ auth/
β β β βββ google.js # Google OAuth strategy
β β βββ middleware/
β β β βββ authMiddleware.js # Authentication middleware
β β βββ routes/
β β β βββ auth.js # Authentication routes
β β β βββ files.js # File management routes
β β β βββ folders.js # Folder management routes
β β β βββ shares.js # File sharing routes
β β β βββ trash.js # Trash management routes
β β βββ index.js # Express server entry
β β βββ supabase.js # Supabase client
β βββ .env.example
β βββ package.json
βββ frontend/
β βββ src/
β β βββ app/
β β β βββ (auth)/ # Auth pages (login, register)
β β β βββ (dashboard)/ # Dashboard pages
β β β βββ layout.tsx
β β βββ components/
β β β βββ dashboard/ # Dashboard components
β β β βββ modals/ # Modal components
β β βββ lib/
β β βββ api/ # API client functions
β β βββ store/ # Zustand stores
β β βββ types/ # TypeScript types
β βββ .env.example
β βββ package.json
βββ .gitignore
βββ README.md
- Environment variables for sensitive data
- Google OAuth 2.0 authentication
- Session management with secure cookies
- File access control per user
- CORS configuration
- Input validation and sanitization
Ready to deploy? Check out the Deployment Guide for detailed instructions on deploying to:
- Frontend: Vercel (recommended for Next.js)
- Backend: Render.com or Railway.app
- Database: Supabase (managed PostgreSQL)
- Push code to GitHub β (Done!)
- Deploy backend to Render/Railway
- Deploy frontend to Vercel
- Configure custom domain
- Update OAuth callback URLs
- Set environment variables on hosting platforms
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
KUNDANIOS
- GitHub: @KUNDANIOS
- Next.js - The React Framework
- Supabase - Open source Firebase alternative
- Tailwind CSS - Utility-first CSS framework
- Passport.js - Authentication middleware
For any queries or support, please open an issue on GitHub.
β If you found this project helpful, please give it a star!