Joliquiz is an online quiz software, a PHP web application developed using the Symfony framework (version 6).
git clone https://github.com/LaurentBouquet/joliquiz.git
cd joliquiz
composer install
In the commands below, replace aSecurePassword with a secure password.
Here are the steps to create the database, either with MySQL or with PostgreSQL.
Check that you have the PHP MySQL driver installed with :
sudo apt install php-mysql
Enter these commands in a terminal prompt :
sudo mysql
CREATE USER 'joliquiz'@'localhost' IDENTIFIED BY 'aSecurePassword';
CREATE DATABASE joliquiz CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
GRANT ALL PRIVILEGES ON joliquiz.* TO 'joliquiz'@'localhost';
Update config/packages/doctrine.yaml
:
doctrine:
dbal:
# configure these for your MySQL database server
driver: 'pdo_mysql'
server_version: '5.7'
charset: utf8mb4
default_table_options:
charset: utf8mb4
collate: utf8mb4_unicode_ci
# configure these for your PostgreSQL database server
# driver: 'pdo_pgsql'
# charset: utf8
Copy .env
file to .env.local
Uncomment and update the password in this line of .env.local file :
DATABASE_URL=mysql://joliquiz:**aSecurePassword**@127.0.0.1:3306/joliquiz
Enter this commands in a terminal prompt :
php bin/console doctrine:database:create
First, start by checking that you have the PHP PostgreSQL driver installed with :
sudo apt install -y php-pgsql
Enter these commands in a terminal prompt :
sudo -i -u postgres
createuser --interactive
joliquiz
# -> yes
psql
ALTER USER joliquiz WITH password 'aSecurePassword';
ALTER USER joliquiz SET search_path = public;
\q
exit
Update the following config file located at config/packages/doctrine.yaml
:
doctrine:
dbal:
# configure these for your MySQL database server
# driver: 'pdo_mysql'
# server_version: '5.7'
# charset: utf8mb4
# default_table_options:
# charset: utf8mb4
# collate: utf8mb4_unicode_ci
# configure these for your PostgreSQL database server
driver: 'pdo_pgsql'
charset: utf8
Uncomment and update the password in this line of the .env
file :
DATABASE_URL=pgsql://joliquiz:**aSecurePassword**@127.0.0.1:5432/joliquiz?charset=UTF-8
Copy then the .env
file to .env.local
cp .env .env.local
Remove migrations files in migrations
folder and enter the following command :
php bin/console make:migration
Then, enter the following command :
php bin/console doctrine:database:create
Migrate and start the server with the following commands :
php bin/console doctrine:migrations:migrate
php bin/console doctrine:fixtures:load
php bin/console server:start
Open the following page : http://127.0.0.1:8000 and GO !
Here are the defaults credentials for the following roles :
User
- Username : user
- Password : user
Teacher
- Username : teacher
- Password : teacher
Administrator
- Username : admin
- Password : admin
Superadministrator
- Username : superadmin
- Password : superadmin
You must set your time zone in the php.ini file:
date.timezone = Europe/Paris
Joliquiz is an open source project that welcomes pull requests and issues from anyone. Before opening pull requests, please read our short Contribution Guide.