1
1
# MVC_MY_Quiz
2
2
3
- Project realized with Symfony
3
+ My first project with Symfony !
4
4
5
- ## Start and quite the server in local
5
+ * Register _ (with email validation)_ and login
6
+ * CRUD user _ (with email validation when you change the password or email)_
7
+ * Play quiz
8
+ * See your quiz history _ (if user is not authenticated, he can plays a quiz and see history)_
9
+
10
+ With the admin role :
11
+ * CRUD question
12
+ * CRUD response
13
+ * CRUD category
14
+ * CRUD user
15
+
16
+ [ My app] ( https://my-quizz.sekhmset.me/ )
17
+
18
+ ## Versions
19
+
20
+ * PHP 7.4.5
21
+ * Symfony 5.0.*
22
+ * Composer 1.10.5
23
+
24
+ ## In local
25
+ ### Start and quite the server
26
+
27
+ You need to have instal Symfony before use the following command in your terminal.
28
+ To instal Symfony, refer you to the links at the end of this readme
6
29
7
30
``` bash
8
31
symfony server:start
@@ -12,35 +35,90 @@ symfony server:start
12
35
ctrl + c
13
36
```
14
37
15
- ## versions
38
+ ### Database
39
+
40
+ Start migration to have all the tables :
16
41
17
42
``` bash
18
- PHP 7.4.5
43
+ php bin/console doctrine:migrations:migrate
19
44
```
20
45
46
+ Don't forget to update your username, password and table in ` .env `
47
+
48
+ ** To deploy :** in your Google Cloud Platform create your database and an user
49
+
50
+ How to configure your variable ?
51
+ ``` bash
52
+ DATABASE_URL = mysql://username:password@localhost? unix_socket=/cloudsql/project_id:region:your_database; dbname=database_name
53
+ ```
54
+
55
+ ### Admin
56
+ I used ` easyAdmin ` a Symfony bundle.
57
+ To install easyAdmin I followed the instructions of the documentation.
58
+
59
+ [ Link of the documentation] ( https://symfony.com/doc/master/bundles/EasyAdminBundle/index.html )
60
+
61
+ ## Mail
62
+ ### Dev env.
63
+ [ MailTrap] ( https://mailtrap.io/ )
64
+
65
+ Create your inbox then update your config in ` .env `
66
+
67
+ ### Prod env.
68
+
69
+ [ Sendgrid] ( https://sendgrid.com/ )
70
+
71
+ Create the API Key then update your config in ` .env `
72
+
73
+ * PS : if you don't receive the email think to check your indesirable email*
74
+
75
+ ## Docker and Google Cloud
76
+
77
+ Create a ` docker ` directory, ` docker-compose.yml ` file and ` .dockerignore ` .
78
+ In your docker directory you have to create the following folders : ` Dockerfile ` and ` opcache.ini `
79
+
80
+ ### Make your migration on cloud
81
+
82
+ Create a ` .cloudbuild ` directory and a ` seeder-deploy.yaml ` in this directory.
83
+
21
84
``` bash
22
- Symfony CLI version v4.14.3
85
+ EXPORT PROJECT_ID=your_project_id
86
+ EXPORT DOCKER_IMAGE=your_docker_image
87
+ EXPORT YOUR_TAG=name_of_your_tag
88
+
89
+ docker build -f docker/Dockerfile -t eu.gcr.io/${PROJECT_ID} /${DOCKER_IMAGE} :${YOUR_TAG} .
90
+ docker push eu.gcr.io/${PROJECT_ID} /${DOCKER_IMAGE} :${YOUR_TAG}
23
91
```
24
92
93
+ Start your migration with cloud build
94
+
25
95
``` bash
26
- Composer version 1.10.5
96
+ gcloud builds submit \
97
+ --project ${PROJECT_ID} \
98
+ --config .cloudbuild/seeder-deploy.yaml \
99
+ --substitutions " _SERVICE=${DOCKER_IMAGE} :${YOUR_TAG} ,_REGION=europe-west1,_INSTANCE_NAME=my-sql-database,_DATABASE_URL=mysql://login_database:password_database@localhost?unix_socket=/cloudsql/${PROJECT_ID} :europe-west1:my-sql-database;dbname=db_name"
27
100
```
28
101
29
- ## Admin
30
- I used ` easyAdmin ` Bundle
102
+ ### DNS and Google Analytics
103
+
104
+ If you want to use Google Analytics or somthing else create your property and configure it _ (Google A.)_
105
+ Then add the code at the end of the template : ` base.html.twig `
106
+
107
+ To use a DNS add your DNS in your Cloud DNS and add a mapping to your service
31
108
32
- ## links
109
+ ## Links
33
110
111
+ - Link to download : [ Link] ( https://symfony.com/download )
34
112
- Link to install and configure Symfony : [ Link] ( https://symfony.com/doc/current/setup.html )
35
113
- Composer : [ Link] ( https://getcomposer.org/ )
36
114
37
- # How to use it with docker
38
- ## Make the migration on cloud
115
+ ## Preview
39
116
40
- You have to create a ` .cloudbuild ` directory and a ` seeder-deploy.yaml `
41
- ``` bash
42
- gcloud builds submit \
43
- --project deploy-276111 \
44
- --config .cloudbuild/seeder-deploy.yaml \
45
- --substitutions " _SERVICE=my-quizz:v1,_REGION=europe-west1,_INSTANCE_NAME=my-sql-database,_DATABASE_URL=mysql://my-quizz:password@localhost?unix_socket=/cloudsql/deploy-276111:europe-west1:my-sql-database;dbname=my_quizz"
46
- ```
117
+ ![ article] ( .github/preview/home.png " Home page ")
118
+ ![ article] ( .github/preview/indexquizz.png " Quizz page ")
119
+ ![ article] ( .github/preview/showquizz.png " Play a quiz page ")
120
+ ![ article] ( .github/preview/historyindex.png " History page ")
121
+ ![ article] ( .github/preview/historyshow.png " History of a quiz ")
122
+ ![ article] ( .github/preview/register.png " Register page ")
123
+ ![ article] ( .github/preview/login.png " Login page ")
124
+ ![ article] ( .github/preview/admin.png " Admin page ")
0 commit comments