- Create nested folders with intuitive UI
- Navigate through folder hierarchy with breadcrumb navigation
- Organize your files exactly how you want
- Real-time search across all files and folders
- Instant filtering as you type
- Find what you need in seconds
- Sort by Name (A-Z or Z-A)
- Sort by Date (Newest or Oldest)
- Folders always appear first for easy navigation
- Delete files and folders with confirmation dialogs
- Recursive folder deletion (removes all contents)
- Clear warnings before destructive actions
- Simply drag files into the upload area
- Upload to specific folders
- Support for all file types
- Automatic file naming to prevent collisions
- Beautiful dark theme with glassmorphism effects
- Smooth animations and transitions
- Responsive design for all screen sizes
- Image previews for visual files
- Icon-based file type indicators
- Password-protected login
- Session-based authentication
- Protected API routes
- Node.js 18+ installed
- Yarn package manager
-
Clone the repository
git clone <your-repo-url> cd home-cloud
-
Install dependencies
yarn install
-
Set up environment variables
Create a
.env.localfile in the root directory:APP_PASSWORD=your_secure_password_here
-
Run the development server
yarn dev
-
Open your browser
Navigate to http://localhost:3000
- Navigate to the login page
- Enter your password (set in
.env.local) - Click "Sign In" to access your cloud storage
- Click the "New Folder" button in the toolbar
- Enter a folder name
- Press Enter or click "Create"
Method 1: Drag & Drop
- Drag files from your computer
- Drop them into the upload area
- Files will be uploaded to the current folder
Method 2: Click to Browse
- Click the upload area
- Select files from the file picker
- Multiple files can be selected at once
- Type in the search box in the toolbar
- Results filter in real-time
- Search works across file and folder names
- Click "Name" to sort alphabetically
- Click "Date" to sort by modification time
- Click again to reverse the sort order
- Active sort shows an arrow indicator (β or β)
- Click the trash icon on any file or folder
- Confirm the deletion in the dialog
- For folders, you'll see a warning about recursive deletion
- Click on any folder to open it
- Use the breadcrumb navigation at the top to go back
- Click "Home" to return to the root directory
home-cloud/
βββ app/
β βββ api/
β β βββ auth/login/ # Authentication endpoint
β β βββ delete/ # Delete files/folders
β β βββ file/[name]/ # File download endpoint
β β βββ files/ # List files with sorting/search
β β βββ folders/ # Create folders
β β βββ upload/ # File upload endpoint
β βββ login/ # Login page
β βββ globals.css # Global styles
β βββ layout.tsx # Root layout
β βββ page.tsx # Main dashboard
βββ lib/
β βββ config.ts # Configuration
β βββ fileUtils.ts # File system utilities
βββ uploads/ # File storage directory
βββ middleware.ts # Authentication middleware
βββ .env.local # Environment variables
- Framework: Next.js 16 with App Router
- Language: TypeScript
- Styling: Vanilla CSS with CSS Variables
- Icons: Lucide React
- Authentication: Session-based with HTTP-only cookies
- File System: Node.js
fs/promisesAPI
- Path Validation: Prevents directory traversal attacks
- Input Sanitization: All file and folder names are sanitized
- HTTP-only Cookies: Session tokens not accessible via JavaScript
- Protected Routes: Middleware guards all authenticated pages
- Safe File Operations: Recursive operations with proper error handling
Edit the CSS variables in app/globals.css:
:root {
--background: #0f172a; /* Main background */
--foreground: #e2e8f0; /* Text color */
--primary: #3b82f6; /* Primary accent */
--primary-hover: #2563eb; /* Primary hover */
--surface: #1e293b; /* Card background */
--border: #334155; /* Border color */
}Update the APP_PASSWORD in your .env.local file:
APP_PASSWORD=your_new_passwordRestart the development server for changes to take effect.
List files and folders with optional filtering and sorting.
Query Parameters:
path- Current folder path (default: root)sortBy- Sort field:nameordate(default:date)sortOrder- Sort order:ascordesc(default:desc)search- Search query string
Upload a file to the specified path.
Form Data:
file- File to upload (required)path- Destination folder path (optional)
Create a new folder.
JSON Body:
{
"folderName": "My Folder",
"currentPath": "optional/parent/path"
}Delete a file or folder.
JSON Body:
{
"itemPath": "path/to/item"
}The easiest way to deploy Home Cloud is using Docker Compose.
Prerequisites:
- Docker and Docker Compose installed
Steps:
-
Set up environment variables
Create a
.envfile in the root directory:APP_PASSWORD=your_secure_password_here
-
Build and start the container
docker-compose up -d
-
Access the application
Navigate to http://localhost:21043
Docker Commands:
# Start the application
docker-compose up -d
# Stop the application
docker-compose down
# View logs
docker-compose logs -f
# Rebuild after code changes
docker-compose up -d --buildNotes:
- The application runs on port 21043 (mapped from internal port 3000)
- Uploaded files are persisted in the
./uploadsdirectory - Environment variables can be set in a
.envfile or directly indocker-compose.yml
yarn build
yarn startEnsure your production environment has:
APP_PASSWORD=your_secure_production_password
NODE_ENV=production- Docker - Self-hosted with Docker Compose (recommended)
- Vercel - Optimized for Next.js
- Railway - Easy deployment with persistent storage
- DigitalOcean - Full control with App Platform
- Self-hosted - VPS with Node.js support
Note: For production deployments, consider using a proper database and object storage (like S3) instead of the local file system for better scalability.
Contributions are welcome! Feel free to:
- Report bugs
- Suggest new features
- Submit pull requests
This project is licensed under the MIT License.
Made with β€οΈ for self-hosted cloud storage