KCEX is a microservices-based cryptocurrency exchange platform designed to be scalable, secure, and highly performant. It provides functionalities like user authentication, trading, order management, wallet services, notification services, and more.
- Architecture
- Microservices
- Technology Stack
- Setup
- Deployment
- Monitoring and Logging
- CI/CD Pipeline
- Contributing
- License
The platform follows a microservices architecture, where each service is responsible for a specific functionality. The API Gateway (Traefik) handles routing to various microservices.
-
API Gateway (Traefik)
- Central entry point, routes traffic to microservices.
-
Auth Service
- Manages user authentication and authorization.
- Models: Users, Tokens
-
User Service
- Manages user profiles and information.
- Models: User Profiles
-
Trading Service
- Manages trading operations with an in-memory order book.
- Models: Orders, Trades
-
Order Service
- Manages user orders.
- Models: Orders
-
Wallet Service
- Manages user wallets and balances.
- Models: Wallets, Transactions
-
Notification Service
- Sends notifications to users.
- Models: Notifications
-
Coin and Pair Service
- Manages cryptocurrency coins and trading pairs.
- Models: Coins, Pairs
- Backend: Go (Gin Framework)
- Database: MongoDB
- Cache: Redis
- Containerization: Docker
- Orchestration: Kubernetes
- API Gateway: Traefik
- CI/CD: GitHub Actions, Jenkins, or Argo
- Monitoring: Prometheus, Grafana
- Logging: ELK Stack (Elasticsearch, Logstash, Kibana)
- Docker
- Docker Compose
- Kubernetes and kubectl
- Helm (optional, for managing Kubernetes applications)
- Clone the repository:
git clone https://github.com/yourusername/kcex.git cd kcex
- Start the services using Docker Compose:
docker-compose up -d
- Apply the Kubernetes manifests:
kubectl apply -f kubernetes/
- Ensure Docker and Docker Compose are installed.
- Start the services:
docker-compose up -d
- Ensure Kubernetes is set up and kubectl is configured.
- Apply the manifests:
kubectl apply -f kubernetes/
- Monitoring: Prometheus and Grafana are used for monitoring the health and performance of the services.
- Logging: The ELK Stack is used for centralized logging and alerting.
- CI/CD Tools: GitHub Actions, Jenkins, or Argo can be used for automating the build, test, and deployment processes.
- Pipeline Configuration: Detailed configuration can be found in the
.github/workflows/orJenkinsfileorArgoCDdirectory.
Contributions are welcome! Please open an issue or submit a pull request for any changes.
This project is licensed under the MIT License. See the LICENSE file for more information.
| API Gateway |
| (Traefik) |
+-----------+------------+
|
+-------------------+---------+-------------+------------------+
| | | |
+-------+--------+ +------+-------+ +----------+---------+ +-----+-----+
| Auth | | User | | Trading (In-Memory) | |Notification |
| Service | | Service | | Service | | Service |
|(Go, Gin) | | (Go, Gin) | | (Go, Gin) | | (Go, Gin) |
+-------+--------+ +------+-------+ +----+----+-----------+ +-----+-----+
|Model: Users | |Model: Profiles| |Models: Orders, Trades| |Model: Notif.|
| Tokens | | | +----+---+------------+ | |
+----------------+ +----------------+ | | +------------+
|
+----------------------+ +----------+-----------+ +------------+
| Coin & Pair Service | | Order | Wallet | |Analytics |
| (Go, Gin) | | Service | Service | |Service |
| Model: Coins, Pairs | | (Go, Gin)| (Go, Gin) | |(Go, Gin) |
+----------+-----------+ | Models: Orders | |Model: Reports|
| | Models: Wallets, Txns| +-------------+
| +----------+-----------+
+------------------------------------------------+
| Microservices Management Layer |
| (Kubernetes) |
+-----------------+------------------------------+
|
+-----------------|--------------------+
| | |
+-------------------+------+ +------+--------------+ +--+---------------+
|CI/CD Pipeline | |Monitoring | |Logging & Alerting|
|(GitHub Actions/Jenkins) | |(Prometheus/Grafana)| |(ELK Stack) |
+--------------------------+ +--------------------+ +------------------+