Skip to content

mrshaone/Project-P

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project-P

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!

Local run

Requirements:

  • JDK 19
  • Apache Maven

Windows

  1. Create a directory on root of the project and name it uploads.
  2. Each services contains application.properties, make sure active profile is set to dev.
  3. Run mvn clean and then mvn install in core, filemanager and notification directory.
  4. Start each service you want to use.

Docker

  1. Each services contains application.properties, make sure active profile is set to prod.
  2. Simply run docker-compose up -d --build on project base directory.
  3. Have fun!

Default ports:

Core: 1230
Filemanager: 1231
Notification: 1232
MongoDB: 27017

Services Description

core

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.

API Maps:

Fetches a multipart file from the request and stores the details in MongoDB and passes the file to filemanager service.

Fetches a String UUID and if the file is present it'll return the file in response from filemanager service.


filemanager

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!

API Maps:

  • 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.

notification

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.

About

Simple micro service file manager

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published