Skip to content

vish9812/skyvault

Repository files navigation

SkyVault

A self-hosted cloud storage solution for your files

License: AGPLv3 Version Go Version SolidJS

πŸ“‹ Overview

SkyVault is a self-hosted cloud storage solution designed to help you securely store, organize, and share your files. It features a responsive mobile-first web UI and provides full control over your data.

✨ Features

  • πŸ” Secure Authentication: JWT-based authentication system
  • πŸ“ Folder Management: Create and navigate through folder structures
  • πŸ“€ File Upload: Upload files with chunked upload support for large files
  • πŸ“₯ File Download: Download your files anytime
  • πŸ’Ύ Storage Quotas: Per-user storage limits with real-time usage tracking
  • πŸ“± Mobile-First UI: Responsive design optimized for mobile devices
  • 🎨 Modern Interface: Built with SolidJS and Tailwind CSS
  • πŸš€ High Performance: Go backend with clean architecture
  • 🐳 Easy Deployment: Docker-based deployment with PostgreSQL

πŸš€ Quick Start

Prerequisites

  • Docker and Docker Compose installed
  • At least 2GB of available disk space

Installation via Docker

  1. Download the configuration file

    wget https://raw.githubusercontent.com/vish9812/skyvault/main/.env.example -O .env
  2. Configure your environment

    Edit the .env file and update the following critical values:

    # IMPORTANT: Change these to secure values!
    DB__PASS=your-secure-database-password
    AUTH__JWT__KEY=your-secure-jwt-key-at-least-32-characters-long

    Generate a secure JWT key:

    openssl rand -base64 32
  3. Download the Docker Compose file

    wget https://raw.githubusercontent.com/vish9812/skyvault/main/docker-compose.prod.yml -O compose.yml
  4. Start SkyVault

    docker compose up -d
  5. Access the application

    Open your browser and navigate to:

    http://localhost:8090
    

    Or replace localhost with your server's IP address.

  6. Create your account

    On first launch, create your user account through the signup page.

πŸ”§ Configuration

Environment Variables

SkyVault is configured through environment variables in the .env file:

Variable Description Default
SERVER__PORT Port to expose the application 8090
DB__NAME PostgreSQL database name skyvault
DB__USER PostgreSQL username skyvault
DB__PASS PostgreSQL password ⚠️ Required
AUTH__JWT__KEY JWT secret key (min 32 chars) ⚠️ Required
AUTH__JWT__TOKEN_TIMEOUT_MIN Token expiration in minutes 43200 (30 days)
STORAGE__DEFAULT_QUOTA_MB Default storage quota for new users 10240 (10GB)
LOG__LEVEL Logging level (debug/info/warn/error) info

Storage Quotas

SkyVault supports per-user storage quotas. You can configure the default quota for new users:

# Set default storage quota to 50GB for new users
STORAGE__DEFAULT_QUOTA_MB=51200

# Set to 100GB for generous storage
STORAGE__DEFAULT_QUOTA_MB=102400

# Set to 100TB for unlimited storage feel
STORAGE__DEFAULT_QUOTA_MB=104857600

Features:

  • Each user has their own storage quota
  • Real-time storage usage tracking displayed in the UI
  • Visual indicators when approaching storage limits (80% = warning, 95% = critical)
  • Automatic validation prevents uploads exceeding available storage
  • Chunked uploads for large files with upfront quota reservation (concurrent-upload protection)

πŸ› οΈ Management

Viewing Logs

# All logs
docker compose logs -f

# Application logs only
docker compose logs -f app

# Database logs only
docker compose logs -f db

Updating SkyVault

# Pull the latest image
docker compose pull

# Restart with the new image
docker compose up -d

Backup

Your data is stored in Docker volumes. To backup:

# Backup database
docker compose exec db pg_dump -U skyvault skyvault > backup.sql

# Backup uploaded files
docker run --rm -v skyvault_app-data:/data -v $(pwd):/backup alpine tar czf /backup/files-backup.tar.gz /data

Restore

# Restore database
cat backup.sql | docker compose exec -T db psql -U skyvault skyvault

