Skip to content

zahrasamiei/snapp-food

Repository files navigation

apis for add order, show menu to users

Using this api, you can get menu from available, unexpired foods and order food

Requirement

To use this api, you must already have php and mysql installed on your system

Installation

First clone the code or download it.Then you need to do the following steps.

  • Open the .env file and enter your database settings.(you can copy from env.example) These settings are as follows. DB_CONNECTION = mysql DB_HOST = 127.0.0.1 DB_PORT = 3306 DB_DATABASE = snapp_food DB_USERNAME = root DB_PASSWORD =
  • Then you need to install dependencies with composer install && composer dump-autoload
  • Then you need to create project tables with the php artisan migrate command in your database
  • then you should install passport on laravel php artisan passport:install
  • Then you need to fill data to your tables with php artisan db:seed
  • after db:seed, 51 users will created, one of them is root user with following information
    1. email: root@root.com
    2. name: root
    3. password: r00t@Root
    for using apis you should enter Bearer token for Authorization, so you can use login route to login with this user and get token or you can use register route and create new user and use returned token.
  • Then you can run the project with the php artisan serve command.
  • You can also get the list of api urls with the php artisan route:list command
  • You can see test files in path: tests/Features
  • You can run test with this command: tests/Features

  • I use docker, you can use with following steps:
    1. first you have already installed docker
    2. cd /path/to/laravel-clone-project
    3. cp .env.example .env
    4. chmod -R 0777 storage
    5. chmod -R 0777 bootstrap/cache
    6. docker-compose build
    7. docker run --rm -it --volume $(pwd):/app sample_php composer install
    8. docker run --rm -it --volume $(pwd):/app sample_php php artisan key:generate
    9. Replace sample_php with your project image name.
    10. docker-compose up -d
    11. docker-compose exec php php artisan migrate
    12. docker-compose exec php php artisan passport:install
    13. docker-compose exec php php artisan db:seed
    14. docker-compose ps

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages