Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyhacart committed Aug 24, 2024
1 parent 4b82d1c commit 9f7a6eb
Show file tree
Hide file tree
Showing 80 changed files with 6,825 additions and 2,315 deletions.
21 changes: 21 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,24 @@ APP_SECRET=3bUhVCRkHJfT2ZJTqBnvkclRFT1zy1ig
# To test the production environment, run "make go-prod" or "castor symfony:go-prod"

# To come back to the development environment, run "make go-dev" or "castor symfony:go-dev"

###> doctrine/doctrine-bundle ###
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
#
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4"
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4"
DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
###< doctrine/doctrine-bundle ###

###> symfony/messenger ###
# Choose one of the transports below
# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
###< symfony/messenger ###

###> symfony/mailer ###
# MAILER_DSN=null://null
###< symfony/mailer ###
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@
.phpunit.result.cache
.phpunit.cache
###< phpunit/phpunit ###

###> symfony/phpunit-bridge ###
.phpunit.result.cache
/phpunit.xml
###< symfony/phpunit-bridge ###
1 change: 0 additions & 1 deletion assets/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

import './bootstrap.js';
import './vendor/barecss/css/bare.min.css';
import './styles/app.css';

// "optin" - No turbo forms unless you insist. Use data-turbo="true" to enable turbo on individual forms.
Expand Down
9 changes: 9 additions & 0 deletions assets/controllers.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
{
"controllers": {
"@symfony/ux-live-component": {
"live": {
"enabled": true,
"fetch": "eager",
"autoimport": {
"@symfony/ux-live-component/dist/live.min.css": true
}
}
},
"@symfony/ux-turbo": {
"turbo-core": {
"enabled": true,
Expand Down
27 changes: 0 additions & 27 deletions assets/controllers/api_controller.js

This file was deleted.

24 changes: 0 additions & 24 deletions assets/controllers/hello_controller.js

This file was deleted.

50 changes: 1 addition & 49 deletions assets/js/stimulus.js
Original file line number Diff line number Diff line change
@@ -1,53 +1,5 @@
// @see https://stimulus.hotwired.dev/handbook/installing#using-other-build-systems
import {Application, Controller} from "@hotwired/stimulus" // reference version: Stimulus 3.2.1
import {Application} from "@hotwired/stimulus" // reference version: Stimulus 3.2.1

window.Stimulus = Application.start()
Stimulus.debug = false

Stimulus.register("hello", class extends Controller {
static targets = ["name", "greeting", "dialog", "form"]

connect() {
console.log("Hello, Stimulus!", this.element)
}

greet() {
if (!this.formTarget.reportValidity()) {
return
}

this.greetingTarget.innerHTML = `Hello, ${this.nameTarget.value}!`
this.dialogTarget.showModal()
}

reset() {
this.nameTarget.value = ''
this.greetingTarget.innerHTML = ''
}
})

Stimulus.register("api", class extends Controller {
static targets = ["title", "slug"]
static values = {
"url": String
}

connect() {
console.log("Dataset: ", this.element.dataset) // list all data properties of the controller
}

slugify() {
let apiUrl = this.urlValue + '?title=' + this.titleTarget.value
const slugTarget = this.slugTarget
fetch(apiUrl)
.then(function (response) {
return response.json()
})
.then(function (data) {
slugTarget.value = data.slug
})
.catch(function (error) {
console.log('An error occured. 😞', error);
})
}
})
18 changes: 3 additions & 15 deletions assets/styles/app.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
/**
* Mark required fields in Symfony forms.
*
* @see https://symfony.com/doc/current/forms.html#form-type-options
*/
label.required:after {
content: " *";
}

/**
* Form errors in red.
*/
form > div > div > ul > li {
color: red;
}
@tailwind base;
@tailwind components;
@tailwind utilities;
16 changes: 6 additions & 10 deletions assets/vendor/@hotwired/turbo/turbo.index.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion assets/vendor/barecss/css/bare.min.css

This file was deleted.

4 changes: 2 additions & 2 deletions assets/vendor/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
array (
),
),
'barecss/css/bare.min.css' =>
'@hotwired/turbo' =>
array (
'version' => '1.1.1',
'version' => '7.3.0',
'dependencies' =>
array (
),
Expand Down
23 changes: 23 additions & 0 deletions bin/phpunit
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env php
<?php

if (!ini_get('date.timezone')) {
ini_set('date.timezone', 'UTC');
}

if (is_file(dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit')) {
if (PHP_VERSION_ID >= 80000) {
require dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit';
} else {
define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__).'/vendor/autoload.php');
require PHPUNIT_COMPOSER_INSTALL;
PHPUnit\TextUI\Command::main();
}
} else {
if (!is_file(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
exit(1);
}

require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';
}
19 changes: 19 additions & 0 deletions compose.override.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: '3'

services:
###> doctrine/doctrine-bundle ###
database:
ports:
- "5432"
###< doctrine/doctrine-bundle ###

###> symfony/mailer ###
mailer:
image: axllent/mailpit
ports:
- "1025"
- "8025"
environment:
MP_SMTP_AUTH_ACCEPT_ANY: 1
MP_SMTP_AUTH_ALLOW_INSECURE: 1
###< symfony/mailer ###
26 changes: 26 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '3'

services:
###> doctrine/doctrine-bundle ###
database:
image: postgres:${POSTGRES_VERSION:-16}-alpine
environment:
POSTGRES_DB: ${POSTGRES_DB:-app}
# You should definitely change the password in production
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-!ChangeMe!}
POSTGRES_USER: ${POSTGRES_USER:-app}
healthcheck:
test: ["CMD", "pg_isready", "-d", "${POSTGRES_DB:-app}", "-U", "${POSTGRES_USER:-app}"]
timeout: 5s
retries: 5
start_period: 60s
volumes:
- database_data:/var/lib/postgresql/data:rw
# You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
# - ./docker/db/data:/var/lib/postgresql/data:rw
###< doctrine/doctrine-bundle ###

volumes:
###> doctrine/doctrine-bundle ###
database_data:
###< doctrine/doctrine-bundle ###
31 changes: 28 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,49 @@
"ext-libxml": "*",
"ext-simplexml": "*",
"ext-xml": "*",
"doctrine/dbal": "^3",
"doctrine/doctrine-bundle": "^2.12",
"doctrine/doctrine-migrations-bundle": "^3.3",
"doctrine/orm": "^3.2",
"easycorp/easyadmin-bundle": "^4.11",
"league/commonmark": "^2.4",
"symfony/asset": "~7.1.0",
"symfony/asset-mapper": "~7.1.0",
"phpdocumentor/reflection-docblock": "^5.4",
"phpstan/phpdoc-parser": "^1.29",
"symfony/asset": "7.1.*",
"symfony/asset-mapper": "7.1.*",
"symfony/console": "~7.1.0",
"symfony/doctrine-messenger": "7.1.*",
"symfony/dotenv": "~7.1.0",
"symfony/expression-language": "7.1.*",
"symfony/flex": "^2",
"symfony/form": "~7.1.0",
"symfony/framework-bundle": "~7.1.0",
"symfony/http-client": "7.1.*",
"symfony/http-foundation": "~7.1.0",
"symfony/http-kernel": "~7.1.0",
"symfony/intl": "~7.1.0",
"symfony/mailer": "7.1.*",
"symfony/mime": "7.1.*",
"symfony/monolog-bundle": "^3.8",
"symfony/notifier": "7.1.*",
"symfony/process": "7.1.*",
"symfony/property-access": "7.1.*",
"symfony/property-info": "7.1.*",
"symfony/routing": "~7.1.0",
"symfony/runtime": "~7.1.0",
"symfony/stimulus-bundle": "^2.0",
"symfony/security-bundle": "7.1.*",
"symfony/serializer": "7.1.*",
"symfony/stimulus-bundle": "^2.19",
"symfony/string": "~7.1.0",
"symfony/translation": "7.1.*",
"symfony/twig-bundle": "~7.1.0",
"symfony/ux-live-component": "^2.19",
"symfony/ux-turbo": "^2.16",
"symfony/ux-twig-component": "^2.19",
"symfony/validator": "~7.1.0",
"symfony/web-link": "~7.1.0",
"symfony/yaml": "~7.1.0",
"symfonycasts/tailwind-bundle": "^0.6.0",
"twig/extra-bundle": "^3.0",
"twig/markdown-extra": "^3.7",
"twig/twig": "^3.0"
Expand All @@ -54,6 +76,9 @@
"roave/security-advisories": "dev-latest",
"symfony/browser-kit": "~7.1.0",
"symfony/css-selector": "~7.1.0",
"symfony/debug-bundle": "7.1.*",
"symfony/maker-bundle": "^1.0",
"symfony/phpunit-bridge": "^7.1",
"symfony/requirements-checker": "^2.0",
"symfony/stopwatch": "~7.1.0",
"symfony/web-profiler-bundle": "~7.1.0"
Expand Down
Loading

0 comments on commit 9f7a6eb

Please sign in to comment.