A full-featured cryptocurrency exchange platform, currently undergoing modernization to a service-oriented architecture.
- Trading Engine: Real-time order matching and execution.
- Wallet Management: Secure deposit and withdrawal processing.
- Currencies: Support for BTC, LTC, and fiat currencies (USD, EUR, RUB).
- User Dashboard: Customizable widgets for charts, order books, and history.
- Admin Panel: Comprehensive tools for user management, audit logs, and financial oversight.
- OKPay
- Perfect Money
- Yandex Money
- EgoPay (Legacy)
This project is currently being refactored from a legacy MVC structure to a modular, testable architecture.
The application now utilizes a service layer to decouple business logic from controllers:
- Services:
PaymentService,UserService,AdminServicehandle core business logic. - Payment Gateways: Adapter pattern implementation (
PaymentGatewayInterface) allows easy switching and testing of payment providers. - Infrastructure: centralized logging (
Logger), audit trails (AuditLog), and request validation (RequestValidator).
/
├── config/ # Configuration files
├── controllers/ # Legacy HTTP request handlers
├── core/ # Framework bootstrap and utilities
├── entity/ # Database entities (Active Record style)
├── lib/ # Modern Service Layer (PSR-4 autoloaded)
│ ├── Logging/ # Logger and AuditLog
│ ├── Payment/ # Gateway Adapters and Interfaces
│ ├── Services/ # Business Logic Services
│ └── Validation/ # Request Validation
├── modules/ # Legacy modules
├── public/ # Public web root
├── view/ # Template files
└── index.php # Application entry point
- PHP 7.4+
- MySQL / MariaDB
- Web Server (Apache/Nginx)
-
Clone the repository
git clone https://github.com/diannt/php_btc_exchange.git
-
Database Setup
- Create a new database.
- Import the schema from
emonex.sql. - Update database credentials in
config/config.php.
-
Configuration
- Copy
config/services.php(if not present) and configure payment gateway credentials. - Set environment variables for sensitive keys (recommended) or update
config/services.phpdirectly.
Environment Variables:
OKPAY_WALLET_ID=... OKPAY_API_PASSWORD=... PM_ACCOUNT_ID=... PM_PASS_PHRASE=... YM_ACCESS_TOKEN=...
- Copy
- Audit Logging: Sensitive admin actions are recorded in
logs/audit.log. - Validation: Input validation is handled by
RequestValidatorto prevent injection and malformed data. - Logging: Application errors and events are logged to
logs/app.log.
We are actively moving legacy code to the new lib/ structure. When contributing:
- Avoid adding logic to
controllers/. - Use the
Serviceclasses inlib/Services/. - Implement new payment methods using
PaymentGatewayInterface.
Proprietary / Closed Source (Contact owner for details).
Original project by diannt.net