Due to some weird bug in `php artisan serve` command it was causing the server to hangs while generating the access token using "Guzzle Http". So to fix that issue there was two options:
1. Either to create a virtual host and use the last commit (the one before this commit) as it is (this was how my dev environment was setup) **OR**,
2. To pull the latest commit in which I have modified the login procedure to make it work with `php artisan serve` command (i.e. Getting rid of Guzzle HTTP in login).
*** I have modified the login procedure to save the time needed to configure the virtual host.***
- Go to
client
directory and install required packages =>cd client && npm install
- Change
.env
file to matchserver
URL - Run
npm start
- Open the browser and visit the given URL (usually "localhost/3000")
cd server && composer install
- This app is using
MySQL
database, so you will need to create a database first. - Copy the
.env.example
file and rename it to.env
then changeDB
credentials andURL
- Run
php artisan migrate --seed
. This will generate (5) dummy users as follows [user1@user.com, user2@user.com, ...etc]. All users password is12345678
. Also, will generate 30 dummy items. - Run
php artisan passport:install
- Run
php artisan serve
- Run
php artisan queue:listen
[THIS IS CRUCIAL TO ENABLE AUTO_BIDDING FEATURE, SEE NOTES BELOW]
I have assumed that the max amount set by the user as an auto-bidding configuration will be ONLY used with auto-bidding. i.e. if the user sets the max-auto biding amount to 50$
this will mean that the maximum amount he will use for auto-bdding is 50$
plus whatever was the initial bidding value that was entered by the user manually when he first submit his/her bid.
-
To help mitigate the concurrency problem with auto-bidding I have used the
Pessimistic Locking
approach in conjunction with dbtransactions
to ensure data consistency and isolation. -
Why did I use
Queues
? Well, in order to enable auto-bidding feature I have to run this in the background to be able to control when to dispatch queue jobs and hence not to overload the server. -
In order to enable auto-bidding feature you MUST start Laravel queue. You can do this by running
php artisan queue:work