This project is developed using a microservices architecture. The system consists of user security, license management, file management, and object storage services. Each service operates independently and is responsible for a specific function.
The project consists of four core microservices:
-
Security Service 🛡️
- Responsible for user registration and authentication.
- Notifies the License Service when a new user registers.
-
License Service 🔑
- Assigns licenses to users (e.g., 30-day demo license).
- Tracks user file upload quotas and daily upload limits.
- Monitors upload/delete operations from the File Management Service and updates quotas accordingly.
-
Object Storage Service 📦
- Creates S3/MinIO buckets for users based on information from License Service.
- Manages bucket and access permissions according to user license details.
-
File Management Service 📂
- Manages user file uploads, downloads, listing, and deletions.
- Checks quotas and limits via the License Service.
- Notifies the License Service upon file operations.
This project is built using the Event-Driven Development (EDD) architecture. Services communicate with each other through an event-based system rather than direct calls. This enables each service to scale independently.
- When a new user is registered in Security Service, a UserCreated event is published.
- License Service listens to this event, assigns a 30-day demo license, and publishes a LicenseCreated event.
- Object Storage Service listens to the LicenseCreated event and creates a bucket for the user.
- When a user uploads a file, File Management Service publishes a FileUploaded event, which the License Service listens to update the quota.
This architecture is supported by RabbitMQ message queues.
To run the project, use the following Docker and Makefile commands.
Start all microservices using Docker Compose:
make up
Then complete the installation with:
make install
This command will build the base image and launch all services.
To shut down all services:
make down
Run the following commands to start the queue workers for each service:
make security-queue
make license-queue
make object-storage-queue
Security Service Queue: Publishes the UserCreated event when a user is created. This event triggers email notifications and license creation.
License Service Queue: Manages the license creation process. Monitors user activities and updates license information. Notifies the Object Storage Service.
Object Storage Queue: Handles user bucket creation and file management operations. Uses information from License Service to manage Object Storage Service.
Use the following commands to access each service:
make bash security
make bash license
make bash file-management
make bash object-storage
project-root/
│── security/ # User registration and authentication service
│ ├── app/
│ ├── Dockerfile # Dockerfile for Security service
│ ├── ...
│── license/ # License management service
│ ├── app/
│ ├── Dockerfile # Dockerfile for License service
│ ├── ...
│── file-management/ # File management service
│ ├── app/
│ ├── Dockerfile # Dockerfile for File Management service
│ ├── ...
│── object-storage/ # MinIO and storage service
│ ├── app/
│ ├── Dockerfile # Dockerfile for Object Storage service
│ ├── ...
│── docker-compose.yml # Docker Compose configuration for all services
│── Dockerfile-base # Base Docker image for all microservices
│── Makefile # Makefile for management commands
- PHP 8.4 and Laravel 11
- Docker & Docker Compose
- PostgreSQL 16
- RabbitMQ 4 (Management Edition)
- MinIO (AWS S3-compatible storage)
Service configurations:
- Security Service →
localhost:3000
- License Service →
localhost:3001
- File Management Service →
localhost:3002
- Object Storage Service →
localhost:3003
- PostgreSQL →
localhost:5432
- RabbitMQ →
localhost:5672
(Management UI:localhost:15672
) - MinIO →
localhost:9000
(Console:localhost:9001
)
Service | Endpoint | Method |
---|---|---|
Security | /api/security/v1/users |
POST |
/api/security/v1/login |
POST | |
/api/security/v1/me |
GET | |
File Management | /api/fms/v1/files |
GET |
/api/fms/v1/files |
POST | |
/api/fms/v1/files/{id}/delete |
DELETE | |
/api/fms/v1/files/{id}/download |
GET | |
License | /api/license/v1/me |
GET |
To ensure code quality and security, PHPStan is used for static code analysis. Run the following commands to perform static analysis for each service:
make security-static-code-analysis
make license-static-code-analysis
make file-management-static-code-analysis
make object-storage-static-code-analysis
Run tests using the following commands:
make test-security
📌 Postman Collection Link: Microservice Architecture Case