Coder Social home page Coder Social logo

bovino / streaming-file-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from daggerok/streaming-file-server

0.0 1.0 0.0 1.64 MB

full-stack java file server, based on spring-boot and spring-* with no limitation (almost :) for files upload and download. spring, postgres / h2, apache fileUpload, lombok, mustache, docker, jgiven, powermock, gradle, CI, bootstrap 4, bootstrap-filelinput, webjars, maven github-release-plugin

Home Page: http://daggerok.github.io/streaming-file-server

License: MIT License

Java 66.60% CSS 0.66% HTML 5.46% Dockerfile 5.68% Shell 10.25% Batchfile 11.36%

streaming-file-server's Introduction

streaming-file-server build

latests VERSION: 4.3.5

full-stack java file server based on spring-boot / spring-* with no limitation for upload and download files

Read reference documentation

  • minimum java 8 is required
  • with postgres: docker-ce on windows 10 is required
  • if you on windows, use scoop to install java and required command line tools.

try it locally

Installation

with postgres in docker

# database
wget https://github.com/daggerok/streaming-file-server/releases/download/4.3.5/docker-compose.yml
docker-compose -f docker-compose.yml up -d

# file-items data service
wget https://github.com/daggerok/streaming-file-server/releases/download/4.3.5/file-items-service-4.3.5.jar
bash file-items-service-4.3.5.jar --spring.profiles.active=db-pg

# file server
wget https://github.com/daggerok/streaming-file-server/releases/download/4.3.5/file-server-4.3.5.jar
bash file-server-4.3.5.jar --app.upload.path=./path/to/file-storage

# cleanup
docker-compose -f docker-compose.yml down -v

or simply using shell-script

wget https://github.com/daggerok/streaming-file-server/releases/download/4.3.5/application.bash

# start
bash application.bash start ./path/to/file-storage

# stop
bash application.bash stop

# cleanup
bash application.bash clean ./path/to/file-storage

note: tested on osx with localhost docker

installed binaries: wget, docker-compose, bash and of course java are required

for windows use https://github.com/daggerok/streaming-file-server/releases/download/4.3.5/application.cmd

@rem start
application.cmd start path\to\file-storage

@rem stop
application.cmd stop

@rem cleanup
application.cmd clean path\to\file-storage

note: tested on windows 10 with localhost docker for postgres

installed binaries: which, wget, docker-compose, taskkill, mkdir and of course java (binaries: java and jps) are required

with h2 in-memory database

wget https://github.com/daggerok/streaming-file-server/releases/download/4.3.5/file-items-service-4.3.5.jar
wget https://github.com/daggerok/streaming-file-server/releases/download/4.3.5/file-server-4.3.5.jar

# bash file-items-service-4.3.5.jar --spring.profiles.active=db-h2 # or just:
bash file-items-service-4.3.5.jar
bash file-server-4.3.5.jar --app.upload.path=./path/to/file-storage

or simply shell script for h2

wget https://github.com/daggerok/streaming-file-server/releases/download/4.3.5/application-h2.bash

# start
bash application-h2.bash start ./path/to/file-storage

# stop
bash application-h2.bash stop

# cleanup
bash application-h2.bash clean ./path/to/file-storage

for windows use https://github.com/daggerok/streaming-file-server/releases/download/4.3.5/application-h2.cmd

@rem start
application-h2.cmd start path\to\file-storage

@rem stop
application-h2.cmd stop

@rem cleanup
application-h2.cmd clean path\to\file-storage

note: tested on windows 10

installed binaries: which, del, wget, taskkill, mkdir and of course java, jps are required

development

gradle

./gradlew clean assemble postgresUp
./gradlew :m:a:f-i-s:bootRun
./gradlew :m:a:f-s:bootRun

# cleanup
./gradlew composeDown
./gradlew --stop

testing

awesome JGiven reports!

./gradlew clean test jgiven
open modules/apps/streaming-file-server/jgiven-reports/html/index.html

quick boot all with docker

./gradlew clean assemble allUp -Pdebug
http -a user:password :8002

run all in docker manually

./gradelw clean assemble
docker-compose -f ./modules/docker/all/docker-compose.yml up --build --force-recreate

cleanup and remove everything

NOTE: if you feel that changes take no effect, clean docker

# remove containers
for container in $(docker ps -qaf health=healthy) ; do docker rm -v -f $container ; done

# remove volumes
for volume in $(docker volume ls -q) ; do docker volume rm -f $volume ; done

# remove images
for image in $(docker images -qa) ; do docker rmi -f $image ; done

# or
docker system prune -af --volumes

publish release

./mvnw

todo

  • migrate from Mustache template engine to Thymeleaf
  • migrate from Bootstrap to Materialize.css
  • migrate file-items-service and file-server from mvc to reactive webflux
  • migrate from postgres to reactive postgres or R2DBC, or to some reactive NoSQL (mongodb, etc...)
  • add more advanced security, secure by MVC method...
  • improve files-db sync (replace FileSystem with GridFS or ...?)
  • backup, restore, migration...
  • support removing files (rly..? as minimum from db)
  • p2p, bi-directional files synchronization with spring scheduling or batch
  • gradle github release plugin (at the moment, for publishing releases to github is using maven. see pom.xml)

stack

  • spring
    • spring-boot 2.0.6.RELEASE 1.x
    • QueryDSL, spring-data-rest, spring-data-jpa
    • cors: see modules/apps/file-items-service/src/main/java/daggerok/config/AppCfg.java
    • 404 fallback: see modules/apps/file-server/src/main/java/daggerok/web/config/FallbackConfig.java
    • spring-social (facebook login required for upload ability) replaced with basic spring-security for now
    • spring annotations (@Get, @Post, @WebPage) (rmeove in order of embedded annotations: @GetMapping, @PostMapping, etc...)
    • spring-data REST HAL browser (removed)
  • code / architecture splitting into micro-services
  • migrate postgres from blocking to nonblocking (wrapped in Schedules.elastic())
  • migrate REST API from spring mvn to webflux

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.