This project is a simple file manager built with Spring boot, containing upload and download functionalities. This project is only for educational purposes and developers doesn't have any intent for commercial uses!
Requirements:
- JDK 19
- Apache Maven
- Create a directory on root of the project and name it
uploads
. - Each services contains
application.properties
, make sure active profile is set to dev. - Run
mvn clean
and thenmvn install
in core, filemanager and notification directory. - Start each service you want to use.
- Each services contains
application.properties
, make sure active profile is set to prod. - Simply run
docker-compose up -d --build
on project base directory. - Have fun!
Core: 1230
Filemanager: 1231
Notification: 1232
MongoDB: 27017
This service is the main service, and it is responsible for fetching requests and process them. It's also responsible for storing file details in MongoDB.
- Upload (POST): /file
Fetches a multipart file from the request and stores the details in MongoDB and passes the file to filemanager service.
- Download (GET): /file?uuid={uuid}
Fetches a String UUID and if the file is present it'll return the file in response from filemanager service.
This service is responsible for saving two copy of files given to it, one on local file system and one on MongoDB. After successfully saving files it'll generate a UUID. That UUID will be the key for downloading file.
Important: Don't send data directly to filemanager service and only use core service!
- Upload (POST): /file
Gets the multipart file from core service and store it on MongoDB and local file storage and generates a UUID and sends it as response.
- Download (GET): /file
Gets UUID as parameter and if it's a valid UUID it'll return the corresponding file.
This service is only an implementation for RabbitMQ and Spring Boot integration. Simply when user pass a file to core service, it'll send UUID to RabbitMQ and notification service consume the queue and displays the UUID.