A full-stack cloud storage platform built with Next.js 15, featuring real-time file management, user authentication, and a sleek modern interface.
π Get Started β’ β¨ Features β’ π οΈ Tech Stack β’ π‘ API
- π Secure Authentication - Powered by Clerk with email verification and OTP support
- π File Management - Upload, organize, star, and delete files with drag-and-drop support
- π Folder Structure - Create and navigate through nested folder hierarchies
- πΎ Storage Management - 150MB per user limit with real-time usage tracking
- ποΈ Trash System - Soft delete with restore functionality
- π Modern UI - Clean, minimal design inspired by Apple's aesthetics
- π± Responsive Design - Works seamlessly across desktop, tablet, and mobile
- β‘ Real-time Updates - Instant feedback for all file operations
- π§ Smart Validation - Pre-upload file size and type validation
- π Progress Tracking - Visual upload progress with error handling
- π Type-Safe - Full TypeScript implementation
- ποΈ Database Integration - PostgreSQL with Drizzle ORM
- βοΈ Cloud Storage - Quadruple redundancy with ImageKit + Cloudinary fallback
- π Performance - Optimized with Next.js 15 and Turbopack
- π‘οΈ Security - Protected API routes with user authorization
- π¨ File Type Colors - Different colors for PDF, images, videos, and documents
- π§ Contact System - Email notifications with IP tracking
- π Login Monitoring - Silent user activity tracking (admin only)
filenest/
βββ π app/ # Next.js App Router
β βββ π api/ # API Routes
β β βββ files/ # File operations (upload, delete, star, trash)
β β βββ folders/ # Folder management
β β βββ storage/ # Storage usage tracking
β βββ dashboard/ # Main app interface
β βββ login/ # Authentication pages
β βββ page.tsx # Landing page
βββ π components/ # React Components
β βββ ui/ # shadcn/ui base components
β βββ FileUploadForm.tsx # Upload interface with storage limits
β βββ FileList.tsx # File management table
β βββ StorageIndicator.tsx # Storage usage display
β βββ ... # Other UI components
βββ π database/ # Database setup
β βββ schema.ts # File & user data models
β βββ drizzleClient.ts # DB connection
βββ π lib/ # Utilities
β βββ storageUtils.ts # 150MB limit calculations
βββ π Config files # ENV, TypeScript, Tailwind, etc.
- Node.js (v18 or higher)
- pnpm (recommended) or npm
- PostgreSQL database
- ImageKit + Cloudinary accounts for redundant file storage
- Clerk account for authentication
git clone https://github.com/CodewithEvilxd/FileNest.git
cd FileNest# Using pnpm (recommended)
pnpm install
# Or using npm
npm installCopy the sample environment file and configure your variables:
cp .env.sample .envAdd your environment variables to .env:
# Database Configuration
DATABASE_URL="postgresql://username:password@host:port/database?sslmode=require"
# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="pk_test_..."
CLERK_SECRET_KEY="sk_test_..."
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 Configuration (Primary)
NEXT_PUBLIC_IMAGEKIT_PUBLIC_KEY="your_public_key"
IMAGEKIT_PRIVATE_KEY="your_private_key"
NEXT_PUBLIC_IMAGEKIT_URL_ENDPOINT="https://ik.imagekit.io/your_imagekit_id"
# ImageKit Configuration (Secondary - Fallback)
IMAGEKIT2_PUBLIC_KEY="your_second_public_key"
IMAGEKIT2_PRIVATE_KEY="your_second_private_key"
IMAGEKIT2_URL_ENDPOINT="https://ik.imagekit.io/your_second_id"
# ImageKit Configuration (Tertiary - Second Fallback)
IMAGEKIT3_PUBLIC_KEY="your_third_public_key"
IMAGEKIT3_PRIVATE_KEY="your_third_private_key"
IMAGEKIT3_URL_ENDPOINT="https://ik.imagekit.io/your_third_id"
# Cloudinary Configuration (Final Fallback)
CLOUDINARY_CLOUD_NAME="your_cloud_name"
CLOUDINARY_API_KEY="your_api_key"
CLOUDINARY_API_SECRET="your_api_secret"# Generate and run database migrations
pnpm drizzle-kit generate
pnpm drizzle-kit migrate# Using pnpm
pnpm dev
# Or using npm
npm run devVisit http://localhost:3000 to see your application running!
- Next.js 15 - React framework with App Router
- React 19 - UI library
- TypeScript - Type safety
- Tailwind CSS - Styling framework
- shadcn/ui - Component library
- Lucide React - Icon library
- Framer Motion - Animation library
- Three.js - 3D graphics library
- Drizzle ORM - Type-safe database toolkit
- PostgreSQL - Primary database
- Neon - Serverless PostgreSQL
- Clerk - User authentication and management
- ImageKit - Primary cloud storage with redundancy
- Cloudinary - Backup cloud storage
- ESLint - Code linting
- Prettier - Code formatting
- Drizzle Kit - Database migrations
# Development
pnpm dev # Start development server with Turbopack
pnpm build # Build for production
pnpm start # Start production server
pnpm lint # Run ESLint
# Database
pnpm db:generate # Generate database migrations
pnpm db:migrate # Run database migrations
pnpm db:studio # Open Drizzle Studio (database GUI)GET /api/files- List user files and foldersPOST /api/files/upload- Upload new filesPOST /api/files/[fileId]/star- Toggle file star statusPOST /api/files/[fileId]/trash- Move file to trashDELETE /api/files/[fileId]/delete- Permanently delete filePOST /api/files/empty-trash- Empty trash folder
POST /api/folders/create- Create new folder
GET /api/storage/usage- Get current storage usage
GET /api/imagekit-auth- Get ImageKit authentication token
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Follow TypeScript best practices
- Write meaningful commit messages
- Test your changes thoroughly
- Update documentation as needed
- Email: codewithevilxd@gmail.com
- Discord: raj.dev_
- GitHub: @CodewithEvilxd
This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ by CodewithEvilxd
Star β this repo if you found it helpful!