This commit is contained in:
Tommy Parnell
2021-07-08 17:02:36 -04:00
commit c6cf1ba03f
23 changed files with 6722 additions and 0 deletions

21
.env.example Normal file
View File

@@ -0,0 +1,21 @@
# The environment Craft is currently running in (dev, staging, production, etc.)
ENVIRONMENT=dev
# The application ID used to to uniquely store session and cache data, mutex locks, and more
APP_ID=
# The secure key Craft will use for hashing and encrypting data
SECURITY_KEY=
# Database Configuration
DB_DRIVER=mysql
DB_SERVER=127.0.0.1
DB_PORT=3306
DB_DATABASE=
DB_USER=root
DB_PASSWORD=
DB_SCHEMA=public
DB_TABLE_PREFIX=
# The URI segment that tells Craft to load the control panel
CP_TRIGGER=admin

4
.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
/.env
/.idea
/vendor
.DS_Store

3
Procfile Normal file
View File

@@ -0,0 +1,3 @@
web: vendor/bin/heroku-php-nginx -C nginx_app.conf web
worker: ./craft queue/listen --verbose
release: ./bin/release.sh

6
bin/release.sh Normal file
View File

@@ -0,0 +1,6 @@
if php craft install/check
then
php craft migrate/all --interactive=0
php craft project-config/apply --interactive=0
php craft cache/flush-schema db --interactive=0
fi

27
composer.json Normal file
View File

@@ -0,0 +1,27 @@
{
"require": {
"craftcms/cms": "^3.6.4",
"vlucas/phpdotenv": "^3.4.0",
"codemix/yii2-streamlog": "^1.3"
},
"require-dev": {
"yiisoft/yii2-shell": "^2.0.3"
},
"autoload": {
"psr-4": {
"modules\\": "modules/"
}
},
"config": {
"sort-packages": true,
"optimize-autoloader": true,
"platform": {
"php": "7.2.5"
}
},
"scripts": {
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
]
}
}

6141
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

44
config/app.php Normal file
View File

@@ -0,0 +1,44 @@
<?php
/**
* Yii Application Config
*
* Edit this file at your own risk!
*
* The array returned by this file will get merged with
* vendor/craftcms/cms/src/config/app.php and app.[web|console].php, when
* Craft's bootstrap script is defining the configuration for the entire
* application.
*
* You can define custom modules and system components, and even override the
* built-in system components.
*
* If you want to modify the application config for *only* web requests or
* *only* console requests, create an app.web.php or app.console.php file in
* your config/ folder, alongside this one.
*/
use craft\helpers\App;
return [
'*' => [
'id' => App::env('APP_ID') ?: 'CraftCMS',
'modules' => [
'my-module' => \modules\Module::class,
],
],
'production' => [
'components' => [
'log' => [
'targets' => [
[
'class' => codemix\streamlog\Target::class,
'url' => 'php://stderr',
'levels' => ['error', 'warning'],
'logVars' => []
]
]
]
]
]
//'bootstrap' => ['my-module'],
];

30
config/db.php Normal file
View File

