Powered by Atom Framework
- 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, ...
require __DIR__ . '/../vendor/autoload.php'; use Atom\Http\Server; try { $server = new Server(['env']); $server->handle(); } catch (Exception $e) { echo $e->getMessage(); }
- 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
- Set up database by importing
users.sql
atstorage/sql
folder - Install Atom and related packages
composer install
- Go to browser with below url and Enjoy it
http://127.0.0.1:8010/admin
- Based on your works, you can add new route into
api
orweb
file atRoutes
folder. Atom framework verifies api by prefix url (ex: http://127.0.0.1:8010/api/users) or header value (ex: Content-Type:application/json)
- New Controller class must be extended BaseController class
- [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 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
- Atom provides PhpToJs to transform PHP variables to Js variables more detail
- Set templates at
config/templates.php
. Item hasnull
value which will be replaced - With
template()
function, please refer toapp/Controllers/User/UserController@list()
- With
Template
class, please refer toapp/Controllers/User/UserController@updateForm()
- Set
DBAL_IN_USE = true
andDBAL_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
- Create an Controler, please refer to GraphQLUserController class
- Create an Schema, please refer to User schema
- Create an Resolver, please refer to CreateUserResolver class