Skip to content

ItaloNCcosta/backend-php-junior

 
 

Repository files navigation

backend-php-junior

Teste programador Backend PHP Júnior (Laravel)

Regras do desafio

regras

Pré-requisitos

Instalação

Siga estas etapas para configurar e executar o projeto usando Docker Compose:

  1. Clone o repositório:
 git clone https://github.com/seu-usuario/seu-projeto.git
  1. Navegue até o diretório do projeto:
 cd seu-projeto
  1. Acesse o container da API:
 docker-compose exec user-api-test bash
  1. Dentro do container da API, execute as migrações e seeds do banco de dados:
 php artisan migrate --seed
  1. Acesse a rota de ping para verificar se a api esta online
 http://localhost:8000/api/ping
  1. Teste as rotas/endpoints:

    • GET /api/user/{user}

      curl -X GET http://localhost:8000/api/user/1
      
    • POST /api/user

      curl -X POST -H "Content-Type: application/json" -d '{"name":"Usuario","cpf":"99999999999","email":"[email protected]","password":"password","password_confirmation":"password"}' http://localhost:8000/api/user
      
    • PUT /api/user/{user}

      curl -X PUT -H "Content-Type: application/json" -d '{"name":"Usuario atualizado","cpf":"11111111111","email":"[email protected]","password":"123123123","password_confirmation":"123123123"}' http://localhost:8000/api/user/2
      
    • DELETE /api/user/{user}

      curl -X DELETE http://localhost:8000/api/user/2
      
    • POST /api/login

      curl -X POST -H "Content-Type: application/json" -d '{"email":"[email protected]","password":"123123123"}' http://localhost:8000/api/login
      

Comandos Úteis

  • Parar os containers:

     docker-compose down
  • Visualizar os logs dos containers:

     docker-compose logs -f

Contribuições

Sinta-se à vontade para avaliar, relatar bugs ou melhorias.

About

Teste programador Backend PHP Júnior (Laravel)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 64.8%
  • Blade 34.2%
  • Other 1.0%