This is a simple demonstration project that consumes the Hail Articles' API with backend OAuth authentication.
- Docker - https://docs.docker.com/get-docker/
- Docker Compose - https://docs.docker.com/compose/install/
You may need to use ./vendor/bin/sail
in place of sail
below.
- Clone the git repository
- Configure the .env file (copy the .env.example)
Set your Hail OAuth credentials:
HAIL_CLIENT_ID
andHAIL_SECRET
To create OAuth application credentials, these can be found under your Account settings → Manage developer settings. - run
sail build && sail up
See Tip below if you have port conflicts
- run
sail artisan key:generate && sail artisan migrate
- run
sail artisan oauth:connect hail
Open the URL from the output in your browser and follow the prompts.
- run
sail artisan organisation:list
to retrieve a bunch of organisation ids and their names - Set
HAIL_ORG_ID=
to one of the IDs return from the previous command - Run the unit tests
sail test
Tip: You can change the ...PORT...
variables in the .env to avoid clashing with other applications that might be using ports 80, 3306, or 6379 on your host.
Make sure to run sail up
after making the port changes.