Giter Club home page Giter Club logo

terawhere-laravel's Introduction

Terawhere API Server

Documentation can be found here: https://sgtinkers.github.io/terawhere-laravel/#authenticate-user

  • Laravel 5.4
  • MySQL 5.6

Development Setup

Docker Compose Setup

  • Install Docker and Docker Compose on your local system
  • Install MySQL via Docker: docker run --name terawhere-mysql -e MYSQL_ROOT_PASSWORD=password -d -p 13306:3306 mysql:5.6
  • Create Database terawhere: docker run -it --link terawhere-mysql:mysql --rm mysql:5.6 sh -c 'exec mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD" -e "create database terawhere"'
  • Copy .env.dev to .env
  • Configure .env accordingly to point to correct mysql
  • Run docker-compose run --rm -w /var/www phpfpm php docker/composer.phar install
  • Run docker-compose run --rm -w /var/www phpfpm php artisan migrate
  • Run docker-compose run --rm -w /var/www phpfpm php artisan key:generate
  • Run docker-compose run --rm -w /var/www node yarn install
  • Start the containers: docker-compose up
  • Edit your system host file (C:\Windows\System32\Drivers\etc\hosts or /etc/hosts) and add 127.0.0.1 terawhere.local (change 127.0.0.1 to reflect your Docker configuration if needed)

Development

Running artisan

  • docker-compose run --rm -w /var/www phpfpm php artisan
  • i.e. tinker: docker-compose run --rm -w /var/www phpfpm php artisan tinker

Running composer

  • docker-compose run --rm -w /var/www phpfpm php docker/composer.phar
  • i.e. require laravel/socialite: docker-compose run --rm -w /var/www phpfpm php docker/composer.phar require laravel/socialite

Running gulp

  • docker-compose run --rm -w /var/www gulp gulp

Running npm install

  • docker-compose run --rm -w /var/www gulp npm install

Running bower install

  • docker-compose run --rm -w /var/www gulp bower --allow-root install

Access Bash Shell inside container

  • docker exec -it terawherelaravel_phpfpm_1 bash
  • terawherelaravel_phpfpm_1 is the name of the container and might be different.

Committing

  • Run docker-compose run --rm -w /var/www phpfpm bash -c "chmod 777 tools/fmt && tools/fmt" script before committing to ensure consistency in code formatting

Generate Documentation

  • Run docker-compose run --rm -w /var/www phpfpm php artisan api:generate --routePrefix="api/*" --noResponseCalls --header "Authorization: JWTToken" --force --output docs

Running Tests

  • Run normal tests: docker-compose run --rm -w /var/www phpfpm bash -c "php tools/phpunit-6.1.phar"
  • Run test for facebook login: docker-compose run --rm -w /var/www phpfpm bash -c "FB_TOKEN='[PASTE_TOKEN_HERE]' php tools/phpunit-6.1.phar"

terawhere-laravel's People

Contributors

azizsafudin avatar ruqqq avatar

Stargazers

 avatar  avatar Feek avatar

Watchers

 avatar James Cloos avatar Feek avatar Tengku Hafidz avatar

terawhere-laravel's Issues

Break on api/v1/bookings POST

Got an error when trying to Create a booking

ErrorException in BookingController.php line 75: Trying to get property of non-object

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.