Skip to content
Β 
Β 

Latest commit

Β 

History

170 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ImaginaryStorage

A comprehensive file upload and storage solution with a modern web interface, powerful backend API, and embeddable JavaScript widget for seamless file management across web applications.

πŸš€ Project Overview

ImaginaryStorage is a full-stack file storage platform designed to simplify file upload, management, and sharing for modern web applications. The project consists of multiple interconnected applications that work together to provide a complete file storage ecosystem.

Current Status

βœ… Completed Components:

  • Backend API - Full-featured NestJS backend with authentication, file management, and storage providers
  • Frontend Dashboard - React-based web interface for file management and user administration
  • Upload Widget - Embeddable JavaScript widget for easy integration into any web application
  • Landing Site - Marketing site with comprehensive documentation
  • Proxy Service - Secure file serving with authentication and access control

🚧 In Development:

  • Enhanced storage provider integrations
  • Advanced file processing capabilities
  • Improved user management and permissions

🎯 Project Goals

Current Goals

  • Provide a complete, production-ready file storage solution
  • Support multiple cloud storage providers (AWS S3, Google Cloud Storage)
  • Offer seamless integration with existing web applications
  • Maintain high security standards with proper authentication and access controls
  • Deliver excellent developer experience with comprehensive documentation

Future Goals

  • Local Filesystem Support - Add support for local file storage for self-hosted deployments
  • Additional Storage Providers - Integrate with more cloud storage services (Azure Blob, DigitalOcean Spaces, etc.)
  • Enhanced File Processing - Image optimization, video transcoding, document conversion
  • Advanced Collaboration - File sharing, commenting, and collaborative editing features
  • Mobile SDKs - Native mobile SDKs for iOS and Android applications
  • Enterprise Features - Advanced user management, audit logs, compliance features

πŸ“ Project Structure

imaginary-storage/
β”œβ”€β”€ πŸ“ apps/                          # Application modules
β”‚   β”œβ”€β”€ πŸ“ frontend/                  # React dashboard application
β”‚   β”‚   β”œβ”€β”€ src/components/           # React components
β”‚   β”‚   β”œβ”€β”€ src/api/                  # API client and hooks
β”‚   β”‚   β”œβ”€β”€ src/stores/               # State management
β”‚   β”‚   └── package.json
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“ nest-backend/              # NestJS API server
β”‚   β”‚   β”œβ”€β”€ src/modules/              # Feature modules
β”‚   β”‚   β”‚   β”œβ”€β”€ auth/                 # Authentication & authorization
β”‚   β”‚   β”‚   β”œβ”€β”€ files/                # File management
β”‚   β”‚   β”‚   β”œβ”€β”€ storage/              # Storage provider integrations
β”‚   β”‚   β”‚   β”œβ”€β”€ upload/               # File upload handling
β”‚   β”‚   β”‚   └── users/                # User management
β”‚   β”‚   β”œβ”€β”€ src/schemas/              # Database schemas
β”‚   β”‚   └── package.json
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“ imaginary-widget/          # Embeddable upload widget
β”‚   β”‚   β”œβ”€β”€ src/core/                 # Core widget functionality
β”‚   β”‚   β”œβ”€β”€ src/ui/                   # User interface components
β”‚   β”‚   β”œβ”€β”€ src/api/                  # Widget API client
β”‚   β”‚   β”œβ”€β”€ dist/                     # Built widget files
β”‚   β”‚   └── package.json
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“ landing-site/              # Marketing & documentation site
β”‚   β”‚   β”œβ”€β”€ src/app/                  # Next.js app router
β”‚   β”‚   β”œβ”€β”€ src/components/           # Site components
β”‚   β”‚   β”œβ”€β”€ src/app/docs/             # MDX documentation
β”‚   β”‚   └── package.json
β”‚   β”‚
β”‚   └── πŸ“ proxy/                     # File serving proxy
β”‚       β”œβ”€β”€ src/adapters/             # Storage adapter implementations
β”‚       β”œβ”€β”€ src/auth/                 # Authentication middleware
β”‚       └── package.json
β”‚
β”œβ”€β”€ πŸ“ deploy/                        # Deployment configurations
β”‚   β”œβ”€β”€ docker-compose.yml            # Production deployment
β”‚   β”œβ”€β”€ docker-compose.local.yml      # Local development
β”‚   └── config/nginx/                 # Nginx configurations
β”‚
β”œβ”€β”€ πŸ“ scripts/                       # Utility scripts
β”‚   β”œβ”€β”€ run-all.sh                    # Start all services
β”‚   └── add-todo.sh                   # Development utilities
β”‚
β”œβ”€β”€ πŸ“ journal/                       # Development documentation
β”‚   β”œβ”€β”€ implementations/              # Implementation notes
β”‚   β”œβ”€β”€ issues/                       # Known issues and solutions
β”‚   └── plans/                        # Development planning
β”‚
β”œβ”€β”€ πŸ“ todo/                          # Task management
β”‚
β”œβ”€β”€ package.json                      # Root package.json
└── README.md                         # This file

