Welcome to StockTradingApp!
Before you begin, ensure you have the following prerequisites installed:
- Ruby 3.2.2
- Rails 7.0.8
- Clone the repository:
git clone git@github.com:abwahed/stock_trading_app.git - Navigate to the project directory:
cd stock_trading_app - Install gem dependencies:
bundle install - Set up the database:
rails db:setup - Run DB migrate:
rails db:migrate - Start the Rails server:
rails server
Open config/database.yml file and set the password for your development mysql database.
This app uses HTTP basic authentication with username and password
-
create
end_point: POST
base_url/businessesrequest body
{ "business" : { "name" : "XYZ Inc.", "shares_available": 400 } } -
index
end_point: GET
base_url/businesses -
order_history
end_point: GET
base_url/businesses/:id/order_history
-
create
end_point: POST
base_url/businesses/:business_id/ordersrequest body
{ "order" : { "quantity" : 12, "price": 40.55 } } -
index
end_point: GET
base_url/businesses/:business_id/orders -
update
end_point: PATCH
base_url/orders/:idrequest body
{ "order" : { "quantity" : 12, "price": 40.55 } } -
accept
end_point: PATCH
base_url/orders/:id/accept -
reject
end_point: PATCH
base_url/orders/:id/reject