A modern, secure cloud file storage platform built with Next.js, featuring user authentication, file management, and real-time uploads.
- User Authentication: Secure sign-up/sign-in with Clerk
- File Upload: Drag & drop image uploads with progress tracking
- Folder Management: Create and organize files in custom folders
- File Operations: Star, trash, restore, and permanently delete files
- Image Optimization: Powered by ImageKit for fast loading and transformations
- Responsive Design: Works seamlessly on desktop and mobile devices
- Modern UI: Built with HeroUI components and Tailwind CSS
- Database: PostgreSQL with Drizzle ORM for reliable data management
- Frontend: Next.js 15, React 19, TypeScript
- Styling: Tailwind CSS, HeroUI Components
- Authentication: Clerk
- Database: PostgreSQL with Drizzle ORM
- File Storage: ImageKit
- Icons: Lucide React
- Date Handling: date-fns
- HTTP Client: Axios
Before running this project, make sure you have:
- Node.js 18+ installed
- PostgreSQL database
- Clerk account for authentication
- ImageKit account for file storage
-
Clone the repository
git clone <repository-url> cd drop-box
-
Install dependencies
npm install
-
Set up environment variables Create a
.env.localfile in the root directory:# Database DATABASE_URL="your-postgresql-connection-string" # Clerk Authentication NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="your-clerk-publishable-key" CLERK_SECRET_KEY="your-clerk-secret-key" NEXT_PUBLIC_CLERK_SIGN_IN_URL="/sign-in" NEXT_PUBLIC_CLERK_SIGN_UP_URL="/sign-up" NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL="/dashboard" NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL="/dashboard" # ImageKit NEXT_PUBLIC_IMAGEKIT_PUBLIC_KEY="your-imagekit-public-key" NEXT_PUBLIC_IMAGEKIT_PRIVATE_KEY="your-imagekit-private-key" NEXT_PUBLIC_IMAGEKIT_URL_ENDPOINT="your-imagekit-url-endpoint"
You can copy the example env file shipped with the repo and update values locally:
cp .env.local.example .env.local
# edit .env.local and fill in real values (DATABASE_URL, Clerk keys, ImageKit keys)If you prefer to only build locally without external services, the app now gracefully retries initialization at runtime and allows builds to complete even when some environment variables are not present. However, to run the app end-to-end and use authentication or uploads, set the values above.
-
Set up the database
# Generate database migrations npm run db:generate # Push schema to database npm run db:push
-
Run the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
npm run dev- Start development server with Turbopacknpm run build- Build the application for productionnpm run start- Start the production servernpm run lint- Run ESLint for code qualitynpm run db:push- Push database schema changesnpm run db:studio- Open Drizzle Studio for database managementnpm run db:generate- Generate database migrationsnpm run db:migrate- Run database migrations
├── app/ # Next.js App Router
│ ├── api/ # API routes
│ │ ├── files/ # File management endpoints
│ │ └── folders/ # Folder management endpoints
│ ├── dashboard/ # Dashboard page
│ ├── sign-in/ # Authentication pages
│ ├── sign-up/
│ └── layout.tsx # Root layout
├── components/ # React components
│ ├── ui/ # Reusable UI components
│ ├── FileList.tsx # File listing component
│ ├── FolderUploadForm.tsx # Upload interface
│ └── NavBar.tsx # Navigation component
├── lib/ # Utilities and configurations
│ └── db/ # Database configuration
├── schemas/ # Form validation schemas
└── styles/ # Global styles
This project uses Clerk for authentication, providing:
- Email/password authentication
- Session management
- Protected routes
- User profile management
The application uses a PostgreSQL database with the following main tables:
- users: User information (managed by Clerk)
- files: File and folder metadata including paths, sizes, and relationships
- Images: JPG, PNG, GIF, WebP
- Documents: PDF
- Upload: Drag & drop or click to upload
- Organize: Create folders and move files
- Star: Mark important files
- Trash: Soft delete with recovery option
- Download: Direct download with optimization
- Preview: Click images to view in new tab
The application uses HeroUI components with a custom blue color theme:
- Modern card-based layout
- Responsive tables for file listings
- Modal dialogs for confirmations
- Toast notifications for user feedback
- Loading states and progress indicators
- Connect your repository to Vercel
- Configure environment variables in the Vercel dashboard
- Deploy - Vercel will automatically build and deploy your app
-
Build the application
npm run build
-
Start the production server
npm start
- Create an ImageKit account
- Get your public/private keys and URL endpoint
- Configure transformation settings for optimal image delivery
- Set up a PostgreSQL database
- Update the
DATABASE_URLin your environment variables - Run migrations to set up the schema
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Created by Akash
- Next.js for the amazing React framework
- Clerk for authentication services
- ImageKit for image optimization
- HeroUI for beautiful UI components
- Drizzle for the TypeScript ORM
For more information about Next.js deployment, check out the Next.js deployment documentation.