{"id":28002921,"url":"https://github.com/bnkcodes/fc-pay","last_synced_at":"2025-05-09T01:44:46.495Z","repository":{"id":287814074,"uuid":"965872669","full_name":"bnkcodes/fc-pay","owner":"bnkcodes","description":"A study project implementing a payment gateway system using microservices architecture.","archived":false,"fork":false,"pushed_at":"2025-04-18T00:55:05.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-09T01:44:44.144Z","etag":null,"topics":["golang","microservices","nestjs","nextjs","payment-gateway","study-project"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bnkcodes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-14T03:39:00.000Z","updated_at":"2025-04-18T00:55:09.000Z","dependencies_parsed_at":"2025-05-01T14:47:52.106Z","dependency_job_id":"fc63f729-6261-4bdc-a455-32c77f18ea4b","html_url":"https://github.com/bnkcodes/fc-pay","commit_stats":null,"previous_names":["brunownk/fc-pay","bnkcodes/fc-pay"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnkcodes%2Ffc-pay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnkcodes%2Ffc-pay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnkcodes%2Ffc-pay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnkcodes%2Ffc-pay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bnkcodes","download_url":"https://codeload.github.com/bnkcodes/fc-pay/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253176444,"owners_count":21866142,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","microservices","nestjs","nextjs","payment-gateway","study-project"],"created_at":"2025-05-09T01:44:45.729Z","updated_at":"2025-05-09T01:44:46.483Z","avatar_url":"https://github.com/bnkcodes.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# FC Pay - Payment Gateway System\n\n[![Go](https://img.shields.io/badge/Go-1.21-blue.svg)](https://golang.org) [![Next.js](https://img.shields.io/badge/Next.js-14.0.4-black.svg)](https://nextjs.org) [![NestJS](https://img.shields.io/badge/NestJS-10.0.0-red.svg)](https://nestjs.com) [![Kafka](https://img.shields.io/badge/Kafka-3.5.1-orange.svg)](https://kafka.apache.org) [![PostgreSQL](https://img.shields.io/badge/PostgreSQL-16-blue.svg)](https://www.postgresql.org) [![License](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n\nA comprehensive payment gateway system built with microservices architecture, focusing on modern development practices and distributed systems.\n\n## Table of Contents\n\n- [Project Overview](#project-overview)\n- [System Architecture](#system-architecture)\n- [Components](#components)\n- [Getting Started](#getting-started)\n- [Development Setup](#development-setup)\n- [Study Focus](#study-focus)\n- [License](#license)\n\n## Project Overview\n\nThis project is a study implementation of a payment gateway system, designed to explore and understand modern microservices architecture and distributed systems. It consists of three main components working together to provide a complete payment processing solution.\n\n## System Architecture\n\n### Tech Stack\n\n| Component | Technology | Purpose |\n|-----------|------------|---------|\n| Frontend | Next.js 14 | Web interface |\n| Gateway | Go 1.21 | Payment processing |\n| Antifraud | NestJS | Fraud detection |\n| Message Queue | Kafka | Event-driven communication |\n| Database | PostgreSQL 16 | Data persistence |\n\n### System Components\n\n```mermaid\ngraph LR\n    A[Web Interface] --\u003e B[Gateway Service]\n    B --\u003e C[PostgreSQL]\n    B --\u003e D[Kafka]\n    D --\u003e E[Antifraud Service]\n    E --\u003e D\n    D --\u003e B\n```\n\n## Components\n\n| Component | Description | Repository |\n|-----------|-------------|------------|\n| [Web Interface](https://github.com/brunownk/fc-pay-web) | Next.js frontend for payment management | [fc-pay-web](https://github.com/brunownk/fc-pay-web) |\n| [Payment Gateway](https://github.com/brunownk/fc-pay-gateway) | Go backend for payment processing | [fc-pay-gateway](https://github.com/brunownk/fc-pay-gateway) |\n| [Fraud Detection](https://github.com/brunownk/fc-pay-antifraud) | NestJS service for basic fraud analysis | [fc-pay-antifraud](https://github.com/brunownk/fc-pay-antifraud) |\n\n## Getting Started\n\n### Prerequisites\n\n| Requirement | Version | Purpose |\n|-------------|---------|---------|\n| Go | 1.21+ | Gateway Service |\n| Node.js | 18.17+ | Web \u0026 Antifraud Services |\n| Docker | Latest | Containerization |\n| Docker Compose | Latest | Service Orchestration |\n\n### Installation Steps\n\n1. **Clone the repository with submodules**\n   ```bash\n   git clone --recursive git@github.com:brunownk/fc-pay.git\n   cd fc-pay\n   ```\n\n2. **Start the services in order**\n\n   \u003e ⚠️ **Important**: The services must be started in the following order to ensure proper network and dependency initialization.\n\n   a. **Start the Gateway service first** (creates required network and Kafka broker)\n   ```bash\n   cd fc-pay-gateway\n   cp .env.example .env\n   docker-compose up -d\n   ```\n\n   b. **Start the Antifraud service** (depends on Kafka from Gateway)\n   ```bash\n   cd ../fc-pay-antifraud\n   cp .env.example .env\n   docker-compose up -d\n   ```\n\n   c. **Start the Web interface** (depends on Gateway API)\n   ```bash\n   cd ../fc-pay-web\n   cp .env.example .env\n   docker-compose up -d\n   ```\n\n3. **Verify all services are running**\n   ```bash\n   # Check gateway service\n   curl http://localhost:8080/health\n\n   # Check antifraud service\n   curl http://localhost:3001/health\n\n   # Check web interface\n   curl http://localhost:3000\n   ```\n\n4. **Access the application**\n   - Web Interface: http://localhost:3000\n   - Gateway API: http://localhost:8080\n   - Antifraud Service: http://localhost:3001\n\n## Development Setup\n\n### Docker Network Configuration\n\nThe system uses a shared Docker network named `fc-pay-network` for inter-service communication:\n\n- Gateway API: `http://app:8080`\n- Antifraud API: `http://nestjs:3001`\n- Web Interface: `http://localhost:3000`\n\n### Service Dependencies\n\n| Service | Dependencies |\n|---------|--------------|\n| Gateway | PostgreSQL, Kafka |\n| Antifraud | PostgreSQL, Kafka |\n| Web | Gateway Service |\n\n### Health Checks\n\nEach service provides health check endpoints:\n\n1. **Gateway Service**\n   ```bash\n   curl http://localhost:8080/health\n   ```\n\n2. **Antifraud Service**\n   ```bash\n   curl http://localhost:3001/health\n   ```\n\n3. **Web Interface**\n   ```bash\n   curl http://localhost:3000/api/health\n   ```\n\n## Study Focus\n\n| Topic | Description | Implementation |\n|-------|-------------|----------------|\n| 🏗️ Microservices | Architecture patterns and best practices | Three independent services |\n| 📨 Event-Driven | Kafka integration and event processing | Asynchronous communication |\n| 🔐 Authentication | API key-based security | Secure payment processing |\n| 🗄️ Database | PostgreSQL operations and data modeling | Transaction management |\n| 🐳 Docker | Containerization and orchestration | Service isolation |\n| 🔄 CI/CD | Continuous integration and deployment | Automated testing |\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbnkcodes%2Ffc-pay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbnkcodes%2Ffc-pay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbnkcodes%2Ffc-pay/lists"}