If you would like to use Docker image with PostgreSQL provided by us,
run docker-compose up -d. You're done for this step.
If you have PostgreSQL installed directly in your system and prefer to use it, create
-
.env.development.localcontaining:DATABASE_URL=postgresql:///ecommerce_development
-
.env.test.localcontaining:DATABASE_URL=postgresql:///ecommerce_test
It should would work for most of the cases. If you have more sophisticated setup,
you need to update DATABASE_URL.
- run
make installto install dependencies, create db, setup schema and seed data - run
make devto start the rails server and tailwindcss watcher
- run
make testto run unit and integration tests - run
make mutateto perform mutation coverage
In event-driven architectures, navigation between events and handlers can be challenging, so we've created a script that generates two classes:
EventToHandlersHandlerToEvents
They contain mappings between events and handlers, so it should help you with navigation during the development.
The script is called big_picture.rb, and you can execute it like this:
bin/rails r script/big_picture.rbThere's a process manager responsible for dealing with the process of expiring orders.
It takes the following events as the input:
- Ordering::OrderPlaced
- Ordering::OrderExpired
- Ordering::OrderConfirmed
- Payments::PaymentAuthorized
- Payments::PaymentReleased
When certain conditions are met the process manager return a
ReleasePayment command.
Another process manager is responsible for confirming order. It does it, when a successful payment is detected.