This is a simple backend service for placing buy and sell orders and doing basic order matching.
The goal of this project was to understand how an order execution system works at a basic level and to build a working API.
- Accepts buy and sell orders using a REST API
- Stores orders in a database
- Matches buy and sell orders based on price
- Returns order id and status
- Node.js
- TypeScript
- Express
- SQLite
- Partial order fills are not handled
- No Redis or Kafka
- No WebSockets or real-time updates
- Single file implementation
These parts can be improved later.
POST /orders
Example request:
{
"side": "BUY",
"price": 100,
"quantity": 2
}
Example response:
{
"orderId": "some-uuid",
"status": "OPEN"
}
-
Install dependencies
npm install -
Start server
npm start -
Server runs on
http://localhost:3000
This project focuses on implementing the basic order matching logic in a clear and simple way. More advanced features like performance optimizations and real-time updates were not the focus of this version.