@@ -0,0 +1,30 @@
<?php
/**
* Database Configuration
*
* All of your system's database connection settings go in here. You can see a
* list of the available settings in vendor/craftcms/cms/src/config/DbConfig.php.
*
* @see craft\config\DbConfig
*/
use craft\helpers\App;
return [
'*' => [
'dsn' => App::env('DB_DSN') ?: null,
'driver' => App::env('DB_DRIVER'),
'server' => App::env('DB_SERVER'),
'port' => App::env('DB_PORT'),
'database' => App::env('DB_DATABASE'),
'user' => App::env('DB_USER'),
'password' => App::env('DB_PASSWORD'),
'schema' => App::env('DB_SCHEMA'),
'tablePrefix' => App::env('DB_TABLE_PREFIX'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
],
'production' => [
'url' => getenv('DATABASE_URL')
]
];

37
config/general.php Normal file
View File

@@ -0,0 +1,37 @@
<?php
/**
* General Configuration
*
* All of your system's general configuration settings go in here. You can see a
* list of the available settings in vendor/craftcms/cms/src/config/GeneralConfig.php.
*
* @see \craft\config\GeneralConfig
*/
use craft\helpers\App;
$isDev = App::env('ENVIRONMENT') === 'dev';
$isProd = App::env('ENVIRONMENT') === 'production';
return [
// Default Week Start Day (0 = Sunday, 1 = Monday...)
'defaultWeekStartDay' => 1,
// Whether generated URLs should omit "index.php"
'omitScriptNameInUrls' => true,
// The URI segment that tells Craft to load the control panel
'cpTrigger' => App::env('CP_TRIGGER') ?: 'admin',
// The secure key Craft will use for hashing and encrypting data
'securityKey' => App::env('SECURITY_KEY'),
// Whether Dev Mode should be enabled (see https://craftcms.com/guides/what-dev-mode-does)
'devMode' => $isDev,
// Whether administrative changes should be allowed
'allowAdminChanges' => $isDev,
// Whether crawlers should be allowed to index pages and following links
'disallowRobots' => !$isProd,
];

View File

@@ -0,0 +1,11 @@
{
"Attr.AllowedFrameTargets": [
"_blank"
],
"Attr.EnableID": true,
"HTML.AllowedComments": [
"pagebreak"
],
"HTML.SafeIframe": true,
"URI.SafeIframeRegexp": "%^(https?:)?//(www.youtube.com/embed/|player.vimeo.com/video/)%"
}

View File

@@ -0,0 +1,19 @@
{
"buttons": [
"html",
"formatting",
"bold",
"italic",
"unorderedlist",
"orderedlist",
"link",
"image",
"video"
],
"plugins": [
"fullscreen",
"video"
],
"linkNewTab": true,
"toolbarFixed": true
}

View File

@@ -0,0 +1,4 @@
{
"buttons": ["bold", "italic"],
"toolbarFixed": true
}

23
config/routes.php Normal file
View File

@@ -0,0 +1,23 @@
<?php
/**
* Site URL Rules
*
* You can define custom site URL rules here, which Craft will check in addition
* to any routes youve defined in Settings → Routes.
*
* See http://www.yiiframework.com/doc-2.0/guide-runtime-routing.html for more
* info about URL rules.
*
* In addition to Yiis supported syntaxes, Craft supports a shortcut syntax for
* defining template routes:
*
* 'blog/archive/<year:\d{4}>' => ['template' => 'blog/_archive'],
*
* That example would match URIs such as `/blog/archive/2012`, and pass the
* request along to the `blog/_archive` template, providing it a `year` variable
* set to the value `2012`.
*/
return [
];

28
craft Executable file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/env php
<?php
/**
* Craft console bootstrap file
*/
// Define path constants
define('CRAFT_BASE_PATH', __DIR__);
define('CRAFT_VENDOR_PATH', CRAFT_BASE_PATH . '/vendor');
// Load Composer's autoloader
require_once CRAFT_VENDOR_PATH . '/autoload.php';
// Load dotenv?
if (class_exists('Dotenv\Dotenv') && file_exists(CRAFT_BASE_PATH . '/.env')) {
Dotenv\Dotenv::create(CRAFT_BASE_PATH)->load();
}
// Define additional PHP constants
// (see https://craftcms.com/docs/3.x/config/#php-constants)
define('CRAFT_ENVIRONMENT', getenv('ENVIRONMENT') ?: 'production');
// ...
// Load and run Craft
/** @var craft\console\Application $app */
$app = require CRAFT_VENDOR_PATH . '/craftcms/cms/bootstrap/console.php';
$exitCode = $app->run();
exit($exitCode);

44
modules/Module.php Normal file
View File

@@ -0,0 +1,44 @@
<?php
namespace modules;
use Craft;
/**
* Custom module class.
*
* This class will be available throughout the system via:
* `Craft::$app->getModule('my-module')`.
*
* You can change its module ID ("my-module") to something else from
* config/app.php.
*
* If you want the module to get loaded on every request, uncomment this line
* in config/app.php:
*
* 'bootstrap' => ['my-module']
*
* Learn more about Yii module development in Yii's documentation:
* http://www.yiiframework.com/doc-2.0/guide-structure-modules.html
*/
class Module extends \yii\base\Module
{
/**
* Initializes the module.
*/
public function init()
{
// Set a @modules alias pointed to the modules/ directory
Craft::setAlias('@modules', __DIR__);
// Set the controllerNamespace based on whether this is a console or web request
if (Craft::$app->getRequest()->getIsConsoleRequest()) {
$this->controllerNamespace = 'modules\\console\\controllers';
} else {
$this->controllerNamespace = 'modules\\controllers';
}
parent::init();
// Custom initialization code goes here...
}
}

20
nginx_app.conf Normal file
View File

@@ -0,0 +1,20 @@
location / {
# try to serve file directly, fallback to rewrite
try_files $uri @rewriteapp;
}
location @rewriteapp {
# rewrite all to index.php
rewrite ^(.*)$ /index.php?p=$1 last;
}
location ~ ^/(index)\.php(/|$) {
fastcgi_pass heroku-fcgi;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS on;
}
# Global Config
client_max_body_size 20M;

5
storage/.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
backups
composer-backups
config-backups
logs
runtime

0
templates/.gitkeep Normal file
View File

191
templates/index.twig Normal file
View File

@@ -0,0 +1,191 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="utf-8" />
<title>Welcome to Craft CMS</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
<meta name="referrer" content="origin-when-cross-origin" />
<style>
html,
body {
font-size: 16px;
-webkit-text-size-adjust: 100%;
height: 100%;
font-family: system-ui, BlinkMacSystemFont, -apple-system, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}
body {
margin: 0;
padding: 0;
background-color: hsl(212, 60%, 97%);
color: hsl(209, 18%, 30%);
display: flex;
}
h1 {
margin-top: 0;
}
h2 {
margin-top: 24px;
font-size: 1em;
}
h2:first-child {
margin-top: 0;
}
p {
line-height: 1.4em;
margin-bottom: 1.4em;
}
ul {
line-height: 1.3em;
padding-left: 20px;
margin-bottom: 0;
}
ul li {
margin-bottom: 0.35em;
}
a {
color: #0B69A3;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.go {
color: #0B69A3;
}
.go:after {
padding-left: 4px;
content: '→';
text-decoration: none !important;
}
small {
color: hsl(211, 11%, 59%);
}
code {
display: inline-block;
color: #EF4E4E;
padding: 0 2px;
background: hsl(212, 60%, 97%);
border-radius: 3px;
line-height: 1.3;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-size: 0.9em;
}
#container {
flex-grow: 1;
}
#modal {
background: #fff;
}
#aside {
background: hsl(212, 60%, 97%);
}
.content {
padding: 35px;
padding-left: calc(35px + env(safe-area-inset-left));
padding-right: calc(35px + env(safe-area-inset-right));
}
@media (min-width:768px) {
#modal {
display: flex;
}
#main {
width: 50%;
overflow: auto;
}
#aside {
width: 50%;
overflow: auto;
}
}
@media (min-width:768px) and (min-height: 376px) {
body {
background-color: hsl(212, 50%, 93%);
background-image: url("{{ view.getAssetManager().getPublishedUrl('@app/web/assets/installer/dist', true, 'images/installer-bg.png') }}");
background-repeat: no-repeat;
background-size: cover;
background-position: center center;
}
#container {
display: flex;
padding: 24px;
align-items: center;
justify-content: center;
}
#modal {
height: 100%;
max-width: 800px;
max-height: 525px;
border-radius: 4px;
overflow: auto;
box-shadow: 0 25px 100px rgba(0, 0, 0, 0.5);
}
#aside {
overflow: auto;
}
}
</style>
</head>
<body class="ltr">
<div id="container">
<div id="modal">
<div id="main">
<div class="content">
<h1>Welcome</h1>
<p>Thanks for installing Craft CMS!</p>
<p>Youre looking at the <code>index.twig</code> template file located in your
<code>templates/</code> folder. Once youre ready to start building out your sites
front end, you can replace this with something custom.</p>
<p>If youre new to Craft CMS, take some time to check out the resources on the right
when you get a chance&mdash;especially
<a href="https://craftcms.com/discord" target="_blank">Discord</a>
and <a href="http://craftcms.stackexchange.com/" target="_blank">Stack Exchange</a>.
The Craft community is full of smart, friendly, and helpful people!</p>
<p><span class="go"><a href="{{ cpUrl('') }}">Go to your control panel</a></span></p>
</div>
</div>
<div id="aside">
<div class="content">
<h2>Popular Resources</h2>
<ul>
<li><a href="https://craftcms.com/docs/getting-started-tutorial/" target="_blank">Tutorial</a><br><small>Learn the basics.</small></li>
<li><a href="https://craftcms.com/docs/3.x/" target="_blank">Documentation</a><br><small>Read the official docs.</small></li>
<li><a href="https://craftcms.com/guides" target="_blank">Knowledge Base</a><br><small>Find answers to common problems.</small></li>
<li><a href="https://twitter.com/hashtag/craftcms" target="_blank">#craftcms</a><br><small>See the latest tweets about Craft.</small></li>
<li><a href="https://craftcms.com/discord" target="_blank">Discord</a><br><small>Meet the community.</small></li>
<li><a href="http://craftcms.stackexchange.com/" target="_blank">Stack Exchange</a><br><small>Get help and help others.</small></li>
<li><a href="https://craftquest.io/" target="_blank">CraftQuest</a><br><small>Watch unlimited video lessons and courses.</small></li>
<li><a href="http://craftlinklist.com/" target="_blank">Craft Link List</a><br><small>Stay in-the-know.</small></li>
<li><a href="https://nystudio107.com/blog" target="_blank">nystudio107 Blog</a><br><small>Learn Craft and modern web development.</small></li>
</ul>
</div>
</div>
</div>
</div>
</body>
</html>

