This monorepo contains the core API services for our trading platform, including both Go and Python components. It provides a centralized location for all application APIs, leveraging the strengths of both Go and Python for different aspects of the system.
/core-api-monorepo
├── /go-services
│ ├── /cmd
│ │ └── /api
│ │ └── main.go
│ ├── /internal
│ │ ├── /auth
│ │ ├── /handlers
│ │ ├── /models
│ │ └── /database
│ ├── /pkg
│ │ ├── /logger
│ │ └── /config
│ ├── go.mod
│ └── go.sum
├── /python-services
│ ├── /trading_strategies
│ │ ├── __init__.py
│ │ └── volatility_breakout.py
│ ├── /api
│ │ ├── __init__.py
│ │ └── main.py
│ ├── requirements.txt
│ └── setup.py
├── /shared
│ ├── /config
│ │ ├── default.yaml
│ │ └── development.yaml
│ │ └── production.yaml
│ ├── /utils
│ │ ├── logger.py
│ │ └── logger.go
│ ├── /models
│ │ ├── user.go
│ │ └── user.py
│ ├── /constants
│ │ ├── error_codes.py
│ │ └── error_codes.go
├── /scripts
│ ├── build.sh
│ └── test.sh
├── /docs
│ ├── api_spec.md
│ └── architecture_overview.md
├── docker-compose.yml
├── .gitignore
└── README.md
The Go services form the backbone of our core API, handling high-performance, low-latency operations.
- cmd/api: Main entry point for the Go API service.
- internal: Internal packages for the Go service, including authentication, request handlers, data models, and database interactions.
- pkg: Shared packages that can be used by other services, including our custom logger and configuration management.
The Python services handle our trading strategies and provide a FastAPI interface for strategy-related operations.
- trading_strategies: Implementation of various trading strategies.
- api: FastAPI application for exposing trading strategy operations.
- proto: Protocol Buffer definitions for any gRPC services (if needed in the future).
- scripts: Build and test scripts for the entire monorepo.
- docs: Project documentation, including API specifications and architecture overviews.
- Unified API Layer: Combines Go and Python services under a single API gateway.
- High-Performance Core: Utilizes Go for core services requiring high performance and low latency.
- Flexible Trading Strategies: Leverages Python for implementing and managing trading strategies.
- Custom Logging: Integrates with our custom logging service for enhanced observability across all microservices.
- Scalable Architecture: Designed to scale horizontally to handle increasing load.
- Secure Authentication: Implements JWT-based authentication for secure inter-service communication.
- Efficient Data Management: Utilizes PostgreSQL with connection pooling and Redis caching for optimal data access.
-
Clone the repository:
git clone https://github.com/your-org/core-api-monorepo.git
-
Set up Go services:
cd go-services go mod download
-
Set up Python services:
cd ../python-services pip install -r requirements.txt
-
Start the services:
docker-compose up
- For Go service development, navigate to the
go-services
directory and rungo run cmd/api/main.go
. - For Python service development, navigate to the
python-services
directory and runuvicorn api.main:app --reload
.
Run the test script from the root of the monorepo:
./scripts/test.sh
The docker-compose.yml
file provides a basic setup for local development and testing. For production deployment, consider using Kubernetes for orchestration and management of the microservices.
Please read our CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE.md file for details.