Giter VIP home page Giter VIP logo

ezycrazy's Introduction

ezycrazy

Powered by Atom Framework

The Application Structure

  • app: contains logic folders including Controllers, Models, Routes
  • public: contains unrestricted files such as photos, css, js
  • config: contains config files : env.inc, app.php, ...
  • resources: contains all view files.
  • storage: likes local storage to contain log, ...

Single Point Entry

index.php

require __DIR__ . '/../vendor/autoload.php';

use Atom\Http\Server;

try {
    $server = new Server(['env']);
    $server->handle();
} catch (Exception $e) {
    echo $e->getMessage();
}

Installing/Configuration

  • After cloned, you come to docker folder and run command:
docker-compose up -d
  • Create env.ini file by:
cp env.ini.sample config/env.ini
  • Obtain IPAddress and Update Database host in env.ini
docker inspect docker_ezy_mysql_1 | grep IPAddress
composer install
  • Go to browser with below url and Enjoy it
http://127.0.0.1:8010/admin

MEMO

New Route

New Controller

New Model

  • [Database driver: mysqli] New Model class must be extended BaseModel class
  • [Database driver: pdo_mysql] New Model class must be extended BaseModel class

New Middleware

  • New Middleware must be created in [Middlewares folders(app/Middlewares) and has primary method handle(). Please refer to PhpToJs
  • New Middleware has to declare at config/middleware.php

PHP to JS

  • Atom provides PhpToJs to transform PHP variables to Js variables more detail

Template Provider

  • Set templates at config/templates.php. Item has null value which will be replaced
  • With template() function, please refer to app/Controllers/User/UserController@list()
  • With Template class, please refer to app/Controllers/User/UserController@updateForm()

Doctrine Database Abstract Layer

  • Set DBAL_IN_USE = true and DBAL_PATH_CONFIG = '/../app/Entities' in env file
  • Create an Entity, please refer to Product class
  • Create an Controler, please refer to ProductController class
  • Generate the Database schema
php vendor/doctrine/orm/bin/doctrine orm:schema-tool:create
php vendor/doctrine/orm/bin/doctrine orm:schema-tool:update

GraphQL

ezycrazy's People

Contributors

cuongdinhngo avatar cuongnd-nta avatar

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.