9
web/.htaccess Normal file
View File

@@ -0,0 +1,9 @@
<IfModule mod_rewrite.c>
RewriteEngine On
# Send would-be 404 requests to Craft
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
RewriteRule (.+) index.php?p=$1 [QSA,L]
</IfModule>

2
web/cpresources/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*
!.gitignore

26
web/index.php Normal file
View File

@@ -0,0 +1,26 @@
<?php
/**
* Craft web bootstrap file
*/
// Define path constants
define('CRAFT_BASE_PATH', dirname(__DIR__));
define('CRAFT_VENDOR_PATH', CRAFT_BASE_PATH . '/vendor');
// Load Composer's autoloader
require_once CRAFT_VENDOR_PATH . '/autoload.php';
// Load dotenv?
if (class_exists('Dotenv\Dotenv') && file_exists(CRAFT_BASE_PATH . '/.env')) {
Dotenv\Dotenv::create(CRAFT_BASE_PATH)->load();
}
// Define additional PHP constants
// (see https://craftcms.com/docs/3.x/config/#php-constants)
define('CRAFT_ENVIRONMENT', getenv('ENVIRONMENT') ?: 'production');
// ...
// Load and run Craft
/** @var craft\web\Application $app */
$app = require CRAFT_VENDOR_PATH . '/craftcms/cms/bootstrap/web.php';
$app->run();

27
web/web.config Normal file
View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Rewrite" stopProcessing="true">
<match url="(.+)" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="^/(favicon\.ico|apple-touch-icon.*\.png)$" negate="true" />
</conditions>
<action type="Rewrite" url="index.php?p={R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
<urlCompression doStaticCompression="true" doDynamicCompression="true" />
<defaultDocument>
<files>
<clear />
<add value="index.php" />
<add value="index.htm" />
<add value="index.html" />
</files>
</defaultDocument>
</system.webServer>
</configuration>