Skip to content

Latest commit

 

History

History
144 lines (125 loc) · 4.81 KB

README.md

File metadata and controls

144 lines (125 loc) · 4.81 KB

Odezenne project Build Status Codacy Badge

Includes

Dependencies

Installation

  1. Clone the repository:

    git clone https://github.com/ecvdbdx1617/Odezenne.git
  2. Install the View.js and Lumen dependencies:

    cd Odezenne/scripts
    ./installDevelopment.sh

    You will need to install Cygwin on windows to execute .sh scripts

  3. 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
    
  4. Build and launch the docker containers:

    docker-compose up
  5. Setup the Lumen database:

    ./scripts/setupLumenDb.sh
  6. 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
  7. 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

Front-end development

Testing

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

Linting

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

Adding dependencies

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}

Back-end development

Importing / Exporting the Wordpress database

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

Initializing the Lumen database

To initialize the database (install & migrate), execute the following script:

./script/setupLumenDb.sh

Seeding the Lumen database

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

Rebuilding the Lumen database

To rebuild the database (drop, recreate, migrate, seed), execute the following script:

./script/emptyLumenDb.sh