você não deveria escrever uma api para isso

Post on 12-Apr-2017

131 Views

Category:

Software

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

VOCÊ NÃO DEVERIA ESCREVER UMA API PARA ISSO!

MUITAS E MUITAS APPS

Identificar os pontos que contribuíram com a evolução do front-end.

PAUTA

Apresentar conceitos e ferramentas que possam ajudar em nossa jornada.

PAUTA

Apontar uma possível direção para as coisas.

PAUTA

@juniorconte

A EVOLUÇÃO DO FRONT-END

OS DEVICES E AS PLATAFORMAS EVOLUÍRAM

Gigabytes & multi cores

OS DEVICES E AS PLATAFORMAS EVOLUÍRAM

Conectividade & mobilidade

OS DEVICES E AS PLATAFORMAS EVOLUÍRAM

HTML5, CSS3 & V8

AMPLIAÇÃO DO PORTFÓLIO DE FERRAMENTAS

Generators, dependencias & tasks runners

AMPLIAÇÃO DO PORTFÓLIO DE FERRAMENTAS

Frameworks & bibliotecas

O BROWSER GANHOU O MUNDO

Cordova, Titanium & Ionic

O BROWSER GANHOU O MUNDO

Electron & NodeJS

CLOUD COM PREÇO JUSTO

Pague pelo que usar

CLOUD COM PREÇO JUSTO

Escale o quanto precisar

CLOUD COM PREÇO JUSTO

Next, next, finish

UM BOOM DE NOVAS IDÉIAS

VOU "ESCULPIR" MINHA PRÓPRIA API

ISSO PODE FICAR MAIOR QUE O IMAGINADO

API BASEADA EM ARQUIVO JSON

JSON Server github.com/typicode/json-server

GET A FULL FAKE REST API WITH ZERO CODING IN LESS THAN 30 SECONDS (SERIOUSLY)

CRIE UMA API REST FULL COMPLETA, COM ZERO DE CODIFICAÇÃO EM MENOS DE 30 SEGUNDOS (SÉRIO)

$ npm install -g json-server

{ "posts": [ { "id": 1, "title": "json-server", "author": "typicode" } ], "comments": [ { "id": 1, "body": "some comment", "postId": 1 } ], "profile": { "name": "typicode" } }

db.json

$ json-server --watch db.json

http://localhost:3000

{ "id": 1, "title": “json-server", "author": “typicode”

}

GET /posts/1

REST Ful, Filter, Slice, Sort, Operators, Full-text search, Relationships,

Extras

{ "id": 1, "title": “json-server", "author": “typicode”, "comments": [

{ "id": 1, "body": "some comment”, ”postId": 1

} ] }

GET /posts/1?_embed=comments

API BASEADA EM BANCOS DE DADOS

ArrestDB github.com/alixaxel/ArrestDB

ARRESTDB IS A "PLUG-N-PLAY" RESTFUL API FOR SQLITE, MYSQL AND POSTGRESQL DATABASES

ARRESTDB É UMA API REST FULL “PLUG-AND-PLAY” PARA BANCOS DE DADOS SQLITE, MYSQL E POSTGRESQL

Apache + PHP 5.4 & PDO + Banco de dados

SQLite: $dsn = ‘sqlite://./path/to/database.sqlite';

MySQL: $dsn = ‘mysql://[user[:pass]@]host[:port]/db/;

PostgreSQL: $dsn = ‘pgsql://[user[:pass]@]host[:port]/db/;

index.php

$clients = array ( '127.0.0.1', '127.0.0.2', '127.0.0.3', );

<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [L,QSA] </IfModule>

.htaccess

(C)reate > POST /table (R)ead > GET /table[/id] (R)ead > GET /table[/column/content] (U)pdate > PUT /table/id (D)elete > DELETE /table/id

REST Ful

by, order, limit, offset

EU PRECISO DE MAIS DO QUE UM JSON PARA SER FELIZ

API BASEADA EM BANCOS SQL/NOSQL

Related, filters, fields, expressions, limit, offset, bulk change, procedures, views e mais…

API FILES

Download e upload para cloud services ou local file

API NOTIFICATIONS

Envio de push notifications

API EMAIL

Envio de emails com suporte a templates gerenciáveis

API PROXY

Centraliza a autenticação sem adicionar ms

POLÍTICAS DE ACESSO BASEADA EM ROLES

Serviço, recurso, ação, origem e filtros

AUTENTICAÇÃO FLEXÍVEL

Oauth, LDAP, JWT, Single Sign-on

DOCUMENTAÇÃO AUTOMÁTICA

Swagger live doc

GERENCIAMENTO DE MÚLTIPLAS APPS

Cada usuário pode ter ou não acesso a uma APP

EVENT E CUSTOM SCRIPTS

Before e after actions, custom API's

platform.api.post('email', { template: ‘bem vindo', to: [ { name:’Junior Conte', email:’juniorcnt@gmail.com’ } ] });

Scripts em PHP ou JS

VÁRIOS INSTALADORES

Bitnami cloud installers, multi plataforma, github, VMs e Docker

5 PROJETOS EM PRODUÇÃO AO LONGO DO ÚLTIMO ANO

APP’S MAIS ESPECÍFICASSimples de desenvolver

APP’S MAIS ESPECÍFICASDivisíveis entre times

APP’S MAIS ESPECÍFICASPermitem experimentação

API’S MAIS GENÉRICASSimplesmente REST ful

API’S MAIS GENÉRICASMenos acoplamento

API'S PARA TODOS*, APP'S PARA POUCOS

* Quase todos

O CONCEITO DE MICROSERVICES APLICADO EM APPS

top related