Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
APPLICATION=./

DOCKER_IP=10.0.75.1

DATA_SAVE_PATH=C:\temp

NGINX_HOST_HTTP_PORT=80
NGINX_HOST_HTTPS_PORT=443
NGINX_HOST_LOG_PATH=./docker/logs/nginx/
NGINX_SITES_PATH=./docker/nginx/sites/
NGINX_PHP_UPSTREAM_CONTAINER=php-fpm
NGINX_PHP_UPSTREAM_PORT=9000

MYSQL_VERSION=8.0
MYSQL_DATABASE=default
MYSQL_USER=default
MYSQL_PASSWORD=secret
MYSQL_PORT=3306
MYSQL_ROOT_PASSWORD=root
MYSQL_ENTRYPOINT_INITDB=./docker/mysql/docker-entrypoint-initdb.d

PHP_FPM_INSTALL_BLACKFIRE=false
PHP_FPM_INSTALL_XDEBUG=false
PHP_FPM_INSTALL_MONGO=true
PHP_FPM_INSTALL_MSSQL=false
PHP_FPM_INSTALL_SOAP=true
PHP_FPM_INSTALL_ZIP_ARCHIVE=true
PHP_FPM_INSTALL_BCMATH=true
PHP_FPM_INSTALL_PHPREDIS=true
PHP_FPM_INSTALL_MEMCACHED=false
PHP_FPM_INSTALL_OPCACHE=true
PHP_FPM_INSTALL_EXIF=false
PHP_FPM_INSTALL_MYSQLI=true
PHP_FPM_INSTALL_TOKENIZER=true
PHP_FPM_INSTALL_INTL=true
PHP_FPM_INSTALL_GHOSTSCRIPT=false
PHP_FPM_INSTALL_LDAP=false
PHP_FPM_INSTALL_SWOOLE=false
PHP_FPM_INSTALL_XSL=true
PHP_FPM_INSTALL_IMAGE_OPTIMIZERS=false

REDIS_PORT=6379

TIMEZONE=UTC
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.idea/
/api/vendor/
/front/node_modules/
/temp/
/api/.idea/
/front/.idea/
77 changes: 51 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,59 @@
# A tarefa
Sua tarefa consiste em desenvolver uma API RESTful para manipular um determinado recurso. Deverá ser utilizado o framework Silex.
## Executar o projeto

# Requisitos
A escolha do recurso deverá ser feita pelo desenvolvedor, atendendo apenas os requisitos mínimos abaixo:
```
clone este repositório <dir>

* Deverá conter um ID
* Deverá conter pelo menos quatro propriedades (exemplos: nome, email, etc.)
* Deverá conter campos que armazenem as datas de criação e alteração do recurso
cd <dir>

A API deverá atender às seguintes exigências:
cd api

* Listagem de todos os recursos
* Busca de um recurso pelo ID
* Criação de um novo recurso
* Alteração de um recurso existente
* Exclusão de um recurso
* Aceitar e retornar apenas JSON
* Deverá possuir algum método de autenticação para utilização de seus endpoints
composer install

# Ferramentas
* PHP
* Banco de dados MySQL
* Framework Silex
docker-compose up -d
```

# Fluxo de desenvolvimento
1. Faça um fork deste repositório
2. Crie uma nova branch e nomeie-a com seu usuário do Github
3. Quando o desenvolvimento estiver concluído, faça um pull request
### Fron
```
http://localhost
```

# Padrões de nomenclatura
1. Código fonte, nome do banco de dados, tabelas e campos devem estar em inglês
### Api

**Inclua no seu commit todos os arquivos necessários para que possamos testar o código.**
```
http://localhost/api

/winners [post, get]
post: {"first_name": "John", "last_name": "Doe", "identity":"408641940", "birthday": "1-01-01", "city": "São Paulo", "state": "SP"}
/winners/id [put, delete]

/draws [post, get]
post: {"date": "2017-11-22", "winner_id": Inteiro ou Nulo}
/draws/id [put, delete]

```
adicionar na header: Authorization e Contentt-Type
```
Content-Type:application/json
Authorization:1029371929182

```

Requerimentos

PHP ^7.1.x
Composer

Docker ^17.02.2-ce
Docker-compose

### Obs

se necessário alterar o ip do docker em <dir>/.env

### Testes

```
cd <dir>

vendor/bin/behat
```
1 change: 1 addition & 0 deletions api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/vendor/
8 changes: 8 additions & 0 deletions api/behat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# behat.yml
default:
autoload:
- %paths.base%/tests/features/context
suites:
all:
paths: [ %paths.base%/tests/features/winner.feature ]
contexts: [ Tests\Acceptance\FeatureContext ]
39 changes: 39 additions & 0 deletions api/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "Thiago-Medeiros/teste",
"description": "A single project",
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.1.0",
"illuminate/database": "^5.5",
"nesbot/carbon": "^1.22",
"silex/silex": "~2.0",
"silex/web-profiler": "~2.0",
"symfony/browser-kit": "~2.8|^3.0",
"symfony/class-loader": "~2.8|^3.0",
"symfony/config": "~2.8|^3.0",
"symfony/console": "~2.8|^3.0",
"symfony/debug": "~2.8|^3.0",
"symfony/finder": "~2.8|^3.0",
"symfony/monolog-bridge": "~2.8|^3.0",
"symfony/process": "~2.8|^3.0",
"symfony/security": "~2.8|^3.0",
"symfony/translation": "~2.8|^3.0",
"symfony/validator": "~2.8|^3.0",
"symfony/dotenv": "^3.3"
},
"autoload": {
"psr-0": {
"": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\Acceptance\\": "tests/features/context/"
}
},
"require-dev": {
"behat/behat": "^3.4",
"phpunit/phpunit": "^6.4"
}
}
Loading