This project provides a gRPC fintech internal service for user authentication and wallet management. It leverages Protocol Buffers for defining services, PostgreSQL for data storage, and Docker for containerization, ensuring a robust and scalable backend infrastructure.
- Language: Go 1.25.5
- Framework: gRPC with Protocol Buffers
- Database: PostgreSQL 14
- ORM: GORM
- Authentication: JWT (golang-jwt)
- Hashing: Argon2 with base64 encoding
- Containerization: Docker & Docker Compose
Core Services:
User Service: Manages user authentication and account operations, including registration, login, profile management, and account deactivation. Key features include secure password hashing with Argon2 and JWT token generation/validation.
RPCs for User Service:
- CreateUser: Registers a new user.
- LoginUser: Authenticates a user and provides a JWT token.
- UserProfile: Fetches the authenticated user's profile.
- UpdateProfile: Updates user profile information.
- DeactivateAccount: Deactivates a user's account.
Wallet Management Service:
Handles wallet operations such as checking balances, depositing funds, withdrawing funds, and retrieving transaction history. It ensures real-time balance updates, transaction history tracking, and atomic balance updates with versioning.
RPCs for Wallet Service:
- Balance: Retrieves the current wallet balance.
- Deposit: Adds funds to the wallet.
- Withdrawl: Removes funds from the wallet.
- TransactionHistory: Fetches the history of transactions for the wallet.
Key Features:
- Secure password hashing using Argon2 with salt (base64 encoded).
- JWT token generation and validation for secure API access.
- User status management (active, inactive).
- Real-time wallet balance updates.
- Comprehensive transaction history tracking.
- Atomic wallet balance updates with versioning to prevent inconsistencies.
- Wallet status management (active, locked, suspended).
Development and Future Enhancements:
The project includes a Makefile for easy service management (up, logs, down, ps). Future enhancements include multi-currency support, rate limiting, enhanced security features like 2FA, and analytics dashboards.