Git Product home page Git Product logo

travelagency's Introduction

Travelagency

Index

DEVELOPMENT INSTALLATION

This section will describe how run api in your local machine for development proposes.

  1. Install docker and docker-compose.
  2. Run docker-compose up -d.
  3. Use command docker-compose exec -T api composer install install dependencies.
  4. Use command docker-compose exec -T api php core/init --env=Development --overwrite=y to setup development environment.
  5. Visit localhost:80 in your browser.

You may need use proxy if you connect to internet from Iran.

TEST STAGE OR PRODUCTION INSTALLATION

This section describe how install api on server for test or production proposes.

  1. Install docker and docker-compose.
  2. Run docker-compose -f docker-compose-deploy.yml up -d.
  3. Use command docker-compose -f docker-compose-deploy.yml exec -T api php core/init --env=Development --overwrite=y to setup development environment.
  4. Visit localhost:80 in your browser.

Done! You can visit your api from localhost:80.

Debug panel available in production. username:debuguser password:XjbZG&6aXk%Q

APPLICATION INIT CONFIGURATIONS

For db config run below command.

docker-compose -f docker-compose-deploy.yml exec -T api php core/yii config-db -d=database-name -u=database-user -p=database-password

And then run below command to create project tables:

docker-compose -f docker-compose-deploy.yml exec -T api php core/yii migrate

Remove -f docker-compose-deploy.yml from top commands to run it in development env.

Cron jobs

We use cron jobs to run some commands for example in exact time per day. For example in this project, we have a cron job that check end_time of tour and if it's pass current time, then change status of tour to finished.

Use blow command to define this type of commands.

crontab -e
0 3 * * * docker-compose exec api php core/yii crons/tour-crob-job

By running up command, every 3h an command will run and will handle finished tours.

Run tests

Use below command to run common and api tests in level unit test and api test.

This commands work in development installation.

docker-compose exec -T api vendor/bin/codecept -c core run

For running test in test stage installation use bellow commands:

docker exec -it travelagency-api vendor/bin/codecept -c core run

GETTING start

See API doc to know exist rules.

Authors

Amin Keshavarz

travelagency's People

Contributors

aminkt avatar

Stargazers

Ali Mousavi avatar

Watchers

James Cloos 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.