Skip to content

Latest commit

 

History

History
86 lines (61 loc) · 1.56 KB

README.md

File metadata and controls

86 lines (61 loc) · 1.56 KB

Food Tracker API

View the site.

Development

Requirements

Setup

# Clone the API repo
git clone https://github.com/jlbelanger/food-api.git
cd food-api

# Configure the environment settings
cp .env.example .env

# Install dependencies
composer install

# Generate key
php artisan key:generate

# Run database migrations
php artisan migrate
php artisan db:seed

# Set permissions
chown -R www-data:www-data storage

# Create account with username "test" and password "password" (or reset existing account password to "password")
php artisan reset-auth

Then, setup the Food Tracker app.

Lint

./vendor/bin/phpcs

Test

./vendor/bin/phpunit

Deployment

Essentially, to set up the repo on the server:

git clone https://github.com/jlbelanger/food-api.git
cd food-api
cp .env.example .env
# Then configure the values in .env.
composer install
php artisan key:generate
php artisan migrate
chown -R www-data:www-data storage

For subsequent deploys, push changes to the main branch, then run the following on the server:

cd food-api
git fetch origin
git pull
composer install
php artisan config:clear

Deploy script

Note: The deploy script included in this repo depends on other scripts that only exist in my private repos. If you want to deploy this repo, you'll have to create your own script.

./deploy.sh