Modern applications are increasingly built with web technologies but are expected to behave like professional desktop tools. This document defines the principles, patterns, and behavioral rules that make a web-based application feel desktop-class instead of page-centric.
- Install deps
npx husky-init && yarn add -D eslint prettier eslint-config-universe lint-staged @commitlint/cli @commitlint/config-conventional eslint-plugin-md - Add config rules to your package.json file:
"eslintConfig": {
"root": true,
"ignorePatterns": [
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function _encode(obj: object) { | |
| let string = ""; | |
| for (const [key, value] of Object.entries(obj)) { | |
| if (!value) continue; | |
| string += `&${encodeURIComponent(key)}=${encodeURIComponent(value)}`; | |
| } | |
| return string.substring(1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| declare(strict_types=1); | |
| namespace SeoBakery\Test\TestCase\Core; | |
| use Cake\ORM\Table; | |
| use Cake\ORM\TableRegistry; | |
| use Cake\TestSuite\TestCase; | |
| use SeoBakery\Test\SeoObjects\Product; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { | |
| BeforeCreate, | |
| BeforeUpdate, | |
| Collection, | |
| Entity, | |
| EntityManager, | |
| EntityRepositoryType, | |
| ManyToOne, | |
| OneToMany, | |
| Property, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Controller\Api; | |
| use App\Controller\AppController; | |
| use Crud\Controller\Component\CrudComponent; | |
| use Crud\Controller\ControllerTrait; | |
| use Exception; | |
| /** | |
| * ApiApp Controller |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import {useField} from 'formik'; | |
| import {FormFeedback, FormGroup, Input, Label} from 'reactstrap'; | |
| export const InputText = ({label, ...props}) => { | |
| props.type = props.type || 'text'; | |
| const [field, meta, helpers] = useField(props); | |
| const id = `${field.name}Input`; | |
| const isInvalid = !!(meta.touched && meta.error); | |
| const errorMsg = meta.error || ' '; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Authentication\Authenticator; | |
| use ArrayAccess; | |
| use Authentication\Authenticator\FormAuthenticator; | |
| use Authentication\Authenticator\Result; | |
| use Authentication\Identifier\IdentifierInterface; | |
| use Cake\Utility\Security; | |
| use Firebase\JWT\JWT; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Authentication\Authenticator; | |
| use Authentication\Authenticator\FormAuthenticator; | |
| use Psr\Http\Message\ServerRequestInterface; | |
| /** | |
| * Class ApiAuthenticator | |
| * @package App\Authentication\Authenticator |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| public function getAuthenticationService(ServerRequestInterface $request, ResponseInterface $response) | |
| { | |
| $service = new AuthenticationService(); | |
| $fields = [ | |
| 'username' => 'email', | |
| 'password' => 'password' | |
| ]; |
NewerOlder