Metadata-Version: 2.1
Name: chives-exchange
Version: 0.1.1
Summary: Stock exchange with a matching engine and webserver
Home-page: https://github.com/xuganyu96/chives-exchange
Author: Ganyu "Bruce" Xu
Author-email: xuganyu96@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Description-Content-Type: text/markdown
Requires-Dist: Flask (==1.1.2)
Requires-Dist: flask-login (==0.5.0)
Requires-Dist: flask-wtf (==0.14.3)
Requires-Dist: pytest (==6.1.2)
Requires-Dist: pika (==1.1.0)
Requires-Dist: requests (==2.24.0)
Requires-Dist: SQLAlchemy (==1.3.20)

# chives-exchange
Implementation of a stock exchange with matching engine and a web UI powered by 
Flask.

## Getting started
The webserver communicates to the matching engine through RabbitMQ, which can be 
most easily run using docker:
```bash
docker run -d --rm \
    --name "rabbitmq" \
    -p 5672:5672 \
    -p 15672:15672 \
    rabbitmq:3-management
```

Both the webserver and the matching engine reads from and writes to a SQL 
database, which by default is a SQLite located in `/tmp/chives.sqlite`. To 
initialize the database schema:
```bash
python -m chives initdb
```

Run the webserver and matching engine in two separate processes. Make sure that 
the matching engine is not erroring out because of failure to connect to 
RabbitMQ.
```bash
python -m chives start_engine
python -m chives webserver
```

You can now follow the demo [here](https://xuganyu96.github.io/chives-exchange/) 
to try it out.


