Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
11b90ac
APITOCART-13879 add new stores (90%)
angryalf May 7, 2020
d90043f
APITOCART-13880 added product variant prices
angryalf May 8, 2020
7f9969f
APITOCART-13880 added product variant prices
angryalf May 8, 2020
4204814
APITOCART-13880 added product variant prices validation, errors show …
angryalf May 8, 2020
d3dd9c8
APITOCART-13880 added prices change for variants
angryalf May 12, 2020
263f228
APITOCART-13880 added prices change for variants
angryalf May 13, 2020
d362068
APITOCART-13912 Import Orders Automation
angryalf May 13, 2020
16c64fa
APITOCART-13912 Import Orders Automation frontend
angryalf May 14, 2020
0c0d236
APITOCART-13912 Import Orders Automation frontend
angryalf May 19, 2020
f15d9b4
APITOCART-13912 Import Orders Automation frontend
angryalf May 20, 2020
2c83e9f
APITOCART-13912 Import Orders Automation frontend
angryalf May 21, 2020
484ec1d
APITOCART-13942 Automatic emails sending
angryalf May 25, 2020
be95759
APITOCART-13942 Automatic emails sending
angryalf May 26, 2020
de8609b
APITOCART-13958 fixes and chnges
angryalf May 27, 2020
ac41631
APITOCART-13958 fixes and chnges
angryalf May 27, 2020
f28d272
APITOCART-13958 fixes and chnges
angryalf May 27, 2020
9c0b2e4
APITOCART-13912 changes and fixes
angryalf Jun 1, 2020
9efc0f1
APITOCART-13942 changes and fixes
angryalf Jun 1, 2020
8a4e796
APITOCART-13942 changes and fixes
angryalf Jun 1, 2020
97f573a
APITOCART-13912 changes and fixes
angryalf Jun 2, 2020
cd6930c
APITOCART-13880 fixed missed variants names
angryalf Jun 2, 2020
ae83c8b
APITOCART-13880 fixed missed variants names
angryalf Jun 2, 2020
082ca41
APITOCART-13880 fixed product params
angryalf Jun 2, 2020
3f59a3c
APITOCART-13942 fixed product params
angryalf Jun 3, 2020
cf26574
fix users
angryalf Jun 3, 2020
de1f54f
test cases
angryalf Jun 12, 2020
5668307
pre-commit test cases
angryalf Jun 12, 2020
2e08e94
APITOCART-14001 added badgets
angryalf Jun 12, 2020
2ab347a
Merged in develop (pull request #2)
abidlovskyi Jun 12, 2020
c2f5035
APITOCART-14009 abandoned case
angryalf Jun 17, 2020
a56c48a
ADMIN-13449
kalinovskyi Jun 17, 2020
3035362
ADMIN-13283
kalinovskyi Jun 17, 2020
510555e
ADMIN-13283
kalinovskyi Jun 17, 2020
55dd009
ADMIN-13283
kalinovskyi Jun 17, 2020
868e950
README.md edited online with Bitbucket
abidlovskyi Jun 17, 2020
7b1e1db
APITOCART-14001 travis integration
angryalf Jun 18, 2020
3cc9884
Merged in develop (pull request #3)
abidlovskyi Jun 18, 2020
7292405
APITOCART-14001 travis integration
angryalf Jun 18, 2020
fb8eded
Merged in develop (pull request #4)
abidlovskyi Jun 18, 2020
1842006
APITOCART-14001 travis integration
angryalf Jun 18, 2020
6261b0d
Merged in develop (pull request #5)
abidlovskyi Jun 18, 2020
95a82a8
APITOCART-14001 travis integration
angryalf Jun 18, 2020
a11d1ef
Merged in develop (pull request #6)
abidlovskyi Jun 18, 2020
37c50f3
APITOCART-14001 travis integration
angryalf Jun 18, 2020
f74d10c
Merged in develop (pull request #7)
abidlovskyi Jun 18, 2020
d99a5c7
APITOCART-14001 travis integration fit requrepments
angryalf Jun 18, 2020
d0a12fa
Merged in develop (pull request #8)
abidlovskyi Jun 18, 2020
d415fc2
APITOCART-14001 travis integration fit requrepments
angryalf Jun 18, 2020
c53587b
Merged in develop (pull request #9)
abidlovskyi Jun 18, 2020
4e2f512
APITOCART-14001 travis integration fit requrepments
angryalf Jun 18, 2020
e3c6206
Merged in develop (pull request #10)
abidlovskyi Jun 18, 2020
97b5214
APITOCART-14001 travis integration fit requrepments
angryalf Jun 18, 2020
357c6af
APITOCART-14001 travis integration fit requrepments
angryalf Jun 18, 2020
a042b8b
Merged in develop (pull request #11)
abidlovskyi Jun 18, 2020
ffb7845
Fixed composer container user
Jun 18, 2020
89e4cbc
Merged in ADMIN-13434-deploy (pull request #12)
AdminM1 Jun 18, 2020
3305199
APITOCART-13774 fix with SMTP
angryalf Jun 19, 2020
e7d44c1
Merged in develop (pull request #13)
abidlovskyi Jun 19, 2020
a4a558b
APITOCART-13774 changes mentioned in feedback
angryalf Jun 23, 2020
57f9d11
Merged in develop (pull request #14)
abidlovskyi Jun 23, 2020
65b7e29
APITOCART-13879 adding store
angryalf Jun 23, 2020
94d08f8
Merged in develop (pull request #15)
abidlovskyi Jun 23, 2020
13a1dd5
APITOCART-14028 changes
angryalf Jun 25, 2020
18c25ee
Merged in develop (pull request #16)
abidlovskyi Jun 25, 2020
1768ab4
APITOCART-14038 check SMTP settings
angryalf Jun 30, 2020
ba17151
APITOCART-14028 update all related products
angryalf Jul 1, 2020
a13403a
APITOCART-14038 add smtp setup instruction
angryalf Jul 1, 2020
f8d3db8
Merged in develop (pull request #17)
abidlovskyi Jul 1, 2020
5ba8aec
APITOCART-14028 fix errors
angryalf Jul 1, 2020
c75bbaa
Merged in develop (pull request #18)
abidlovskyi Jul 1, 2020
91fd375
APITOCART-14038 added email config change
angryalf Jul 2, 2020
9feb142
Merged in develop (pull request #19)
abidlovskyi Jul 2, 2020
76ece92
APITOCART-14028 added validation
angryalf Jul 21, 2020
04b737d
Merged in develop (pull request #20)
abidlovskyi Jul 21, 2020
7c50c9e
APITOCART-14028 added validation
angryalf Jul 21, 2020
d0c053a
Merged in develop (pull request #21)
abidlovskyi Jul 21, 2020
37e5108
APITOCART-14028 fix tests & travis tests
angryalf Jul 21, 2020
ab29281
Merged in develop (pull request #22)
abidlovskyi Jul 21, 2020
3cbe8bd
APITOCART-14028 added test info
angryalf Jul 22, 2020
f566b33
APITOCART-13879 fix custom params
angryalf Jul 22, 2020
9753888
Merged in develop (pull request #24)
angryalf Jul 22, 2020
87bf755
Merge remote-tracking branch 'origin/master'
angryalf Jul 22, 2020
a975f8a
APITOCART-13879 fix err existing stor
angryalf Jul 22, 2020
4650cbd
fix to use latest api2cart-sdk
angryalf Jul 23, 2020
87468fe
Merged in develop (pull request #25)
abidlovskyi Jul 23, 2020
623efc3
APITOCART-14173 Changed login & header
abidlovskyi Aug 12, 2020
982a5ff
Merged in develop (pull request #26)
abidlovskyi Aug 12, 2020
b46b3ec
fix with missed config
abidlovskyi Aug 12, 2020
e5b56f5
Merged in develop (pull request #27)
abidlovskyi Aug 12, 2020
cf2ef5a
fix with HTTPS
abidlovskyi Aug 21, 2020
10c1d2c
Merged in develop (pull request #28)
abidlovskyi Aug 21, 2020
1bbff15
fix with HTTPS
abidlovskyi Aug 21, 2020
a3f0187
Merged in develop (pull request #29)
abidlovskyi Aug 21, 2020
a21ca2c
fix check new orders
abidlovskyi Sep 4, 2020
6c1e998
fix check new orders
abidlovskyi Sep 4, 2020
81db0a6
fix check new orders
abidlovskyi Sep 7, 2020
8d489e4
fix dates
abidlovskyi Sep 7, 2020
3c80411
fix
Mar 24, 2022
8800f91
ADMIN-17711 fix ssl redirects
kalinovskyi Mar 24, 2022
69b3152
APITOCART-16375 Fix demo start
May 18, 2022
5fe3b30
Merge branch 'AC-14022--YK-fix-problem' of bitbucket.org:magneticone-…
May 18, 2022
dc1ae26
APITOCART-16375 Fix demo start.test build
May 18, 2022
8ffda43
Merged in APITOCART-14258 (pull request #31)
abidlovskyi May 18, 2022
b5ae87a
Merge branch 'master' of bitbucket.org:magneticone-projects/api2cart-…
May 18, 2022
c2ac792
APITOCART-16375 Fix conflict
May 18, 2022
200f23f
Merged in APITOCART-16375-demo-fix-docker-composer.yml (pull request …
May 24, 2022
5e8bbc9
APITOCART-00000 Fix config
May 24, 2022
1b709e7
Merged in APITOCART-00000-fix-config (pull request #36)
May 24, 2022
a95196c
APITOCART-16378 Fix orders
Jun 24, 2022
6ef7351
Merged in APITOCART-16378-demo-moduleimport-orders (pull request #38)
Jun 27, 2022
d01581d
Bump browserslist from 4.11.0 to 4.21.0 in /src
dependabot[bot] Jun 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
60 changes: 60 additions & 0 deletions run_me.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/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

#run once for the first time
#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