This is our sample application for use in our Workshops.
It comprises of a selection of example services as follows:
- FastApi Order Service - A FastAPI Application for placing orders
- Click Fulfilment Service - A Terminal Command for processing orders
- Postgres DB - Where order details are stored
- RabbitMQ - Where orders are processed in a Publisher/Consumer queue
- Redis - Used as a product data cache
In your terminal window:
# Clone the repository for local development
git clone git@github.com:FirneyGroup/fastapi-docker.git
# Change directory into the project root
cd ./fastapi-docker
# Store the project root path for later use
ROOT_DIR=`pwd`
# cd into the fulfilment service and copy the env file
cd $ROOT_DIR/src/click-fulfilment-service/
cp click-fulfilment-service.env.sample click-fulfilment-service.env
# cd into the order service and copy the env file
cd $ROOT_DIR/src/fastapi-order-service/
cp fastapi-order-service.env.sample fastapi-order-service.env
# cd into the postgres service and copy the env file
cd $ROOT_DIR/db/postgres/
cp db.env.sample db.env
# cd into the rabbitmq service and copy the env file
cd $ROOT_DIR/db/rabbitmq/
cp rabbitmq.env.sample rabbitmq.env
cd $ROOT_DIR
Requires docker-compose
to be installed on your machine.
docker-compose up -d
Requires docker-compose
to be installed on your machine.
docker-compose down
Import the file ./Public.postman_collection.json
into your Postman instance.
In your terminal window:
# Change to the root directory of the project
cd $ROOT_DIR
# Run the fulfilment service using the script
./fulfil
- Import the postman collection into Postman / Hoppscotch
- Run the
./fulfil
Command as shown in the "Start the filfilment service" section above - Run the
Seeder/Seed
API call to populate the database - Run the
Products/List All Products
API call to see all the products in the database - Run the
Orders/Place Orders
API call to Place an order with the fastapi-order-service - Note the order output from the
./fulfil
command - Run the
Orders/List All Orders
API call to List all Orders in the database - Press CTRL+C in your terminal window to cancel the
./fulfil
service at any time