Skip to content

MansiSingh17/OrbitFiles

Repository files navigation

☁️ OrbitFiles - Cloud Storage Platform

Next.js Node.js PostgreSQL TypeScript Clerk ImageKit

A full-stack cloud storage platform built with modern web technologies

Demo β€’ Features β€’ Installation β€’ Tech Stack


🌟 About OrbitFiles

OrbitFiles is a feature-rich cloud storage platform, built with cutting-edge technologies. It provides secure file management, seamless uploads, and optimized file delivery, all wrapped in a beautiful and intuitive user interface.


✨ Features

πŸ” Authentication & Security

  • βœ… Clerk Authentication
    • Secure user sign-up/sign-in
    • Social OAuth providers
    • Session management
    • Protected routes

πŸ“ File Management

  • βœ… Upload Files
    • Drag-and-drop support
    • Multiple file uploads
    • Progress indicators
  • βœ… Organize Files
    • Star important files
    • Move files to trash
    • Restore deleted files
  • βœ… File Actions
    • View file details
    • Download files
    • Delete permanently

πŸš€ Performance & Optimization

  • βœ… ImageKit Integration
    • CDN-powered delivery
    • Automatic image optimization
    • Fast load times
    • Responsive images

πŸ—„οΈ Database & Storage

  • βœ… Neon PostgreSQL
    • Serverless PostgreSQL
    • Type-safe queries with Drizzle ORM
    • Data validation with Zod
  • βœ… AWS S3
    • Secure cloud storage
    • Scalable file storage
    • Reliable data persistence

🎨 User Experience

  • βœ… Modern UI with HeroUI
  • βœ… Responsive Design
  • βœ… Dark Mode Support
  • βœ… Intuitive Navigation

πŸš€ Demo

# Coming Soon!
Live Demo: [OrbitFiles Demo](https://your-demo-url.com)

πŸ“Έ Screenshots

Homepage File Management Upload Interface
Home Files Upload

πŸ› οΈ Tech Stack

Core Technologies

Next.js TypeScript Node.js React

πŸ”§ Key Dependencies

Category Technology Purpose
Framework Next.js React framework with SSR/SSG
Authentication Clerk User authentication & management
Database Neon PostgreSQL Serverless PostgreSQL database
ORM Drizzle ORM Type-safe database queries
Validation Zod Schema validation
File Delivery ImageKit CDN & image optimization
Storage AWS S3 Cloud file storage
UI Components HeroUI Modern UI component library
Styling Tailwind CSS Utility-first CSS framework

πŸ“¦ Installation

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v18 or higher)
  • npm or yarn or pnpm
  • Git

πŸ”‘ Required API Keys

You'll need accounts and API keys from:

  1. Clerk - Sign up here
  2. ImageKit - Sign up here
  3. Neon PostgreSQL - Sign up here
  4. AWS S3 (Optional) - Sign up here

πŸ“₯ Clone the Repository

# Clone the repository
git clone https://github.com/your-username/orbitfiles.git

# Navigate to project directory
cd orbitfiles

βš™οΈ Environment Setup

Create a .env.local file in the root directory:

# 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

# Database (Neon PostgreSQL)
DATABASE_URL=your_neon_database_url

# 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

# AWS S3 (Optional)
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_key
AWS_REGION=your_aws_region
AWS_BUCKET_NAME=your_bucket_name

πŸ“¦ Install Dependencies

# Using npm
npm install

# Using yarn
yarn install

# Using pnpm
pnpm install

πŸ—„οΈ Database Setup

# Generate Drizzle schema
npm run db:generate

# Push schema to database
npm run db:push

# (Optional) Open Drizzle Studio
npm run db:studio

πŸš€ Run Development Server

# Start the development server
npm run dev

# Open http://localhost:3000 in your browser

πŸ—οΈ Build for Production

# Build the application
npm run build

# Start production server
npm start

πŸ“ Project Structure

orbitfiles/
β”œβ”€β”€ app/                    # Next.js app directory
β”‚   β”œβ”€β”€ (auth)/            # Authentication routes
β”‚   β”œβ”€β”€ (dashboard)/       # Dashboard routes
β”‚   β”œβ”€β”€ api/               # API routes
β”‚   └── layout.tsx         # Root layout
β”œβ”€β”€ components/            # React components
β”‚   β”œβ”€β”€ ui/               # UI components
β”‚   β”œβ”€β”€ file-upload/      # File upload components
β”‚   └── file-list/        # File listing components
β”œβ”€β”€ lib/                   # Utility functions
β”‚   β”œβ”€β”€ db/               # Database configuration
β”‚   β”œβ”€β”€ imagekit/         # ImageKit setup
β”‚   └── utils.ts          # Helper functions
β”œβ”€β”€ public/               # Static assets
β”œβ”€β”€ drizzle/              # Database schema & migrations
β”œβ”€β”€ types/                # TypeScript type definitions
β”œβ”€β”€ .env.local           # Environment variables
β”œβ”€β”€ drizzle.config.ts    # Drizzle ORM configuration
β”œβ”€β”€ next.config.js       # Next.js configuration
β”œβ”€β”€ package.json         # Project dependencies
└── tailwind.config.js   # Tailwind CSS configuration

πŸ”§ Configuration

Clerk Authentication

  1. Visit Clerk Dashboard
  2. Create a new application
  3. Copy your API keys to .env.local
  4. Configure sign-in/sign-up URLs

Clerk Documentation: https://clerk.com/docs

