-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
52 changed files
with
10,582 additions
and
1,219 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 |
---|---|---|
|
@@ -18,3 +18,24 @@ | |
APP_ENV=dev | ||
APP_SECRET=36ef5102e804bdd84954ae3b699d354b | ||
###< symfony/framework-bundle ### | ||
|
||
###> 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:[email protected]:3306/app?serverVersion=8.0.32&charset=utf8mb4" | ||
# DATABASE_URL="mysql://app:[email protected]:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4" | ||
# DATABASE_URL="postgresql://app:[email protected]:5432/app?serverVersion=16&charset=utf8" | ||
###< 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 ### |
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,7 @@ | ||
# define your env variables for the test env here | ||
DATABASE_URL="sqlite:///%kernel.project_dir%/var/test_data.db" | ||
KERNEL_CLASS='App\Kernel' | ||
APP_SECRET='$ecretf0rt3st' | ||
SYMFONY_DEPRECATIONS_HELPER=999999 | ||
PANTHER_APP_ENV=panther | ||
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots |
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,28 @@ | ||
name: Create issues from TODOs | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
importAll: | ||
default: false | ||
required: false | ||
type: boolean | ||
description: Enable, if you want to import all TODOs. Runs on checked out branch! Only use if you're sure what you are doing. | ||
push: | ||
branches: # do not set multiple branches, todos might be added and then get referenced by themselves in case of a merge | ||
- main | ||
|
||
permissions: | ||
issues: write | ||
repository-projects: read | ||
contents: read | ||
|
||
jobs: | ||
todos: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run Issue Bot | ||
uses: derjuulsn/todo-issue@main | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
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,13 @@ | ||
install: | ||
composer install --no-interaction | ||
bin/console doctrine:database:create | ||
bin/console doctrine:schema:update --force | ||
bin/console doctrine:fixtures:load --no-interaction | ||
APP_ENV=test bin/console doctrine:database:create | ||
APP_ENV=test bin/console doctrine:schema:update --force | ||
start: | ||
symfony serve | ||
test: | ||
just install | ||
vendor/bin/phpunit --fail-on-incomplete | ||
vendor/bin/phpstan |
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,26 @@ | ||
# Frontend Code Review | ||
|
||
This is a dummy project, which is used to demonstrate knowledge of symfony and backend development in general. | ||
It serves as an example with some bad practices included. | ||
|
||
## Tasks | ||
|
||
- [ ] Fork the repository and create a PR with your changes to this Repository | ||
- [ ] Handle all [open issues](https://github.com/cutlery42/backend-code-review/issues) in the project | ||
- [ ] Make `vendor/bin/phpstan` pass without errors | ||
- [ ] Make `vendor/bin/phpunit` pass without errors | ||
|
||
## Install | ||
|
||
We prepared a dev environment with all dependencies included. | ||
If this does not work / you're faster with your own setup, feel free to use your own environment. | ||
|
||
1. Install [Nix](https://nixos.org/download) if you don't have it already. | ||
2. Use `nix-shell` to enter the development environment | ||
- This will install all the necessary dependencies | ||
|
||
|
||
## Development server | ||
|
||
1. `just install` to install all dependencies | ||
2. Run `just start` for a dev server (or `symfony serve` if you don't use `nix-shell`) |
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 @@ | ||
import './bootstrap.js'; | ||
/* | ||
* Welcome to your app's main JavaScript file! | ||
* | ||
* This file will be included onto the page via the importmap() Twig function, | ||
* which should already be in your base.html.twig. | ||
*/ | ||
import './styles/app.css'; | ||
|
||
console.log('This log comes from assets/app.js - welcome to AssetMapper! 🎉'); |
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 @@ | ||
import { startStimulusApp } from '@symfony/stimulus-bundle'; | ||
|
||
const app = startStimulusApp(); | ||
// register any custom, 3rd party controllers here | ||
// app.register('some_controller_name', SomeImportedController); |
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,15 @@ | ||
{ | ||
"controllers": { | ||
"@symfony/ux-turbo": { | ||
"turbo-core": { | ||
"enabled": true, | ||
"fetch": "eager" | ||
}, | ||
"mercure-turbo-stream": { | ||
"enabled": false, | ||
"fetch": "eager" | ||
} | ||
} | ||
}, | ||
"entrypoints": [] | ||
} |
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,16 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
|
||
/* | ||
* This is an example Stimulus controller! | ||
* | ||
* Any element with a data-controller="hello" attribute will cause | ||
* this controller to be executed. The name "hello" comes from the filename: | ||
* hello_controller.js -> "hello" | ||
* | ||
* Delete this file or adapt it for your use! | ||
*/ | ||
export default class extends Controller { | ||
connect() { | ||
this.element.textContent = 'Hello Stimulus! Edit me in assets/controllers/hello_controller.js'; | ||
} | ||
} |
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,3 @@ | ||
body { | ||
background-color: skyblue; | ||
} |
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,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'; | ||
} |
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,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 ### |
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,21 @@ | ||
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} | ||
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 ### |
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
Oops, something went wrong.