Skip to content

1sh22/droply

Repository files navigation

Droply

A modern, secure, and user-friendly file storage application built with Next.js 15, featuring seamless file management capabilities and a beautiful user interface.

Overview

Droply is a robust file storage solution that allows users to securely upload, manage, and organize their files. Built with modern web technologies and best practices, it provides a seamless experience for file management with features like file starring, trash management, and folder organization.

Features

Authentication & Security

  • Secure user authentication powered by Clerk
  • Protected routes and API endpoints
  • Role-based access control

File Management

  • Drag-and-drop file uploads
  • File organization with folders
  • Star important files for quick access
  • Trash system with restore capabilities
  • Bulk file operations
  • File preview support

User Interface

  • Modern, responsive design using HeroUI components
  • Dark/Light theme support
  • Intuitive navigation
  • Real-time upload progress
  • Interactive file management

Tech Stack

Frontend

  • Next.js 15: React framework for production-grade applications
  • HeroUI: Comprehensive UI component library
  • TailwindCSS: Utility-first CSS framework
  • Framer Motion: Animation library for smooth transitions

Backend

  • Next.js API Routes: Serverless API endpoints
  • Neon: Serverless PostgreSQL database
  • Drizzle ORM: Type-safe database toolkit
  • ImageKit: Cloud-based image storage and optimization

Authentication

  • Clerk: Full-featured authentication and user management

Development Tools

  • TypeScript: Static type checking
  • ESLint & Prettier: Code quality and formatting
  • Drizzle Kit: Database migration and management tools

Project Structure

droply/
├── app/                    # Next.js app directory
│   ├── api/               # API routes
│   ├── dashboard/         # Dashboard pages
│   └── auth/              # Authentication pages
├── components/            # React components
│   ├── ui/               # Reusable UI components
│   └── features/         # Feature-specific components
├── lib/                   # Utility functions and configurations
│   └── db/               # Database configuration and schema
├── public/               # Static assets
└── styles/               # Global styles

Getting Started

Prerequisites

  • Node.js 18.0 or later
  • npm or yarn package manager
  • Clerk account for authentication
  • Neon PostgreSQL database
  • ImageKit account for file storage

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/droply.git
    cd droply
  2. Install dependencies:

    npm install
  3. Set up environment variables: Create a .env.local file in the root directory with the following variables:

    # Clerk Authentication
    NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
    CLERK_SECRET_KEY=your_clerk_secret_key
    
    # ImageKit
    NEXT_PUBLIC_IMAGEKIT_PUBLIC_KEY=your_imagekit_public_key
    IMAGEKIT_PRIVATE_KEY=your_imagekit_private_key
    NEXT_PUBLIC_IMAGEKIT_URL_ENDPOINT=your_imagekit_url_endpoint
    
    # Clerk URLs
    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
    
    # Fallback URLs
    NEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL=/
    NEXT_PUBLIC_CLERK_SIGN_UP_FALLBACK_REDIRECT_URL=/
    
    # App URLs
    NEXT_PUBLIC_APP_URL=http://localhost:3000
    
    # Database - Neon PostgreSQL
    DATABASE_URL=your_neon_database_url

Development Workflow

  1. Start the development server:

    npm run dev
  2. Open http://localhost:3000 in your browser

Database Management

Droply uses Drizzle ORM for database operations. Available commands:

# Push schema changes to database
npm run db:push

# Generate migration files
npm run db:generate

# Run migrations
npm run db:migrate

# Open Drizzle Studio
npm run db:studio

Building for Production

  1. Create a production build:

    npm run build
  2. Start the production server:

    npm start

API Routes

File Management

  • POST /api/files/upload: Upload new files
  • POST /api/files/[fileId]/star: Star/unstar a file
  • POST /api/files/[fileId]/trash: Move file to trash
  • POST /api/files/[fileId]/delete: Permanently delete file
  • POST /api/files/empty-trash: Empty trash

Folder Management

  • POST /api/folders/create: Create new folder

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

About

A modern, secure and user friendly file storage application

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages