An application to manage soccer teams and its players.
- Docker
- Clone this repository to your local.
- Run
docker-compose up --build
on the project root directory to install the composer packages. - SSH into the soccer-teams-app docker container and you can find the project files under the /var/www/html folder.
- Now run
php artisan migrate
to migrate the database tables. - Run
php artisan db:seed
to seed the admin user. Email: test@example.com Password: password (For safety, this command will seed the default admin user only in environment other than production.) - Now visit
http://localhost:8080
in the browser and see {"message":"success"} json to confirm server started properly. - To add a new user, run
php artisan user:add
. And you can set the user as admin by confirming on the prompt asked on executing the command. - Run
php artisan route:list
to see all the available routes. Else refer to API Route List in the README.md file. - For postman collection please use the following link to import.
https://api.postman.com/collections/13323251-cfb6f90e-20a8-4ed1-a776-c136934c3c10?access_key=PMAT-01GZVA67KPQPDZS67A631NAK2J
- Use the Create Team, Create Player routes to add new teams and players.
- To update use Update Team and Update Player routes.
- To delete use Delete Team and Delete Player routes.
- Once added, to list the teams and players visit Get Teams and Get Players API respectively.
- Once started your docker containers, SSH into your soccer-teams-app docker container and under the /var/www/html folder run
php artisan test
. - Once executed it will list all the test class name along with the executed test case and status in detail.
POST api/v1/login
DELETE api/v1/logout
GET|HEAD api/v1/teams
Header: Authorization: Bearer {token}
URI: POST api/v1/teams
URI: GET|HEAD api/v1/teams/{team}
Header: Authorization: Bearer {token}
URI: PUT|PATCH api/v1/teams/{team}
Header: Authorization: Bearer {token}
URI: DELETE api/v1/teams/{team}
URI: GET|HEAD api/v1/teams/{team}/players
Header: Authorization: Bearer {token}
URI: POST api/v1/teams/{team}/players
URI: GET|HEAD api/v1/teams/{team}/players/{player}
Header: Authorization: Bearer {token}
URI: PUT|PATCH api/v1/teams/{team}/players/{player}
Header: Authorization: Bearer {token}
URI: DELETE api/v1/teams/{team}/players/{player}