Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
40c85ae
feat(symfony): updated symfony from 3.1 to 4.4
WizBhoo Jun 22, 2020
d37b60b
Merge pull request #19 from WizBhoo/feature/sf-update
WizBhoo Jun 23, 2020
ddec0e1
feat(readme): added readme content
WizBhoo Jun 23, 2020
93c414d
feat(readme): fixed issue following codacy PR report
WizBhoo Jun 24, 2020
7e36898
feat(readme): added code climate badges to readme file
WizBhoo Jun 24, 2020
4da2f1e
Merge pull request #20 from WizBhoo/feature/readme
WizBhoo Jun 24, 2020
072ade9
feat(tools): added phpunit behat and linked project to codacy
WizBhoo Jun 23, 2020
4a189d9
create github action main workflow
WizBhoo Jun 24, 2020
dded362
feature(app): fixed CI failed on PR #21
WizBhoo Jun 24, 2020
17e61cf
Merge pull request #21 from WizBhoo/feature/init-tools
WizBhoo Jun 24, 2020
2a0ff99
feat(phpcs): added phpcs config rules
WizBhoo Jun 24, 2020
10f5447
fix(app): fixed bugs following update to sf4.4
WizBhoo Jun 24, 2020
c4fae87
cancel(phpcs): deleted phpcs config file to let codacy manage it by d…
WizBhoo Jun 25, 2020
e3485f7
feat(databse): database schema update to cover application needs
WizBhoo Jun 25, 2020
7d148dd
feat(fixtures): added data fixtures
WizBhoo Jun 25, 2020
37988c3
feat(app): quality code enhancement following phpcs and codacy report
WizBhoo Jun 25, 2020
e39e040
Merge pull request #22 from WizBhoo/feature/doctrine-fixtures
WizBhoo Jun 25, 2020
6c5a764
Merge pull request #23 from WizBhoo/feature/quality-enhancement
WizBhoo Jun 26, 2020
65a0f05
feat(app): updated security firewalls parameters according to sf4
WizBhoo Jul 2, 2020
e333e2a
feat(test): setup testing tools and added tests on user
WizBhoo Jul 3, 2020
cba5cba
refacto(user): refactored crud user to pass tests implemented
WizBhoo Jul 3, 2020
4f67eb6
.
ruiteix Jul 3, 2020
8de2d89
.
ruiteix Jul 3, 2020
bfb78ee
.
ruiteix Jul 3, 2020
c88b976
.
ruiteix Jul 3, 2020
2ac3ac1
.
ruiteix Jul 3, 2020
276e161
.
ruiteix Jul 3, 2020
5395053
.
ruiteix Jul 3, 2020
7d4fe5b
.
ruiteix Jul 3, 2020
2e8a9a8
.
ruiteix Jul 3, 2020
5810662
.
ruiteix Jul 3, 2020
6ade766
.
ruiteix Jul 3, 2020
1de3531
.
ruiteix Jul 3, 2020
fc5d4be
.
ruiteix Jul 3, 2020
3eadcd7
.
ruiteix Jul 3, 2020
3b22105
.
ruiteix Jul 3, 2020
aebae82
.
ruiteix Jul 3, 2020
f53a5f4
.
ruiteix Jul 3, 2020
de2d912
.
ruiteix Jul 3, 2020
a58928a
.
ruiteix Jul 3, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# In all environments, the following files are loaded if they exist,
# the latter taking precedence over the former:
#
# * .env contains default values for the environment variables needed by the app
# * .env.local uncommitted file with local overrides
# * .env.$APP_ENV committed environment-specific defaults
# * .env.$APP_ENV.local uncommitted environment-specific overrides
#
# Real environment variables win over .env files.
#
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
#
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=a0f35b4535ae683943daedf0b1684532
#TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
#TRUSTED_HOSTS='^(localhost|example\.com)$'
###< 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
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# For a PostgreSQL database, use: "postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=11&charset=utf8"
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7
###< doctrine/doctrine-bundle ###

