The Getpix Pix microservice is responsible for managing all operations related to user Pix keys, including creating, updating, retrieving, and deleting (CRUD). Built with HyperF and powered by Swoole and leveraging gRPC for high-performance communication, it serves as the core business logic for Pix key management within the Getpix ecosystem.
- HyperF + Swoole — High-performance PHP framework for async operations.
- gRPC — Efficient binary communication between services.
- PHP 8 — Strong-typed modern PHP code.
- Docker + Docker Compose — Containerized infrastructure.
- MongoDB — NoSQL database for logging and analytics.
[ Client ]
|
v
[ Getpix Gateway API ]
| \
| \-> (Kafka Topic) --> [ getpix_logs ]
|
\-> (gRPC) --> [ getpix_pix ]-
getpix_gateway: API Gateway responsible for orchestrating communication between services.
-
getpix_logs: Kafka consumer that stores logs into MongoDB.
✅ Requirements
- Docker
- Docker Compose
- getpix_gateway running up before.
📦 Running the Application
git clone https://github.com/luigi-raynel-dev/getpix_pix.git
cd getpix_pixStart all services with Docker Compose:
docker compose up -dInstall composer packages into container
docker exec -it getpix_app bash -c "composer install --ignore-platform-req=ext-mongodb"Copy the .env.example file into the html folder and rename it to .env.
Then, fill in the environment variables according to your configuration.
APP_NAME=skeleton
APP_ENV=dev
MONGODB_URI="mongodb://mongo:27017"
MONGODB_DATABASE="getpix"
REDIS_HOST=localhost
REDIS_AUTH=(null)
REDIS_PORT=6379
REDIS_DB=0
KAFKA_SERVERS="getpix_kafka:9092"
KAFKA_LOGS_TOPIC="getpix.logs"The Getpix ecosystem uses MongoDB to store and manage data.
You have two options to get it running
- Option 1: Use MongoDB Atlas (Free)
- Go to https://www.mongodb.com/cloud/atlas
- Create a free account and cluster
- Whitelist your IP and create a database user
- Replace MONGODB_URI in your .env with your Atlas connection string Example:
MONGODB_URI="mongodb+srv://<user>:<password>@cluster0.mongodb.net/?retryWrites=true&w=majority"
- Option 2: Run MongoDB with Docker
- If you prefer to run MongoDB locally with Docker:
docker run -d \ --name mongo \ -p 27017:27017 \ -e MONGO_INITDB_ROOT_USERNAME=root \ -e MONGO_INITDB_ROOT_PASSWORD=secret \ mongo
- Replace MONGODB_URI in your .env with connection string Example:
MONGODB_URI="mongodb://root:secret@localhost:27017"
This project includes unit tests using PHPUnit and hyperf/testing to ensure everything is working as expected.
To run the tests, make sure the container getpix_app is running and the necessary services are up and runnig.
docker exec -it getpix_app bash -c "composer run test"