πŸ› οΈ Getting Started

Prerequisites

Ensure you have the following installed:

  • Node.js 18+
  • npm 9+
  • MongoDB (for backend database)
  • Redis (for caching and sessions)

Quick Start

  1. Clone the repository

    git clone https://github.com/imaginary-storage/imaginary-storage-cloud.git
    cd imaginary-storage-cloud
  2. Install all dependencies

    npm install
  3. Start all services in development mode

    npm run dev

    This will start:

Individual Service Setup

If you prefer to run services individually:

# Backend API
cd apps/nest-backend
npm install
npm run dev

# Frontend Dashboard  
cd apps/frontend
npm install
npm run dev

# Landing Site with Documentation
cd apps/landing-site
npm install
npm run dev

# Upload Widget (build for development)
cd apps/imaginary-widget
npm install
npm run build

# Proxy Service
cd apps/proxy
npm install
npm run dev

πŸ“š Documentation

Comprehensive documentation is available at the landing site:

Key Documentation Sections

πŸ”§ Development

Available Scripts

From the root directory:

npm run dev          # Start all services in development mode
npm run build        # Build all applications for production
npm run test         # Run tests across all applications
npm run lint         # Lint all applications
npm run clean        # Clean all build artifacts

Service-Specific Commands

Each application has its own development commands:

# Widget Development
cd apps/imaginary-widget
npm run dev          # Build with file watching
npm run serve        # Serve built files locally

# Backend Development  
cd apps/nest-backend
npm run dev          # Start with hot reload
npm run test         # Run unit tests
npm run test:e2e     # Run integration tests

# Frontend Development
cd apps/frontend  
npm run dev          # Start development server
npm run build        # Build for production
npm run preview      # Preview production build

Development Workflow

  1. Start all services: npm run dev from root

  2. Access applications:

  3. Make changes: All services support hot reload

  4. Test integrations: Use the widget examples to test end-to-end functionality

πŸ—οΈ Architecture

System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Frontend      β”‚    β”‚   Landing Site  β”‚    β”‚  Upload Widget  β”‚
β”‚   Dashboard     β”‚    β”‚  Documentation  β”‚    β”‚  (Embeddable)   β”‚
β”‚                 β”‚    β”‚                 β”‚    β”‚                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
          β”‚                      β”‚                      β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚   NestJS API    β”‚
                    β”‚    Backend      β”‚
                    β”‚                 β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚                                       β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”
β”‚   MongoDB       β”‚                     β”‚  Storage Proxy  β”‚
β”‚   Database      β”‚                     β”‚    Service      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                                                  β”‚
                                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”
                                        β”‚  Cloud Storage  β”‚
                                        β”‚  (AWS S3, GCS)  β”‚
                                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Technology Stack

  • Frontend: React 18, TypeScript, Vite, Tailwind CSS
  • Backend: NestJS, TypeScript, MongoDB, Redis
  • Widget: Vanilla JavaScript, Rollup
  • Landing: Next.js 14, MDX, Tailwind CSS
  • Proxy: Node.js, Express, TypeScript
  • Deployment: Docker, Nginx, Docker Compose

πŸ” Security Features

  • JWT Authentication - Secure user authentication and session management
  • API Key Management - Secure widget authentication with public/private key pairs
  • File Validation - Comprehensive file type, size, and content validation
  • Access Control - Fine-grained permissions and file access controls
  • Secure Upload Tokens - Temporary, signed tokens for secure file uploads
  • CORS Protection - Proper cross-origin resource sharing configuration

πŸš€ Deployment

Docker Deployment

# Production deployment
docker-compose -f deploy/docker-compose.yml up -d

# Local development with Docker
docker-compose -f deploy/docker-compose.local.yml up -d

Manual Deployment

  1. Build all applications:

    npm run build
  2. Deploy backend:

    cd apps/nest-backend
    npm run build
    npm run start:prod
  3. Deploy frontend:

    cd apps/frontend
    npm run build
    # Deploy dist/ folder to your CDN
  4. Deploy widget:

    cd apps/imaginary-widget
    npm run build
    # Deploy dist/ folder to your CDN

🀝 Contributing

We welcome contributions! Please see our contributing guidelines for details.

Development Setup

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes
  4. Run tests: npm test
  5. Commit your changes: git commit -m 'Add amazing feature'
  6. Push to the branch: git push origin feature/amazing-feature
  7. Open a Pull Request

Code Style

  • TypeScript for all new code
  • ESLint and Prettier for code formatting
  • Conventional commits for commit messages
  • Comprehensive tests for new features

πŸ“ License

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

πŸ†˜ Support

πŸ™ Acknowledgments

  • Built with amazing open-source technologies
  • Inspired by modern file storage needs
  • Community-driven development

Ready to build amazing file upload experiences? πŸš€

Start with npm run dev and visit the documentation at http://localhost:3002/docs/upload-widget/overview

About

A comprehensive file upload and storage solution with a modern web interface, powerful backend API, and embeddable JavaScript widget for seamless file management across web applications.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages