Skip to content

FileVault is a Spring Boot-based app to download, and storage using MinIO. It stores file metadata in an database and provides RESTful APIs for file operations. Designed with scalability, simplicity, and Docker-based deployment in mind.

Notifications You must be signed in to change notification settings

m4naff/FileVault

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📁 FileVault - Secure File Sharing API

API Spring Boot MinIO H2

A secure, production-ready API for temporary file uploads and sharing (like WeTransfer) with expiration and download limits.

✨ Features

  • Secure File Uploads - Multipart form data handling
  • Shareable Links - Unique, hard-to-guess download URLs
  • Expiration Control - Auto-delete after time or downloads
  • Rate Limiting - Protection against API abuse
  • Simple Metadata - Track files with H2 database

🛠️ Technologies

Component Technology
Backend Spring Boot
File Storage MinIO (S3-compatible)
Database H2 (In-memory)
API Docs OpenAPI/Swagger

🚀 Quick Start

Prerequisites

  • Java 17+
  • Docker (for MinIO)
  • Maven

1. Start MinIO Container

docker run -p 9000:9000 -p 9001:9001 --name minio \
  -e "MINIO_ROOT_USER=minioadmin" \
  -e "MINIO_ROOT_PASSWORD=minioadmin" \
  -v ~/minio-data:/data \
  minio/minio server /data --console-address ":9001"

You can enter MinIO interface with the URL: localhost:9001. After entering the interface you need to create a bucket to store files and define it inside application.yml

2. Configure Application

You need to create .env file to import properties. Create application.yml:

spring:
  config:
    import: optional:file:.env[.properties]
  datasource:
    url: ${SPRING_DATASOURCE_URL}
    driver-class-name: org.h2.Driver
    username: ${SPRING_DATASOURCE_USERNAME}
    password: ${SPRING_DATASOURCE_PASSWORD}
  h2:
    console:
      enabled: true
      path: /h2-console
  jpa:
    hibernate:
      ddl-auto: update
    database-platform: org.hibernate.dialect.H2Dialect
    show-sql: true
minio:
  url: ${MINIO_ENDPOINT}
  access-key: ${MINIO_ACCESS_KEY}
  secret-key: ${MINIO_SECRET_KEY}
  bucket: ${MINIO_BUCKET_NAME}

3. Build & Run

mvn clean install mvn spring-boot:run

API Reference

File upload

  POST /api/v1/upload
Parameter Type Description
file MultipartFile Required. To store the file
password String The password for the file
expirationHours int Expiration date of the file
downloadLimit int Download limit of the file

Returns download link of the file.

File download

  GET /api/v1/download/${id}
Parameter Type Description
id string Required. Id of file to fetch
password string Password of the file to download

Returns file.

About

FileVault is a Spring Boot-based app to download, and storage using MinIO. It stores file metadata in an database and provides RESTful APIs for file operations. Designed with scalability, simplicity, and Docker-based deployment in mind.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages