Git Product home page Git Product logo

take-it-national-api's Introduction

Slim 3 API skeleton

This is Slim 3 API skeleton project for Composer. Project uses Zend Table Gateway and Phinx for database operations, Monolog for logging, and Fractal as a serializer. Vagrant virtualmachine config and Paw project files are included for easy development. The skeleton tries to follow DDD principles.

#Data structure

Main feature is to create and provide by API funnels. General outline of the database:

user table own website (with API credentials). website table own funnel which is representative for full funnel structure. funnel has nested children defined in funnel_element table.

Every element has type. Element types are defined in funnel_element_type table. Every type has required fields:

name - type name (ex. city, keyword, region)

pattern_url - url pattern which it will be available in customer site (ex. [keyword]-in-[city])

title - meta title (ex. 'This is [city]')

description - meta title (ex. 'In [city] You can...')

Additionally every element can have multiple attributes (in funnel_element_attribute) defined similar way in funnel_element_type_attribute, in other words funnel_element_attribute store valuesfor funnel_element_type_attribute keys.

Example structure available by API:

{
    "config": [{
        "name": "Paternity testing",
        "type": "keyword",
        "children": [{
            "name": "Pleasant Grove",
            "type": "city"
        }, {
            "name": "Jack Cullen Drive",
            "type": "city"
        }]
    },  {
        "name": "Mixed Martial Arts testing",
        "type": "keyword",
        "children": [{
            "name": "Pleasant Grove",
            "type": "city"
        }, {
            "name": "Jack Cullen Drive",
            "type": "city"
        }, {
            "name": "Texarkana Texas",
            "type": "city"
        }]
    }],
    "types": {
        "city": {
            "urlPattern": "[keyword]-in-[city]",
            "attributes": [],
            "metaTitlePattern": "Lab in [city]",
            "metaDescriptionPattern": "Lab in [city]"
        },
        "keyword": {
            "urlPattern": "[keyword]",
            "metaTitlePattern": " Labs [keyword]",
            "metaDescriptionPattern": "Labs [keyword]",
            "attributes": []
        }
    }
}

Usage

If you have Vagrant installed start the virtual machine.

$ vagrant up

Environment variables for development

Create and .env file and place it on the root directory with the following values:

DB_DSN=mysql:dbname=tin_dev;host=54.157.89.214
DB_NAME=tin_dev
DB_USER=tin_dev
DB_PASSWORD=KmNvbCv2d
DB_HOST=54.157.89.214
DB_DRIVER=pdo_mysql
DB_PORT=3306
JWT_SECRET=psku0t371wt7i5gkqonmulilzgwl

##Migrations Migrations library docs: https://book.cakephp.org/3.0/en/phinx.html

$ phinx migrate -e development
$ php vendor/bin/phinx migrate -e development

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.