A comprehensive user management system for the FintechChain ecosystem that handles merchant management, authentication, authorization, and analytics. This service provides identity verification, API key management, role-based access control, and detailed payment behavior analytics for both platform and direct merchants.
π§ Under Active Development π§
This project is currently in the initial development phase. Core components are being implemented according to the project roadmap.
Gate-Identity is part of a service-based architecture that works alongside:
- fiat-onramp-core: Central orchestration service that manages user intents and orders
- payment-gateway: Handles payment processing and payment provider webhooks
- GateX: Frontend platform for merchant interactions and user interfaces
The Gate-Identity system follows Domain-Driven Design principles with a clean architecture that separates domain logic, application services, infrastructure, and interfaces.
ββββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β GateX β β Gate-Identity β β External β
β Frontend βββββββΆβ Service βββββββΆβ Auth Services β
ββββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ
β Fiat-Onramp β β Payment β
β Core β β Gateway β
βββββββββββββββββββ βββββββββββββββββββ
- Multi-Tiered Merchant Management: Support for both platform merchants (B2B2B) and direct merchants (B2B2C)
- Authentication & Authorization: Secure login via email and Google OAuth with JWT tokens
- API Key Management: Generation, validation, and rotation of API keys with fine-grained permissions
- Role-Based Access Control: Flexible permission system for different user types
- Rate Limiting & Pricing Plans: Configurable API usage limits and pricing tiers
- Merchant Analytics: Detailed reporting on payment behaviors and API usage
- Event-Driven Architecture: Real-time updates and processing via event streams
- Secure Integration: Seamless connection with other FintechChain services
- Go 1.19 or later
- Docker and Docker Compose
- PostgreSQL 13 or later
- Redis 6 or later
- Kafka (for event processing)
-
Clone the repository:
git clone https://github.com/fintechain/gate-identity.git cd gate-identity -
Install dependencies:
go mod download
-
Build the services:
make build
-
Set up the environment:
cp .env.example .env # Edit .env with your configuration -
Run the services:
make run-api # Run the API service make run-worker # Run the background worker service
-
Start the required infrastructure:
make infra-up
-
Run database migrations:
make migrate-up
-
Run tests:
make test # Run all tests make test-unit # Run only unit tests make test-int # Run integration tests
-
Run linters:
make lint
- Create a feature branch from
main - Implement your changes following the project structure
- Add tests for your changes
- Run linters and tests locally
- Submit a pull request
The project follows Domain-Driven Design (DDD) principles with a clean architecture approach:
gate-identity/
βββ cmd/ # Application entry points
β βββ api/ # API service
β βββ worker/ # Background worker service
β βββ migrate/ # Database migration tool
βββ configs/ # Configuration files
βββ internal/ # Private application code
β βββ domain/ # Domain models and business logic
β β βββ identity/ # Identity domain (users, roles, auth)
β β βββ merchant/ # Merchant domain (config, API keys)
β β βββ analytics/ # Analytics domain (metrics, reports)
β βββ application/ # Application services
β β βββ identity/ # Identity services and DTOs
β β βββ merchant/ # Merchant services and DTOs
β β βββ analytics/ # Analytics services and DTOs
β βββ infrastructure/ # Technical implementations
β β βββ persistence/ # Database repositories
β β βββ cache/ # Caching implementation
β β βββ eventbus/ # Event system implementation
β β βββ external/ # External service integrations
β βββ interfaces/ # External interfaces
β βββ api/ # REST API implementation
β βββ worker/ # Worker processes
βββ pkg/ # Public packages
β βββ validator/ # Validation utilities
β βββ auth/ # Authentication utilities
β βββ env/ # Environment configuration
βββ api/ # API definitions
β βββ rest/ # REST API specs
βββ migrations/ # Database migrations
βββ deployments/ # Deployment configurations
βββ test/ # Test helpers and fixtures
βββ docs/ # Documentation
The system is organized around three core domains:
Manages users, authentication, sessions, roles, and permissions.
Handles merchant registration, configuration, API keys, rate limits, and pricing plans.
Processes transaction data, user activities, metrics calculations, and report generation.
API documentation is available in OpenAPI format at api/rest/openapi.yaml.
When the API service is running, you can access the Swagger UI at:
http://localhost:8080/swagger/
Registering a new merchant:
curl -X POST http://localhost:8080/api/v1/merchants \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"name": "Example Merchant",
"email": "contact@example.com",
"website": "https://example.com",
"type": "DIRECT",
"businessType": "ECOMMERCE",
"contactPerson": {
"name": "John Doe",
"email": "john@example.com",
"phone": "+1234567890"
}
}'Gate-Identity integrates with other FintechChain services:
- GateX Frontend: Provides authentication and merchant management APIs for the frontend
- Fiat-Onramp Core: Shares merchant information and validates API access
- Payment Gateway: Supplies transaction data for analytics processing
Build and run with Docker Compose:
docker-compose up -dDeploy to Kubernetes:
kubectl apply -f deployments/kubernetes/Detailed deployment documentation can be found in the docs/deployment/ directory.
Contributions are welcome! Please read our Contributing Guidelines first.
This project adheres to the Contributor Covenant Code of Conduct.
This project is licensed under the MIT License.