Giter Club home page Giter Club logo

restaurant-app's Introduction

Restaurant APP

Description:

The API Gateway for restaurant app.


Installation:

  1. Clone the repository:
git clone [email protected]:wajdijurry/restaurant-app.git
  1. Rename the file “.env.example” under “/” to “.env” then change the parameters to match your preferences, example:
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
...

Using Docker

  1. Build a new image:
docker build -t restaurant-app-image .
  1. Run the containers
docker-compose up -d

If you want to scale up the workers (sync / async), you can simply run this command:

docker-compose up --scale app=num -d

Where “num” is the number of processes to run, example:

docker-compose up --scale app=3 -d

API gateway URL (You are free to change the port through .env file)

http://localhost:1007

FYI: Database (MySQL) info (You are free to change the port through .env file):

Host: localhost:3301 

On host machine

Prerequisites

  • PHP >= 8.0
  • MySQL >= 8.0
  1. Install dependencies
chmod +x utilities/install-dependencies.sh && ./utilities/install-dependencies.sh
  1. Install PHP extensions
chmod +x utilities/install-php-extensions.sh && ./utilities/install-php-extensions.sh
  1. Install composer & APP dependencies
rm -rf vendor composer.lock && \
    curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
    composer clearcache && \
    composer install
  1. Prepare the app
# Make artisan executable
RUN chmod +x artisan

# Flush all cache
php artisan optimize:clear

# Execute migrations
php artisan migrate

# Seeding data
php artisan db:seed

Unit test

You need to have .env.testing file to get tests run correctly

Using docker

To run the unit test, just run this command:

docker-compose --env-file .env.testing up app-test

On host machine

vendor/bin/phpunit -c tests/phpunit.xml

restaurant-app's People

Contributors

wajdijurry avatar

Watchers

 avatar  avatar

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.