-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7183313
Showing
18 changed files
with
752 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
OKTAAUDIENCE=api://default | ||
OKTAISSUER= | ||
SCOPE= | ||
OKTACLIENTID= | ||
OKTASECRET= | ||
DB_HOST=localhost | ||
DB_PORT=3306 | ||
DB_DATABASE= | ||
DB_USERNAME= | ||
DB_PASSWORD= |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"root": true, | ||
"env": { | ||
"browser": true, | ||
"es6": true | ||
}, | ||
"extends": ["prettier", "plugin:node/recommended", "plugin:json/recommended"], | ||
"plugins": ["prettier"], | ||
"globals": { | ||
"Atomics": "readonly", | ||
"SharedArrayBuffer": "readonly" | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 11, | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"prettier/prettier": "warn", | ||
"linebreak-style": "off", | ||
"no-unused-vars": "warn", | ||
"no-plusplus": "off", | ||
"spaced-comment": "off", | ||
"func-names": "off", | ||
"object-shorthand": "off", | ||
"no-param-reassign": ["error", { "props": false }], | ||
"node/no-unsupported-features/es-syntax": "off", | ||
"quotes": ["warn", "single"], | ||
"semi": ["error", "always", {"omitLastInOneLineBlock": true}], | ||
"node/no-unpublished-require": "off" | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
vendor/ | ||
.env | ||
*.swp | ||
*.vim |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"tagname-lowercase": true, | ||
"attr-lowercase": true, | ||
"attr-value-double-quotes": true, | ||
"doctype-first": true, | ||
"tag-pair": true, | ||
"spec-char-escape": true, | ||
"id-unique": true, | ||
"src-not-empty": true, | ||
"attr-no-duplication": true, | ||
"title-require": true, | ||
"head-script-disabled": true, | ||
"alt-require": true, | ||
"doctype-html5": true, | ||
"inline-style-disabled": true, | ||
"inline-script-disabled": true, | ||
"space-tab-mixed-disabled": "true", | ||
"id-class-ad-disabled": true, | ||
"spec-char-escape": false | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"printWidth": 120, | ||
"singleQuote": true, | ||
"arrowParens": "avoid" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "stylelint-config-standard-scss", | ||
"rules": { | ||
"alpha-value-notation": "off", | ||
"selector-class-pattern": false, | ||
"comment-empty-line-before": "off" | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
require 'vendor/autoload.php'; | ||
use Dotenv\Dotenv; | ||
use Src\System\DatabaseConnector; | ||
|
||
$dotenv = new DotEnv(__DIR__); | ||
$dotenv->load(); | ||
|
||
// run with $php bootstrap.php | ||
//echo getenv('OKTAAUDIENCE'); | ||
|
||
$dbConnection = (new DatabaseConnector())->getConnection(); | ||
//print_r($dbConnection); | ||
?> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"require": { | ||
"vlucas/phpdotenv": "^2.4" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Src\\": "src/" | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
require 'bootstrap.php'; | ||
|
||
$statement = <<<EOF | ||
CREATE TABLE IF NOT EXISTS person( | ||
id INT NOT NULL AUTO_INCREMENT, | ||
firstname VARCHAR(100) NOT NULL, | ||
lastname VARCHAR(100) NOT NULL, | ||
firstparent_id INT DEFAULT NULL, | ||
secondparent_id INT DEFAULT NULL, | ||
PRIMARY KEY(id), | ||
FOREIGN KEY(firstparent_id) REFERENCES person(id) ON DELETE SET NULL, | ||
FOREIGN KEY(secondparent_id) REFERENCES person(id) ON DELETE SET NULL | ||
) ENGINE=INNODB; | ||
INSERT INTO person | ||
(firstname, lastname, firstparent_id, secondparent_id) | ||
VALUES | ||
('Krasimir', 'Hristozov', null, null), | ||
('Maria', 'Hristozova', null, null), | ||
('Masha', 'Hristozova', 1, 2), | ||
('Jane', 'Smith', null, null), | ||
('John', 'Smith', null, null), | ||
('Richard', 'Smith', 4, 5), | ||
('Donna', 'Smith', 4, 5), | ||
('Josh', 'Harrelson', null, null), | ||
('Anna', 'Harrelson', 7, 8); | ||
EOF; | ||
|
||
try { | ||
$dbConnection->exec($statement); | ||
echo "Seeded with success!\n"; | ||
} catch(\PDOException $e) { | ||
exit($e->getMessage()); | ||
} | ||
?> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "testing-polyfill", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"build": "webpack" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"eslint": ">=6.8.0", | ||
"eslint-config-airbnb": ">=18.1.0", | ||
"eslint-config-node": ">=4.0.0", | ||
"eslint-config-prettier": ">=6.11.0", | ||
"eslint-plugin-import": ">=2.20.2", | ||
"eslint-plugin-json": ">=3.1.0", | ||
"eslint-plugin-jsx-a11y": ">=6.2.3", | ||
"eslint-plugin-node": ">=11.1.0", | ||
"eslint-plugin-prettier": ">=3.1.3", | ||
"eslint-plugin-react": ">=7.20.0", | ||
"eslint-plugin-react-hooks": ">=2.5.0", | ||
"fecs": ">=1.6.4", | ||
"htmlhint": ">=0.16.0", | ||
"jsonlint": ">=1.6.3", | ||
"lehre": ">=1.3.5", | ||
"prettier": ">=2.0.5", | ||
"stylelint": ">=13.5.0", | ||
"stylelint-config-standard": ">=20.0.0", | ||
"stylelint-config-standard-scss": ">=2.0.1" | ||
}, | ||
"keywords": [], | ||
"description": "" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
mysql -uroot -p | ||
CREATE DATABASE api_example CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
CREATE USER 'api_user'@'localhost' identified by 'api_password'; | ||
GRANT ALL on api_example.* to 'api_user'@'localhost'; | ||
quit | ||
|
||
mysql -uapi_user -papi_password api_example | ||
|
||
CREATE TABLE person ( | ||
id INT NOT NULL AUTO_INCREMENT, | ||
firstname VARCHAR(100) NOT NULL, | ||
lastname VARCHAR(100) NOT NULL, | ||
firstparent_id INT DEFAULT NULL, | ||
secondparent_id INT DEFAULT NULL, | ||
PRIMARY KEY (id), | ||
FOREIGN KEY (firstparent_id) | ||
REFERENCES person(id) | ||
ON DELETE SET NULL, | ||
FOREIGN KEY (secondparent_id) | ||
REFERENCES person(id) | ||
ON DELETE SET NULL | ||
) ENGINE=INNODB; |
Oops, something went wrong.