ImageKit Setup

  1. Sign up at ImageKit
  2. Get your Public Key, Private Key, and URL Endpoint
  3. Add credentials to .env.local
  4. Configure upload settings in your dashboard

ImageKit Documentation: https://docs.imagekit.io

Neon PostgreSQL

  1. Create account at Neon
  2. Create a new project
  3. Copy the connection string
  4. Add to .env.local as DATABASE_URL

Drizzle ORM

Configure drizzle.config.ts:

import type { Config } from 'drizzle-kit';

export default {
  schema: './lib/db/schema.ts',
  out: './drizzle',
  driver: 'pg',
  dbCredentials: {
    connectionString: process.env.DATABASE_URL!,
  },
} satisfies Config;

🎯 Key Features Explained

1. File Upload System

// Drag-and-drop with progress tracking
- Multiple file selection
- Real-time upload progress
- Error handling
- Success notifications

2. File Management

// Organize your files efficiently
- Star/favorite files
- Move to trash
- Restore deleted files
- Permanent deletion
- File search & filtering

3. Secure Authentication

// Clerk handles everything
- Email/password authentication
- Social OAuth (Google, GitHub, etc.)
- Session management
- Protected API routes

4. Optimized Delivery

// ImageKit CDN integration
- Automatic image optimization
- Responsive images
- Fast global delivery
- Bandwidth optimization

πŸ“Š Database Schema

// Example Drizzle schema structure
import { pgTable, serial, text, timestamp, boolean } from 'drizzle-orm/pg-core';

export const files = pgTable('files', {
  id: serial('id').primaryKey(),
  userId: text('user_id').notNull(),
  fileName: text('file_name').notNull(),
  fileUrl: text('file_url').notNull(),
  fileSize: text('file_size'),
  fileType: text('file_type'),
  isStarred: boolean('is_starred').default(false),
  isTrashed: boolean('is_trashed').default(false),
  createdAt: timestamp('created_at').defaultNow(),
  updatedAt: timestamp('updated_at').defaultNow(),
});

🚦 API Routes

Endpoint Method Description
/api/files GET Get all user files
/api/files POST Upload new file
/api/files/[id] GET Get file details
/api/files/[id] PATCH Update file (star/trash)
/api/files/[id] DELETE Delete file permanently
/api/upload POST Handle file upload

πŸ§ͺ Testing

# Run tests
npm run test

# Run tests in watch mode
npm run test:watch

# Generate coverage report
npm run test:coverage

🎨 UI Components

Built with HeroUI and styled with Tailwind CSS:

  • 🎴 File Cards - Beautiful file preview cards
  • πŸ“€ Upload Modal - Drag-and-drop upload interface
  • πŸ—‘οΈ Trash Bin - Manage deleted files
  • ⭐ Starred Files - Quick access to favorites
  • πŸ” Search Bar - Find files instantly
  • πŸ“± Responsive Layout - Works on all devices

πŸ” Security Features

  • βœ… Authentication - Clerk-powered secure authentication
  • βœ… Protected Routes - Middleware protection for sensitive routes
  • βœ… Data Validation - Zod schema validation for all inputs
  • βœ… SQL Injection Prevention - Drizzle ORM parameterized queries
  • βœ… CORS Protection - Configured CORS policies
  • βœ… Rate Limiting - API rate limiting (optional)

πŸš€ Deployment

Deploy on Vercel (Recommended)

Deploy with Vercel

# Install Vercel CLI
npm i -g vercel

# Deploy
vercel

Environment Variables on Vercel

Add all environment variables from .env.local to your Vercel project settings.

Other Platforms

  • Netlify: Compatible with Next.js deployment
  • Railway: Easy deployment with database hosting
  • AWS: Deploy with Amplify or EC2

πŸ“ˆ Performance Optimization

  • ⚑ Next.js 14+ - Latest features and optimizations
  • πŸ–ΌοΈ ImageKit CDN - Global content delivery
  • πŸ—„οΈ Neon Serverless - Instant database scaling
  • πŸ“¦ Code Splitting - Automatic by Next.js
  • 🎯 Edge Runtime - Fast API responses
  • πŸ’Ύ Caching - Optimized caching strategies

πŸ›£οΈ Roadmap

  • File Sharing - Share files with other users
  • Folder Structure - Organize files in folders
  • File Preview - In-app file preview
  • Mobile App - React Native mobile application
  • Collaborative Editing - Real-time collaboration
  • Version Control - File version history
  • Advanced Search - Full-text search
  • Storage Analytics - Usage statistics dashboard

🀝 Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a 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

Please read CONTRIBUTING.md for details on our code of conduct and development process.


πŸ› Known Issues

  • File upload size limited to 10MB (configurable)
  • Bulk operations coming in future updates
  • Mobile responsive design improvements ongoing

Report issues at: GitHub Issues


πŸ™ Acknowledgments

  • Clerk - Authentication solution
  • ImageKit - CDN and image optimization
  • Neon - Serverless PostgreSQL
  • Vercel - Deployment platform
  • Next.js Team - Amazing framework

πŸ“š Resources

Official Documentation

Tutorials & Guides


πŸ“ž Contact & Support

Need help? Have questions?

GitHub Issues Discussions Email


⭐ Star this repo if you find it helpful!

Built with ❀️ by Your Name

GitHub Stars GitHub Forks GitHub Watchers


Inspired by Dropbox β€’ Powered by Next.js β€’ Secured by Clerk β€’ Optimized by ImageKit

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published