###> symfony/mailer ###
# MAILER_DSN=smtp://localhost
###< symfony/mailer ###

###> symfony/google-mailer ###
# Gmail SHOULD NOT be used on production, use it in development only.
# MAILER_DSN=gmail://USERNAME:PASSWORD@default
###< symfony/google-mailer ###

###> symfony/swiftmailer-bundle ###
# For Gmail as a transport, use: "gmail://username:password@localhost"
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
# Delivery is disabled by default via "null://localhost"
MAILER_URL=null://localhost
###< symfony/swiftmailer-bundle ###
6 changes: 6 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# define your env variables for the test env here
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
PANTHER_APP_ENV=panther
DATABASE_URL=mysql://root:root@127.0.0.1:3306/todo?serverVersion=8
50 changes: 50 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Main

on:
push:
branches: [master]
pull_request:
branches: [master]

env:
APP_ENV: test

jobs:
build:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: todo
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- uses: actions/checkout@v2

- name: Validate composer.json and composer.lock
run: composer validate

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-

- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest

# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md
- name: Fixtures loader
run: bin/console d:m:m -n && bin/console d:f:l -n

- name: Run unit test suite
run: bin/phpunit --coverage-clover coverage-xml/index.xml
30 changes: 15 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/app/config/parameters.yml
/build/
/phpunit.xml
/var/*
!/var/cache
/var/cache/*
!var/cache/.gitkeep
!/var/logs
/var/logs/*
!var/logs/.gitkeep
!/var/sessions
/var/sessions/*
!var/sessions/.gitkeep
!var/SymfonyRequirements.php
.DS_Store
###> symfony/framework-bundle ###
/.env.local
/.env.local.php
/.env.*.local
/config/secrets/prod/prod.decrypt.private.php
/public/bundles/
/var/
/vendor/
/web/bundles/
###< symfony/framework-bundle ###

###> symfony/phpunit-bridge ###
.phpunit
.phpunit.result.cache
/phpunit.xml
###< symfony/phpunit-bridge ###
128 changes: 124 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,126 @@
ToDoList
========
# OCR_P08_ToDo & Co

Base du projet #8 : Améliorez un projet existant
OpenClassrooms - Training Course DA PHP/Symfony - Project P08 - Upgrade an existing Symfony project

https://openclassrooms.com/projects/ameliorer-un-projet-existant-1
My WebSite is Online and you can visit it : [APi - Site CV](https://adrien-pierrard.fr)

[![Codacy Badge](https://app.codacy.com/project/badge/Grade/291aefecd42040b2b17d04870dfb18ba)](https://www.codacy.com/manual/WizBhoo/OCR_P08_ToDoList?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=WizBhoo/OCR_P08_ToDoList&amp;utm_campaign=Badge_Grade)
[![Maintainability](https://api.codeclimate.com/v1/badges/b57f67e98ae6f21df8ae/maintainability)](https://codeclimate.com/github/WizBhoo/OCR_P08_ToDoList/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/b57f67e98ae6f21df8ae/test_coverage)](https://codeclimate.com/github/WizBhoo/OCR_P08_ToDoList/test_coverage)

## Version 1.0.0 - June 2020

* This file explains how to install and run the project.
* IDE used : PhpStorm.
* I use a Docker Stack as personal local development environment, but you can use your own environment.
* Both method to install the project are the described bellow.
* Want to contribute to this project ? Please read the Contributing Guidelines before (ongoing redaction...).

-------------------------------------------------------------------------------------------------------------------------------------

Realized by Adrien PIERRARD - [(see GitHub)](https://github.com/WizBhoo)

Supported by Antoine De Conto - OCR Mentor

Special thanks to Rui TEIXEIRA and Yann LUCAS for PR Reviews

-------------------------------------------------------------------------------------------------------------------------------------

### How to install the project with your own local environment

What you need :

* Symfony 4.4.*
* PHP 7.2
* MySQL 8 - (I use PHPMyAdmin)
* Demo data provided through fixtures to load with Doctrine after DB creation

Follow each following steps :

* First clone this repository from your terminal in your preferred project directory.

```console
https://github.com/WizBhoo/OCR_P08_ToDoList.git
```

* You need to edit the ".env" file to add your credentials for Doctrine DB connection and Mailer system chosen.
* I recommend you to copy the ".env" file and setup your credentials in a ".env.local" file.
* Launch your local environment.
* From your terminal, go to the project directory and tape those command line :

```console
composer install
php bin/console doctrine:database:create
php bin/console doctrine:migrations:migrate
php bin/console doctrine:fixtures:load
```

* Well done ! Project installed ! So you just have to go to your localhost home page.

-------------------------------------------------------------------------------------------------------------------------------------

### How to install the project using my Docker Stack (recommended method)

* My Docker stack provide a development environment ready to run a Symfony project.
* Follow this link and read the README file to install it : [Docker Symfony](https://github.com/WizBhoo/docker_sf3_to_sf5)
* Prerequisite : to have Docker and Docker-Compose installed on your machine - [Docker Install](https://docs.docker.com/install/)
* Preferred Operating System to use it : Linux / Mac OSx

Once you have well installed my Docker Stack, follow each following steps :

* From your terminal go to the symfony directory created by Docker.
* Clone this repository inside.

```console
https://github.com/WizBhoo/OCR_P08_ToDoList.git
```

* You need to edit the ".env" file to add your credentials for Doctrine DB connection and Mailer system chosen.
* I recommend you to copy the ".env" file and setup your credentials in a ".env.local" file.
* From your terminal go to the Docker directory and launch Docker using those command lines :

```console
make build
make start or make up
```

<blockquote>
You can also use "make help" to see what "make" command are available.
</blockquote>

* You can access to PHPMyAdmin using [pma.localhost](http://pma.localhost) but as already mentioned, you will create the DB and load data fixtures through command lines with Doctrine (See next steps).
* From your terminal, always in the Docker directory, tape those command lines :

```console
make sh
cd symfony/
composer install
php bin/console doctrine:database:create
php bin/console doctrine:migrations:migrate
php bin/console doctrine:fixtures:load
```

* Well done ! Project installed ! So you just have to go to [mon-site.localhost](http://mon-site.localhost) home page.

-------------------------------------------------------------------------------------------------------------------------------------

### How to contribute to this project

* This project takes part of my training course to become a developer. Data presented are only used for demonstration.
* Initially, base project provided was developed under Symfony 3.1 and didn't work on a voluntary basis.
* The goal was to test it and to refactor it in order to upgrade it.
* Bugs have been identified and fixed, some new features have been implemented following ToDo & Co expectations.
* A Quality code & App performance Audit has been conducted to establish the App technical debt inventory and define an improvement plan.
* Some issues have been created from this plan, and you can contribute by working on it.
* You can also suggest your own improvement issue to do and/or open an issue if you identify a bug.
* What ever the way you wish to contribute, please read the Contributing Guidelines before (ongoing redaction...).

-------------------------------------------------------------------------------------------------------------------------------------

### Contact

Thanks in advance for Star contribution

Any question / trouble ?

Please send me an [e-mail](mailto:apierrard.contact@gmail.com) ;-)
7 changes: 0 additions & 7 deletions app/.htaccess

This file was deleted.

7 changes: 0 additions & 7 deletions app/AppCache.php

This file was deleted.

50 changes: 0 additions & 50 deletions app/AppKernel.php

This file was deleted.

17 changes: 0 additions & 17 deletions app/Resources/views/security/login.html.twig

This file was deleted.

11 changes: 0 additions & 11 deletions app/autoload.php

This file was deleted.

Loading
Loading