Skip to content
Peter Lam edited this page Mar 14, 2019 · 17 revisions

Adonis

Prerequisites

  • Install Node.js here

  • Install Yarn here

  • Install Adonis with yarn add global @adonisjs/cli

CMD

Within the directory /Jasper write the following to install all dependencies:

  • yarn install

Running The Application

To start the application run

  • yarn start or adonis serve --dev

To run test if your code meets coding coventions

  • run yarn lint

SQLite

  1. Download the database file and place it under the <App root directory>/database folder.

  2. Make sure your .env has the following lines:

DB_CONNECTION=sqlite
DB_DATABASE=jasper_dev

Migration

  • Run adonis migration:run to generate the tables.
  • Run adonis migration:rollback to purge the tables.
  • Run adonis migration:refresh to perform a rollback and then runfrom start
  • Run adonis seed to populate databases tables

Sqlite shell (Optional)

Windows(64-bit)

  1. Download the binaries and the command line tool and place them under C:\Windows\System32
  2. Open a command line tool from the <App root directory>/database and run sqlite3 jasper_dev.db

References

Outlook

  1. Download this script and put it in database/. To execute the script, within the sqlite3 shell, run .read room.sql. This will populate the database with some mock rooms whose schedules are hosted on the Outlook account.

  2. Add these lines to the .env file:

  MICROSOFT_APP_ID=292802e3-a198-4e18-ab66-8ea5e7968922
  MICROSOFT_APP_PASSWORD=beguX64??cjmDDRVIJ676+!
  MICROSOFT_REDIRECT_URI=http://localhost:3333/authorize
  MICROSOFT_SCOPES=user.read calendars.readwrite openid profile offline_access 
  MICROSOFT_HOST=https://login.microsoftonline.com
  MICROSOFT_AUTHORIZE_ENDPOINT=common/oauth2/v2.0/authorize
  MICROSOFT_TOKEN_ENDPOINT=common/oauth2/v2.0/token
  1. To get access token from the Outlook account, go to http://localhost:3333/authenticate where you will be prompted to login. Use the following credentials (You will only have to do this once. The application will refresh the access token every half hour as long as it is running):

  2. You may log into Outlook using the above credentials view the schedules(calendars) of mock rooms.