# Restore uploaded files
docker run --rm -v skyvault_app-data:/data -v $(pwd):/backup alpine tar xzf /backup/files-backup.tar.gz -C /

Stopping SkyVault

# Stop services
docker compose down

# Stop and remove all data (⚠️ WARNING: This deletes everything!)
docker compose down -v

πŸ‘©β€πŸ’» Development

Prerequisites

  • Go 1.26 or higher
  • Node.js 20 or higher
  • pnpm
  • PostgreSQL 16
  • just command runner

Setup

  1. Clone the repository

    git clone https://github.com/vish9812/skyvault.git
    cd skyvault
  2. Configure environment

    cp server/dev.env.example server/dev.env
    # Edit server/dev.env with your database credentials
  3. Start the database

    just postgres-up
  4. Start development servers

    # Terminal 1: Start backend
    just server-run
    
    # Terminal 2: Start frontend
    just web-dev

    Access the app at http://localhost:5173 (Vite dev server)

Common Development Commands

# Build everything
just build

# Run all tests
just test

# Run server tests
just server-test

# Lint web code
just web-lint

# Generate DB models after schema changes
just gen-db-models

# Create a new migration
just migrate-create NAME=add_something

# Clean everything
just nuke

Project Structure

skyvault/
β”œβ”€β”€ server/                 # Go backend
β”‚   β”œβ”€β”€ cmd/               # Application entrypoint
β”‚   β”œβ”€β”€ internal/
β”‚   β”‚   β”œβ”€β”€ domain/       # Domain layer (CQRS pattern)
β”‚   β”‚   β”œβ”€β”€ infrastructure/ # Infrastructure implementations
β”‚   β”‚   β”œβ”€β”€ api/          # HTTP API handlers
β”‚   β”‚   └── workflows/    # Cross-domain operations
β”‚   └── pkg/              # Shared packages
β”œβ”€β”€ web/                   # SolidJS frontend
β”‚   └── src/
β”‚       β”œβ”€β”€ components/   # UI components
β”‚       β”œβ”€β”€ pages/        # Page components
β”‚       β”œβ”€β”€ store/        # State management
β”‚       └── apis/         # API client
└── justfile              # Task automation

πŸ—οΈ Architecture

Backend

  • Language: Go 1.26
  • Architecture: Clean Architecture with CQRS pattern
  • Database: PostgreSQL 16
  • Authentication: JWT tokens
  • API: RESTful HTTP API with Chi router

Frontend

  • Framework: SolidJS 1.9
  • Styling: Tailwind CSS 4
  • UI Components: Kobalte
  • State Management: Solid Signals + TanStack Query
  • Build Tool: Vite

Storage

  • Type: Local filesystem storage
  • Features:
    • Per-user storage quotas
    • Real-time usage tracking
    • Chunked uploads for large files
    • Streaming downloads
    • Concurrent upload protection
  • Configuration: Default quota configurable via STORAGE__DEFAULT_QUOTA_MB

πŸ—ΊοΈ Roadmap

Completed βœ…

  • JWT-based authentication
  • Folder creation and navigation
  • File upload with chunked upload support
  • File download
  • Per-user storage quotas with real-time tracking
  • Storage usage visualization in UI

In Progress 🚧

  • Epic 1: File Operations (rename, move, delete)
  • Epic 2: Folder Operations (rename, move, delete)

Planned πŸ“‹

  • Epic 3: Contact Management System
  • Epic 4: Core File Sharing
  • Epic 5: Shared Content Management
  • Epic 6: Advanced Sharing Features

See TODO.md for detailed roadmap.

🀝 Contributing

Contributions are welcome! Please follow these steps:

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

Development Guidelines

  • Follow the conventions in CONVENTIONS.md
  • Write tests for new features
  • Update documentation as needed
  • Ensure all tests pass before submitting PR

πŸ“„ License

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

πŸ™ Acknowledgments

πŸ“ž Support

⚠️ Security

If you discover a security vulnerability, please email vishapps@outlook.com instead of using the issue tracker.


Made with ❀️ by Vish

⭐ Star this repository if you find it useful!

About

A self-hosted cloud drive for secure file sharing and organization, giving you complete control over your data.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages