- Wordpress REST API with MariaDB database
- Lumen API with MariaDB database
- Vue.js client
-
Clone the repository:
git clone https://github.com/ecvdbdx1617/Odezenne.git
-
Install the View.js and Lumen dependencies:
cd Odezenne/scripts ./installDevelopment.sh
You will need to install Cygwin on windows to execute .sh scripts
-
Install locally generated certificates to enable HTTPS for Wordpress
cd .. ./scripts/generateCertificates.sh
Then complete with the following entries.
For the first time:
Country Name (2 letter code) [AU]:FR State or Province Name (full name) [Some-State]:Gironde Locality Name (eg, city) []:Bordeaux Organization Name (eg, company) [Internet Widgits Pty Ltd]:Odezenne Organizational Unit Name (eg, section) []: Common Name (e.g. server FQDN or YOUR name) []:wordpress.o2n Email Address []:o2n@test.fr
For the second time:
Country Name (2 letter code) [AU]:FR State or Province Name (full name) [Some-State]:Gironde Locality Name (eg, city) []:Bordeaux Organization Name (eg, company) [Internet Widgits Pty Ltd]:Odezenne Organizational Unit Name (eg, section) []: Common Name (e.g. server FQDN or YOUR name) []:lumen.o2n Email Address []:o2n@test.fr
-
Build and launch the docker containers:
docker-compose up
-
Setup the Lumen database:
./scripts/setupLumenDb.sh
-
Point the container's IP address to the right hosts by adding these three lines to the
/etc/hosts
file:127.0.0.1 lumen.o2n 127.0.0.1 wordpress.o2n 127.0.0.1 client.o2n
-
You can now access the following urls:
- lumen.o2n for the Lumen API
- wordpress.o2n for Wordpress
- client.o2n:8081 for the Vue.js client
The Vue.js project uses unit and e2e testing, using Karma and Nightwatch. These tests need to be placed in the client/test
folder.
To execute the tests, you have these three commands available:
- To run the unit tests
docker exec -it o2n_client npm run unit
- To run the e2e tests
docker exec -it o2n_client npm run e2e
- To run all the tests
docker exec -it o2n_client npm run test
The Vue.js project follows the AirBnB syntax rules using the ESLint plugin.
To execute the linter, you can use this command:
docker exec -it o2n_client npm run lint
To add a dependency to the Vue.js project, you have two options:
- Add your dependency to the
package.json
file and execute this command:
docker exec -it o2n_client npm install
- Install the dependency directly using the command line:
docker exec -it o2n_client npm install {package_name} {--save || --save-dev}
The database dump file is located in config/wp_dump.sql
. To import this file, execute the following script:
./scripts/importWordpressDb.sh
If you choose to import the existing dump file, the admin username and password are both admin
To export the latest version of the database, execute the following script:
./scripts/exportWordpressDb.sh
To empty the database, execute the following script:
./scripts/emptyWordpressDb.sh
To initialize the database (install & migrate), execute the following script:
./script/setupLumenDb.sh
You can add data to the Lumen database using the seed file located in api/lumen/database/seeds/DatabaseSeeder.php
.
Then, to seed the data to the database, execute the following command:
docker exec -it o2n_lumen php artisan db:seed
To rebuild the database (drop, recreate, migrate, seed), execute the following script:
./script/emptyLumenDb.sh