Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
76ca559
APITOCART-13880 added prices change for variants
angryalf May 13, 2020
b1acde1
APITOCART-13912 Import Orders Automation
angryalf May 13, 2020
12a7920
APITOCART-13912 Import Orders Automation frontend
angryalf May 14, 2020
0d6efe7
APITOCART-13912 Import Orders Automation frontend
angryalf May 19, 2020
f3befae
APITOCART-13912 Import Orders Automation frontend
angryalf May 20, 2020
2571953
APITOCART-13912 Import Orders Automation frontend
angryalf May 21, 2020
f2d076f
APITOCART-13942 Automatic emails sending
angryalf May 25, 2020
f6554fb
APITOCART-13942 Automatic emails sending
angryalf May 26, 2020
6c7dd1b
APITOCART-13958 fixes and chnges
angryalf May 27, 2020
c70f92f
APITOCART-13958 fixes and chnges
angryalf May 27, 2020
f5c7533
APITOCART-13958 fixes and chnges
angryalf May 27, 2020
e9d4a4c
APITOCART-13912 changes and fixes
angryalf Jun 1, 2020
7593572
APITOCART-13942 changes and fixes
angryalf Jun 1, 2020
19f1942
APITOCART-13942 changes and fixes
angryalf Jun 1, 2020
9414beb
APITOCART-13912 changes and fixes
angryalf Jun 2, 2020
2412424
APITOCART-13880 fixed missed variants names
angryalf Jun 2, 2020
f9018b3
APITOCART-13880 fixed missed variants names
angryalf Jun 2, 2020
9e67724
APITOCART-13880 fixed product params
angryalf Jun 2, 2020
6b0a4c4
APITOCART-13942 fixed product params
angryalf Jun 3, 2020
a8a5c29
fix users
angryalf Jun 3, 2020
e6aff0d
test cases
angryalf Jun 12, 2020
b70dbe0
pre-commit test cases
angryalf Jun 12, 2020
2b0941f
APITOCART-14001 added badgets
angryalf Jun 12, 2020
8153ec4
Merged in develop (pull request #2)
abidlovskyi Jun 12, 2020
5d4a913
APITOCART-14009 abandoned case
angryalf Jun 17, 2020
d7ed8b9
ADMIN-13449
kalinovskyi Jun 17, 2020
fc0495f
ADMIN-13283
kalinovskyi Jun 17, 2020
08e39fc
ADMIN-13283
kalinovskyi Jun 17, 2020
52d8723
ADMIN-13283
kalinovskyi Jun 17, 2020
45417c6
README.md edited online with Bitbucket
abidlovskyi Jun 17, 2020
b22d9fc
APITOCART-14001 travis integration
angryalf Jun 18, 2020
4731ec5
Merged in develop (pull request #3)
abidlovskyi Jun 18, 2020
810d619
APITOCART-14001 travis integration
angryalf Jun 18, 2020
cd01e97
Merged in develop (pull request #4)
abidlovskyi Jun 18, 2020
4ca562b
APITOCART-14001 travis integration
angryalf Jun 18, 2020
4396e0a
Merged in develop (pull request #5)
abidlovskyi Jun 18, 2020
d5c4f1a
APITOCART-14001 travis integration
angryalf Jun 18, 2020
ec54ecf
Merged in develop (pull request #6)
abidlovskyi Jun 18, 2020
aa47ef9
APITOCART-14001 travis integration
angryalf Jun 18, 2020
e0bea9b
Merged in develop (pull request #7)
abidlovskyi Jun 18, 2020
90ba280
APITOCART-14001 travis integration fit requrepments
angryalf Jun 18, 2020
972d847
Merged in develop (pull request #8)
abidlovskyi Jun 18, 2020
d73c755
APITOCART-14001 travis integration fit requrepments
angryalf Jun 18, 2020
8dacfd2
Merged in develop (pull request #9)
abidlovskyi Jun 18, 2020
0ac7313
APITOCART-14001 travis integration fit requrepments
angryalf Jun 18, 2020
83ec48c
Merged in develop (pull request #10)
abidlovskyi Jun 18, 2020
36aa0cd
APITOCART-14001 travis integration fit requrepments
angryalf Jun 18, 2020
b65ca8e
APITOCART-14001 travis integration fit requrepments
angryalf Jun 18, 2020
c7980c3
Merged in develop (pull request #11)
abidlovskyi Jun 18, 2020
c2389d6
Fixed composer container user
Jun 18, 2020
8b5eb23
Merged in ADMIN-13434-deploy (pull request #12)
AdminM1 Jun 18, 2020
04c78f3
APITOCART-13774 fix with SMTP
angryalf Jun 19, 2020
1175a10
Merged in develop (pull request #13)
abidlovskyi Jun 19, 2020
47145d7
APITOCART-13774 changes mentioned in feedback
angryalf Jun 23, 2020
440d7b1
Merged in develop (pull request #14)
abidlovskyi Jun 23, 2020
0560581
APITOCART-13879 adding store
angryalf Jun 23, 2020
bdde780
Merged in develop (pull request #15)
abidlovskyi Jun 23, 2020
9caa405
APITOCART-14028 changes
angryalf Jun 25, 2020
03a5eb1
Merged in develop (pull request #16)
abidlovskyi Jun 25, 2020
e50275a
APITOCART-14038 check SMTP settings
angryalf Jun 30, 2020
27ecde6
APITOCART-14028 update all related products
angryalf Jul 1, 2020
17a435d
APITOCART-14038 add smtp setup instruction
angryalf Jul 1, 2020
4130cea
Merged in develop (pull request #17)
abidlovskyi Jul 1, 2020
c9c2d47
APITOCART-14028 fix errors
angryalf Jul 1, 2020
1f9c225
Merged in develop (pull request #18)
abidlovskyi Jul 1, 2020
55e8094
APITOCART-14038 added email config change
angryalf Jul 2, 2020
bb6f3ae
Merged in develop (pull request #19)
abidlovskyi Jul 2, 2020
7ed010e
APITOCART-14028 added validation
angryalf Jul 21, 2020
442ef39
Merged in develop (pull request #20)
abidlovskyi Jul 21, 2020
7b17808
APITOCART-14028 added validation
angryalf Jul 21, 2020
a963009
Merged in develop (pull request #21)
abidlovskyi Jul 21, 2020
e77b003
APITOCART-14028 fix tests & travis tests
angryalf Jul 21, 2020
8c6715f
Merged in develop (pull request #22)
abidlovskyi Jul 21, 2020
06f6ff0
APITOCART-14028 added test info
angryalf Jul 22, 2020
d71d582
APITOCART-13879 fix custom params
angryalf Jul 22, 2020
6415587
Merged in develop (pull request #24)
angryalf Jul 22, 2020
55f0f64
Merge remote-tracking branch 'origin/master'
angryalf Jul 22, 2020
ad9e617
APITOCART-13879 fix err existing stor
angryalf Jul 22, 2020
55c07a4
fix to use latest api2cart-sdk
angryalf Jul 23, 2020
df56c44
Merged in develop (pull request #25)
abidlovskyi Jul 23, 2020
6533ce4
APITOCART-14173 Changed login & header
abidlovskyi Aug 12, 2020
508ac63
Merged in develop (pull request #26)
abidlovskyi Aug 12, 2020
fe85fa7
fix with missed config
abidlovskyi Aug 12, 2020
c4deb1e
Merged in develop (pull request #27)
abidlovskyi Aug 12, 2020
c9de089
fix with HTTPS
abidlovskyi Aug 21, 2020
ed00bd3
Merged in develop (pull request #28)
abidlovskyi Aug 21, 2020
8979f23
fix with HTTPS
abidlovskyi Aug 21, 2020
5b3c876
Merged in develop (pull request #29)
abidlovskyi Aug 21, 2020
aba22cd
fix check new orders
abidlovskyi Sep 4, 2020
6774f85
fix check new orders
abidlovskyi Sep 4, 2020
69897c4
fix check new orders
abidlovskyi Sep 7, 2020
0c04694
fix dates
abidlovskyi Sep 7, 2020
68127f3
fix
Mar 24, 2022
2839a04
ADMIN-17711 fix ssl redirects
kalinovskyi Mar 24, 2022
7703f57
APITOCART-16375 Fix demo start
May 18, 2022
25b1430
Merge branch 'AC-14022--YK-fix-problem' of bitbucket.org:magneticone-…
May 18, 2022
e5bee93
APITOCART-16375 Fix demo start.test build
May 18, 2022
71033f5
Merged in APITOCART-14258 (pull request #31)
abidlovskyi May 18, 2022
68cc72b
Merge branch 'master' of bitbucket.org:magneticone-projects/api2cart-…
May 18, 2022
83681fa
APITOCART-16375 Fix conflict
May 18, 2022
9b52324
Merged in APITOCART-16375-demo-fix-docker-composer.yml (pull request …
May 24, 2022
7063edc
APITOCART-00000 Fix config
May 24, 2022
a1f91e9
Merged in APITOCART-00000-fix-config (pull request #36)
May 24, 2022
51908e8
APITOCART-16378 Fix orders
Jun 24, 2022
79075fa
Merged in APITOCART-16378-demo-moduleimport-orders (pull request #38)
Jun 27, 2022
1809104
APITOCART-16387 Fix products add
Jun 28, 2022
e38b198
APITOCART-16387 Fix customer tab
Jun 28, 2022
afe0723
Merged in APITOCART-16387-demo-module-fix-price-updating (pull reques…
Jun 30, 2022
6fe73d7
APITOCART-16379 Abandoned
Jul 12, 2022
da878a6
Merged in APITOCART-16379-demo-module-abandoned-cart (pull request #42)
Jul 13, 2022
8131a0a
APITOCART-16685 Store Add fix form
Jul 13, 2022
311161a
Merged in APITOCART-16685-demo-module-add-new-store-form (pull reques…
Jul 14, 2022
554c3e3
APITOCART-00000 fix composer
Jul 14, 2022
2b46889
Merged in APITOCART-00000-fix-composer (pull request #45)
Jul 14, 2022
71ba1d7
APITOCART-16389 fix products
Jul 26, 2022
3b0e16c
Merged in APITOCART-16389-fix-products (pull request #47)
Jul 27, 2022
47b2e0e
APITOCART-14009 abandoned case
dependabot[bot] Jul 27, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
.idea
.env
26 changes: 26 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# .travis.yml
dist: precise

language: php

php:
- 7.3

addons:
mysql: 5.7

cache:
directories:
- node_modules
- vendor

before_script:
- cd src
- cp .env.travis .env
- sudo mysql -e 'CREATE DATABASE testing;'
- composer self-update
- composer install --no-interaction
- php artisan migrate:fresh --seed --no-interaction -vvv

script:
- php artisan test
30 changes: 24 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,36 @@
FROM php:7.4-fpm-alpine

ADD php/php.ini /usr/local/etc/php/conf.d/40-custom.ini

WORKDIR /var/www/html

COPY src/.env.example /var/www/html/.env

RUN apk add --update libzip-dev curl-dev &&\
docker-php-ext-install curl && \
docker-php-ext-install curl

RUN docker-php-ext-install pdo pdo_mysql

# xdebug with PHPSHTORM
ENV XDEBUG_VERSION=2.9.2
RUN apk --no-cache add --virtual .build-deps \
g++ \
autoconf \
make && \
pecl install xdebug-${XDEBUG_VERSION} && \
docker-php-ext-enable xdebug && \
apk del .build-deps && \
rm -r /tmp/pear/* && \
apk del gcc g++ &&\
rm -rf /var/cache/apk/*

RUN docker-php-ext-install pdo pdo_mysql
# Change TimeZone
RUN apk add --update tzdata
ENV TZ=Europe/Kiev

ADD var/etc/php /usr/local/etc/php

#Install composer
RUN curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/local/bin/composer

RUN usermod -u 1000 www-data; \
chown -R www-data:www-data /var/www/html
RUN apk --no-cache add shadow && usermod -u 1000 www-data; \
chown -R www-data:www-data /var/www/html && chmod 777 -R /var/log

24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
## API2CartBoilerplate

<p align="center">
<a href="https://github.com/api2cart/php-a2c-demo-module-boilerplate"><img src="https://travis-ci.com/api2cart/php-a2c-demo-module-boilerplate.svg?branch=master" alt="Build Status"></a>
<a href="https://packagist.org/packages/api2cart/api2cart-php-sdk"><img src="https://poser.pugx.org/api2cart/api2cart-php-sdk/d/total.svg" alt="Total Downloads"></a>
</p>

## Usage

To get started, make sure you have [Docker installed](https://docs.docker.com/docker-for-mac/install/) on your system
To get started, make sure you have [Docker installed and runned](https://docs.docker.com/docker-for-mac/install/) on your system


### Automatic start
1. Be sure you have Docker installed and runned on your PC.

2. please run `start_me.sh` (for Linux/Unix/MacOS) or `start_me.bat` (for Windows)




### Manual start
First open a terminal and from this cloned respository's root run `docker-compose up -d --build`.
Open up your browser of choice to [http://localhost:8080](http://localhost:8080) and you should see your Laravel app running as intended.
**Your Laravel app needs to be in the src directory first before bringing the containers up, otherwise the artisan container will not build, as it's missing the appropriate file.**
Open up your browser of choice to [http://localhost:8080](http://localhost:8080) and you should see your Laravel app running as intended.

Three new containers have been added that handle Composer, NPM, and Artisan commands without having to have these platforms installed on your local computer. Use the following command templates from your project root, modifiying them to fit your particular use case:

Expand Down Expand Up @@ -36,3 +50,7 @@ Containers created and their ports (if used) are as follows:
- **npm**
- **composer**
- **artisan**

## Testing

- `docker-compose run app php artisan test`
3 changes: 2 additions & 1 deletion bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ pipelines:
default:
- step:
script:
- git push --mirror [email protected]:api2cart/php-a2c-demo-module-boilerplate.git
- git filter-branch -- --all
- git push --force [email protected]:api2cart/php-a2c-demo-module-boilerplate.git
23 changes: 7 additions & 16 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ services:
container_name: nginx
ports:
- "8080:80"
- "8443:443"
volumes:
- ./src:/var/www/html
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
- ./var/etc/nginx/default.conf:/etc/nginx/conf.d/default.conf
- ./var/etc/nginx/ssl:/etc/ssl
- ./var/logs/nginx:/var/log/nginx
depends_on:
- php
- mysql
Expand All @@ -24,7 +27,7 @@ services:
restart: unless-stopped
tty: true
ports:
- "3306:3306"
- "33061:3306"
environment:
MYSQL_DATABASE: homestead
MYSQL_USER: homestead
Expand All @@ -34,6 +37,7 @@ services:
SERVICE_NAME: mysql
volumes:
- dbdata:/var/lib/mysql
- ./var/logs/mysql:/var/log/mysql
networks:
- laravel
php:
Expand All @@ -43,19 +47,7 @@ services:
container_name: php
volumes:
- ./src:/var/www/html
ports:
- "9000:9000"
networks:
- laravel

composer:
image: composer:latest
container_name: composer
volumes:
- ./src:/var/www/html
working_dir: /var/www/html
depends_on:
- php
- ./var/logs:/var/log
networks:
- laravel

Expand Down Expand Up @@ -86,7 +78,6 @@ services:
context: .
dockerfile: Dockerfile
container_name: app
restart: unless-stopped
volumes:
- ./src:/var/www/html
depends_on:
Expand Down
25 changes: 25 additions & 0 deletions hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh

if ! [ -x "$(command -v docker-compose)" ]; then
echo "Please check if Docker installed and runned."

if ! [ -x "$(command -v xdg-open)" ]; then
open https://docs.docker.com/get-docker/
exit 1
fi

xdg-open https://docs.docker.com/get-docker/
exit 1
fi

docker-compose run artisan test


if [ $? -eq 0 ];
then
echo "Looks all ok"
exit 0
else
echo "missing tests passes, please fix errors"
exit 1
fi
31 changes: 31 additions & 0 deletions run_me.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@ECHO OFF

SET mypath=%cd%
SET CONFIGFILE=%mypath%\src\.env

copy %mypath%\hooks\pre-commit %mypath%\.git\hooks

IF EXIST %CONFIGFILE% (
echo Config exists
) ELSE (
copy %mypath%\src\.env.example %CONFIGFILE%
)

docker-compose down

if errorlevel 1 (
echo Please check if Docker installed and runned.
pause 0
start "" https://www.docker.com/products/docker-desktop
exit
)

docker-compose up -d

docker-compose run --rm composer update

docker-compose run app php artisan migrate

docker-compose run app php artisan db:seed

start "" https://demo-module.api2cart.local.com:8443
59 changes: 59 additions & 0 deletions run_me.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/bash

dir=$(pwd)

# setup user uid:gid for composer
uid="$(id -u):$(id -g)"
echo "uid=$uid" > "$dir/.env"

cp "$dir/hooks/pre-commit" "$dir/.git/hooks"

#overwrite config
CONFIGFILE="$dir/src/.env"

if [ -f "$CONFIGFILE" ]; then
echo "config $CONFIGFILE exist"
else
echo "config do not exists"
cp "$dir/src/.env.example" "$dir/src/.env"
fi
# cp "$dir/src/.env.example" "$dir/src/.env"

# give rw permissions for temorary folder
sudo chmod -R 777 $dir/src/storage

#stop for any case container
if ! [ -x "$(command -v docker-compose)" ]; then
echo "Please check if Docker installed and runned."

if ! [ -x "$(command -v xdg-open)" ]; then
open https://docs.docker.com/get-docker/
exit 1
fi

xdg-open https://docs.docker.com/get-docker/
exit 1
fi

docker-compose down


#run containers in background
docker-compose up -d

if [ $? -eq 0 ];
then
echo "Looks all ok, update related dependencies..."
docker-compose run app composer update
docker-compose run app php artisan migrate
docker-compose run app php artisan db:seed
else
echo "missing start please contact support"
exit
fi

if ! [ -x "$(command -v xdg-open)" ]; then
open https://demo-module.api2cart.local.com:8443
exit 0
fi
xdg-open https://demo-module.api2cart.local.com:8443
16 changes: 10 additions & 6 deletions src/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ APP_NAME="Api2Cart Demo"
APP_ENV=local
APP_KEY=base64:+oaKbnRJG4izevBAqf0ctXhcV0A0J5E/2Os5+XgA5ZY=
APP_DEBUG=false
APP_URL=http://localhost
APP_URL=https://demo-module.api2cart.com
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_LOCALE_PHP=en_US
Expand All @@ -29,13 +29,13 @@ REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=localhost
MAIL_PORT=1025
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=[email protected]
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
Expand All @@ -51,4 +51,8 @@ PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

#API2CART_URL=http://api.api2cart.local
API2CART_URL=https://api.api2cart.com/v1.1

UID=1000

FORCE_HTTPS=true
54 changes: 54 additions & 0 deletions src/.env.travis
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
APP_NAME="Api2Cart Demo"
APP_ENV=local
APP_KEY=base64:+oaKbnRJG4izevBAqf0ctXhcV0A0J5E/2Os5+XgA5ZY=
APP_DEBUG=false
APP_URL=http://localhost
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_LOCALE_PHP=en_US
APP_TIMEZONE=UTC
LOG_CHANNEL=single

DEBUGBAR_ENABLED=true

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=testing
DB_USERNAME=travis
DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=database
SESSION_DRIVER=file
SESSION_LIFETIME=120
SESSION_ENCRYPT=false

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

#API2CART_URL=http://api.api2cart.local
Loading