Requerimentos: PHP 8.0 ou superior, Composer, MySQL
Clone o projeto:
git clone https://github.com/taylormoreira1/backend-laravel-api-tasks
Navegue até a pasta do projeto:
cd backend-laravel-api-tasks
Faça uma cópia de .env.example para .env e altere as credenciais do banco:
cp .env.example .env
DB_CONNECTION=mysql
DB_HOST=db
DB_PORT=3306
DB_DATABASE=default
DB_USERNAME=laravel
DB_PASSWORD=secret
Inicie os contêineres:
docker-compose up -d
Entre no container:
docker exec -it taylor-app bash
Execute o comando composer install:
composer install
Configure a chave do aplicativo:
php artisan key:generate
Execute as migrations do banco de dados:
php artisan migrate
Rodar as seeders execute:
php artisan db:seed
obs: para utilizar algum usuário das seed utilize o email do usuário com a senha "teste12345"
Na raiz do projeto tem uma collection para importar no Postman com todos os endpoints da api: Taks api.postman_collection
- Method: POST
- URL: http://127.0.0.1:8000/api/register
- Headers:
- Content-Type: application/json
- Accept: application/json, text/plain, /
- Body:
- name: string
- email: string(email)
- password: string
- password_confirmation: string
- Method: POST
- URL: http://127.0.0.1:8000/api/auth/login
- Headers:
- Content-Type: application/json
- Accept: application/json
- Body:
- email: string(email)
- password: string
- Method: GET
- URL: http://127.0.0.1:8000/api/auth/user-profile
- Authorization: Bearer Token
- Method: POST
- URL: http://127.0.0.1:8000/api/auth/refresh
- Authorization: Bearer Token
- Method: POST
- URL: http://127.0.0.1:8000/api/auth/logout
- Authorization: Bearer Token
- Method: GET
- URL: http://127.0.0.1:8000/api/tasks/
- Authorization: Bearer Token
- Method: POST
- URL: http://127.0.0.1:8000/api/tasks/
- Headers:
- Content-Type: application/json
- Body:
- name: string
- description: string
- Method: PUT
- URL: http://127.0.0.1:8000/api/tasks/15
- Headers:
- Content-Type: application/json
- Body:
- name: string
- description: string
- deadline: datetime
- Method: DELETE
- URL: http://127.0.0.1:8000/api/tasks/12
- Authorization: Bearer Token
link para o projeto frontend: https://github.com/taylormoreira1/frontend-react-api-tasks