https://github.com/omidrezasalari/orderbook
This project provides an API for placing orders (buy/sell).
https://github.com/omidrezasalari/orderbook
buy orderbook rabbitmq redis sell trade
Last synced: 4 months ago
JSON representation
This project provides an API for placing orders (buy/sell).
- Host: GitHub
- URL: https://github.com/omidrezasalari/orderbook
- Owner: omidrezasalari
- Created: 2025-01-25T20:11:40.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-02-16T11:40:47.000Z (8 months ago)
- Last Synced: 2025-05-31T18:37:16.621Z (5 months ago)
- Topics: buy, orderbook, rabbitmq, redis, sell, trade
- Language: PHP
- Homepage:
- Size: 118 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Orderbook and Acme command
This project provides an API for placing orders (buy/sell).
## Prerequisites
- Docker
- Docker Compose## Setup
1. Clone or download the repository.
2. Navigate to the project directory in your terminal.
3. **Create a `.env` file** (if not already present) with your environment variables for configuration.
4. Build and start the Docker containers using the following command:
```bash
docker-compose up -d### Command Signature
```bash
php artisan acme:generate-request {filepath}
```
#### Arguments:* filepath (required): The path to the JSON input file containing insurance request data.
The API will be available at http://localhost:3030.
API Documentation : ./documentation
Place an Order Endpoint: POST /api/v1/orders
Used for placing buy or sell orders.
### Request Body:
```shell
{
"type": "sell", // Order type ("buy" or "sell")
"price": 100, // Order price
"quantity": 2 // Order quantity
}
```
#### cURL Command to Place an Order:```shell
curl -X POST "http://localhost:3030/api/v1/orders" \
-H "Content-Type: application/json" \
-d '{"type": "sell", "price": 100, "quantity": 2}'
```
### Response :````shell
{
"message": "Order placed successfully.",
"order": {
"type": "sell",
"price": 100,
"quantity": 2
}
````### Process Orders Command:
```shell
php artisan orders:process
```