cleaned ups somethings
This commit is contained in:
		
							parent
							
								
									00fd8542c3
								
							
						
					
					
						commit
						5e72e23051
					
				@ -2,7 +2,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
## Requirements
 | 
					## Requirements
 | 
				
			||||||
 | 
					
 | 
				
			||||||
* ubuntu php-cli (sudo nala install php-curl php-xml php-mysql)
 | 
					* ubuntu php-cli (sudo nala install curl unzip php-curl php-xml php-mysql)
 | 
				
			||||||
* [Install Composer](https://www.nickyeoman.com/page/install-composer-on-ubuntu) 
 | 
					* [Install Composer](https://www.nickyeoman.com/page/install-composer-on-ubuntu) 
 | 
				
			||||||
* [Symfony cli](https://symfony.com/download)
 | 
					* [Symfony cli](https://symfony.com/download)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -23,9 +23,9 @@ The next steps to take would be:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
1. Verify the ```.env``` and ```docker-compose.md``` file
 | 
					1. Verify the ```.env``` and ```docker-compose.md``` file
 | 
				
			||||||
1. start docker ```sudo docker-compose up -d```
 | 
					1. start docker ```sudo docker-compose up -d```
 | 
				
			||||||
1. [Create your controllers](https://git.gopo.li/nick/symfony/src/branch/main/docs/Controller.md)
 | 
					1. [Create your controllers](https://git.nickyeoman.com/nick/symfony/src/branch/main/docs/Controller.md)
 | 
				
			||||||
1. Run sass ```sass sass/project.sass public/css/main.css```
 | 
					1. Run sass ```sass sass/project.sass public/css/main.css```
 | 
				
			||||||
1. [Create your security](https://git.gopo.li/nick/symfony/src/branch/main/docs/Security.md)
 | 
					1. [Create your security](https://git.nickyeoman.com/nick/symfony/src/branch/main/docs/Security.md)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Currently supported and tested on
 | 
					# Currently supported and tested on
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,12 +1,18 @@
 | 
				
			|||||||
#!/bin/bash
 | 
					#!/bin/bash
 | 
				
			||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
# Nix install symfony bash script
 | 
					# Nix install symfony bash script
 | 
				
			||||||
# v1.0.0
 | 
					# v2
 | 
				
			||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo "*** Starting New Symfony Project ***"
 | 
					################################################################################
 | 
				
			||||||
 | 
					# Check parameter (folder name)
 | 
				
			||||||
 | 
					################################################################################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# check that $1 folder does not exit
 | 
					if [ -z "$1" ]
 | 
				
			||||||
 | 
					  then
 | 
				
			||||||
 | 
					    echo "Please provide a folder name"
 | 
				
			||||||
 | 
					    exit 1
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
[ -d "$1" ] && echo "Folder $1 already exists" && exit 1
 | 
					[ -d "$1" ] && echo "Folder $1 already exists" && exit 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
@ -64,7 +70,6 @@ echo "Your twig.yaml config file has been replaced, remove the bak if you are ha
 | 
				
			|||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo "Creating SASS directory for css"
 | 
					echo "Creating SASS directory for css"
 | 
				
			||||||
composer require nickyeoman/nytwig
 | 
					 | 
				
			||||||
composer require nickyeoman/sassLibrary
 | 
					composer require nickyeoman/sassLibrary
 | 
				
			||||||
touch sass/$1.sass
 | 
					touch sass/$1.sass
 | 
				
			||||||
mkdir -p public/css
 | 
					mkdir -p public/css
 | 
				
			||||||
@ -104,7 +109,8 @@ composer require symfonycasts/verify-email-bundle
 | 
				
			|||||||
# Database
 | 
					# Database
 | 
				
			||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
composer req -n orm && sleep 1
 | 
					composer req -n orm --with-all-dependencies
 | 
				
			||||||
 | 
					sleep 2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# TODO: In the future you may want to replace this with code
 | 
					# TODO: In the future you may want to replace this with code
 | 
				
			||||||
# ( but not here if you are sharing the script)
 | 
					# ( but not here if you are sharing the script)
 | 
				
			||||||
@ -118,6 +124,7 @@ composer req -n orm && sleep 1
 | 
				
			|||||||
composer req symfony/apache-pack
 | 
					composer req symfony/apache-pack
 | 
				
			||||||
#TODO: find a way to trigger this without interaction
 | 
					#TODO: find a way to trigger this without interaction
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# You need the following variables in your env for docker-compose
 | 
				
			||||||
# You need the following variables in your env for docker-compose
 | 
					# You need the following variables in your env for docker-compose
 | 
				
			||||||
echo '' >> .env
 | 
					echo '' >> .env
 | 
				
			||||||
echo '# For Docker compose' >> .env
 | 
					echo '# For Docker compose' >> .env
 | 
				
			||||||
@ -126,20 +133,21 @@ echo 'DOCKERIMAGE=YOUR_NAME/YOUR_IMAGE_NAME' >> .env
 | 
				
			|||||||
echo 'DOCKERVER=latest' >> .env
 | 
					echo 'DOCKERVER=latest' >> .env
 | 
				
			||||||
echo 'DOCKERNET=DOCKER_NETWORK_NAME_FOR_PROXY' >> .env
 | 
					echo 'DOCKERNET=DOCKER_NETWORK_NAME_FOR_PROXY' >> .env
 | 
				
			||||||
echo "DOCKERPORT=8000" >> .env
 | 
					echo "DOCKERPORT=8000" >> .env
 | 
				
			||||||
GEN=`echo $RANDOM | md5sum | head -c 12`
 | 
					ROOTPASS=`echo $RANDOM | md5sum | head -c 12`
 | 
				
			||||||
echo "MYSQL_ROOT_PASSWORD=${GEN}" >> .env
 | 
					echo "MYSQL_ROOT_PASSWORD=${ROOTPASS}" >> .env
 | 
				
			||||||
echo 'DOCKERPHPMYADMIN=8001' >> .env
 | 
					echo 'DOCKERPHPMYADMIN=8001' >> .env
 | 
				
			||||||
echo '' >> .env
 | 
					echo '' >> .env
 | 
				
			||||||
echo '# Database info, should match your db url' >> .env
 | 
					echo '# Database info, should match your db url' >> .env
 | 
				
			||||||
echo 'DBHOST=mariadb' >> .env
 | 
					DBHOST='mariadb'
 | 
				
			||||||
echo 'DB=symfony_project' >> .env
 | 
					echo "DBHOST=${DBHOST}" >> .env
 | 
				
			||||||
GEN=`echo $RANDOM | md5sum | head -c 4`
 | 
					DB='symfony_project'
 | 
				
			||||||
echo "DBUSER=theuser${GEN}" >> .env
 | 
					echo "DB=${DB}" >> .env
 | 
				
			||||||
GEN=`echo $RANDOM | md5sum | head -c 12`
 | 
					DBUSER=`echo $RANDOM | md5sum | head -c 4`
 | 
				
			||||||
echo "DBPASSWORD=${GEN}" >> .env
 | 
					echo "DBUSER=theuser${DBUSER}" >> .env
 | 
				
			||||||
 | 
					DBPASS=`echo $RANDOM | md5sum | head -c 12`
 | 
				
			||||||
 | 
					echo "DBPASSWORD=${DBPASS}" >> .env
 | 
				
			||||||
echo '' >> .env
 | 
					echo '' >> .env
 | 
				
			||||||
echo '# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=mariadb-10.4.11&charset=utf8mb4"' >> .env
 | 
					echo "DATABASE_URL=\"mysql://theuser${DBUSER}:${DBPASS}@${DBHOST}:3306/${DB}?serverVersion=mariadb-10.4.11&charset=utf8mb4\"" >> .env
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# TODO: move these here after you have symfony production ready
 | 
					# TODO: move these here after you have symfony production ready
 | 
				
			||||||
rm docker-compose.yml
 | 
					rm docker-compose.yml
 | 
				
			||||||
@ -154,10 +162,8 @@ wget https://raw.githubusercontent.com/nickyeoman/phpframework/main/docker/Docke
 | 
				
			|||||||
# Routes
 | 
					# Routes
 | 
				
			||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
mv config/routes/routes.yaml config/routes/routes.yaml.bak
 | 
					 | 
				
			||||||
wget https://git.nickyeoman.com/nick/symfony/raw/branch/main/routes/routes.yaml
 | 
					wget https://git.nickyeoman.com/nick/symfony/raw/branch/main/routes/routes.yaml
 | 
				
			||||||
mv routes.yaml config/routes/routes.yaml
 | 
					mv routes.yaml config/routes/symfonycms.yaml
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
# Clean up
 | 
					# Clean up
 | 
				
			||||||
 | 
				
			|||||||
@ -1,8 +0,0 @@
 | 
				
			|||||||
# EasyAdmin Bundle
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
I decided not to use this as it comes with a lot of stuff you don't want.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Symfony 6
 | 
					 | 
				
			||||||
Admin Bundle 4
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
https://www.youtube.com/playlist?list=PLrVW8QdFhIiA1da1zOhnhmAMqYoeyGKxV
 | 
					 | 
				
			||||||
@ -1,8 +1,2 @@
 | 
				
			|||||||
controllers:
 | 
					 | 
				
			||||||
    resource:
 | 
					 | 
				
			||||||
        path: ../src/Controller/
 | 
					 | 
				
			||||||
        namespace: App\Controller
 | 
					 | 
				
			||||||
    type: attribute
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
NickYeomanSymfonyCMS:
 | 
					NickYeomanSymfonyCMS:
 | 
				
			||||||
    resource: '@SymfonyCMSBundle/config/routes.yaml'
 | 
					    resource: '@SymfonyCMSBundle/config/routes.yaml'
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user