Git Product home page Git Product logo

chrisleekr / yii2-angular-boilerplate Goto Github PK

View Code? Open in Web Editor NEW
224.0 37.0 101.0 20.98 MB

Yii2 REST API + Angular 12 Boilerplate (Frontend/Backend)

Home Page: https://yam-boilerplate.chrislee.kr/

License: MIT License

PHP 34.09% Batchfile 0.26% CSS 0.44% TypeScript 37.21% JavaScript 0.77% HTML 21.46% Shell 0.50% Dockerfile 1.05% SCSS 4.21%
yii2 jwt yii2-rbac frontend backend boilerplate bootstrap4 momentjs sweetalert staff-management

yii2-angular-boilerplate's Issues

frontend and backend Dockerfile for production not working

frontend build success but not working, the logs:

/usr/local/bin/docker-entrypoint.sh: line 4: nginx: not found

backend build error:

Service 'backend' failed to build : The command '/bin/sh -c npm install' returned a non-zero code: 228

Ngix won't start in docker-composer up -d

When installing

everything else seemed to install fine after using docker-composer up -d

I encountered following error.

ERROR: for nginx Cannot start service nginx: b'Mounts denied: \r\nThe paths /Applications/MAMP/htdocs/yii2-ngx-boilerplate/nginx/image-files/etc/nginx/nginx.conf and /Applications/MAMP/htdocs/yii2-ngx-boilerplate/nginx\r\nare not shared from OS X and are not known to Docker.\r\nYou can configure shared paths from Docker -> Preferences... -> File Sharing.\r\nSee https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.\r\n.'

Run App without docker

How to install app without docker setup?

is there any way to install app without setup docker. i want to install app with default xampp config.

pageSizeLimit

In UserSearch model:
'pageSizeLimit' => [10, 50, 100]
[10, 50, 100] - wrong value and pageSizeLimit don't work at all, if I set per_page=0 ActiveDataProvider show ALL rows
From Yii2 manual:

$pageSizeLimit public property
The page size limits. The first array element stands for the minimal page size, and the second the maximal page size. If this is false, it means $pageSize should always return the value of $defaultPageSize.
public array|false $pageSizeLimit = [1, 50]

Login error

Hey,

This project is really great, I'm appreciate you put it online.

  1. I fund a small error on API.
    Path: \api\vendor\bower-asset did't exist.
    I had to change folder name bower-asset --> bower and now it working correct.

  2. When i try to login or register for any account on Frontend or Backend, appears the communique "[object Object]" :

backend
api

This is my project: https://wetransfer.com/downloads/8888e95e63e95420a5d03d40cbabb28c20171218113942/49b46cf6168a75df5e8adcc24f095aaf20171218113942/3232f3

I would be very grateful if you could help me fix it.

Thx Pawel

After ignore composer platform-reqs, i got bad request error

Hi,

I would like to try this application, however, I tried to install this I got below error.

After that, i found something from the internet and tried composer install --ignore-platform-reqs

Now application installed successfully and migration steps and localhost configured.

But now I got error while running in browser http://api.boilerplate.local/
{"name":"Bad Request","message":"The system could not process your request. Please check and try again.","code":0,"status":400,"type":"yii\\web\\BadRequestHttpException"}

please advise

Regards
Nishant

Your version of PHP, 5.4.12, is affected by CVE-2013-6420 and cannot safely perf
orm certificate validation, we strongly suggest you upgrade.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for symfony/http-foundation v3.3.2 -> satisfiable by
symfony/http-foundation[v3.3.2].
- symfony/http-foundation v3.3.2 requires php >=5.5.9 -> your PHP version (5
.4.12) does not satisfy that requirement.
Problem 2
- Installation request for phpdocumentor/reflection-common 1.0 -> satisfiabl
e by phpdocumentor/reflection-common[1.0].
- phpdocumentor/reflection-common 1.0 requires php >=5.5 -> your PHP version
(5.4.12) does not satisfy that requirement.

Getting No 'Access-Control-Allow-Origin' exception

Hey,

i really like what you are creating!

After installation and running npm start in backend directory i am not able to log in via http://localhost:4200/.

it throws:

Failed to load http://api.boilerplate.local/v1/setting/public: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access.

Do you have a hint what it could be?
Maybe routing in the yii2 api?

Server Send Events

Hi. I use your yii2-angular2-boilerplate rest API. I have problem with realization of SSE(Server Send Events) feature on backend side of project. I loged in angular2 app, the authorization is successfully, all urls are accessible, but when i try to do request for my SSE action have error - 415 (Unsupported Media Type). May you provide any example of using SSE in your project, please?
It is necessary for me!!!)))

Thanks a lot for any answer!

Error when running docker-compser up -d

I Get the following error after when i run docker-compose up -d command. I'm on windows.

Composer (version 1.6.5) successfully installed to: /usr/local/bin/composer.phar
Use it: php /usr/local/bin/composer.phar

': No such file or directory
Service 'api' failed to build: The command '/bin/sh -c curl -sS https://getcomposer.org/installer | php -- --filename=composer.phar --install-dir=/usr/local/bin && composer global require --optimize-autoloader "fxp/composer-asset-plugin:${VERSION_COMPOSER_ASSET_PLUGIN}" "hirak/prestissimo:${VERSION_PRESTISSIMO_PLUGIN}" && composer global dumpautoload --optimize && composer clear-cache' returned a non-zero code: 127

Tutorial Page

Hello

This is awesome project. Will be any tutorials website about this project and will you update this project?

Error When `docker-compose up -d`

I tried this boilerplate for first time for learning how to use yii2.
Then I followed How to Start, until I met this error.

image

When I read, it has error at ./api/Dockerfile. Then I change some code to try if that works.

from this,

RUN chmod 700 \
    /usr/local/bin/docker-entrypoint.sh \
    /usr/local/bin/composer

# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- \
    # FIXME: Composer 2.0.0 is not compatible with fxp/composer-asset-plugin for now. Set version until it is fixed.
    --version=1.10.16 \
    --filename=composer.phar \
    --install-dir=/usr/local/bin && \
    composer global require --optimize-autoloader \
    "fxp/composer-asset-plugin:${VERSION_COMPOSER_ASSET_PLUGIN}" \
    "hirak/prestissimo:${VERSION_PRESTISSIMO_PLUGIN}" && \
    composer global dumpautoload --optimize && \
    composer clear-cache

to this,

# Install composer from the official image
COPY --from=composer:1 /usr/bin/composer /usr/local/bin/composer

RUN chmod +x \
        /usr/local/bin/docker-entrypoint.sh \
        /usr/local/bin/composer && \
    cd ~ && \
    composer global require --optimize-autoloader \
        "fxp/composer-asset-plugin:${VERSION_COMPOSER_ASSET_PLUGIN}" \
        "hirak/prestissimo:${VERSION_PRESTISSIMO_PLUGIN}" && \
    composer global dumpautoload --optimize && \
    composer clear-cache

Then It works.

image

But something happened. In my docker, only mysql, nginx, and memcached are running.
image

in api container it show

standard_init_linux.go:228: exec user process caused: no such file or directory

in backend container it show

standard_init_linux.go:228: exec user process caused: no such file or directory

in frontend container it show

standard_init_linux.go:228: exec user process caused: no such file or directory

I dont know what happen. Anybody can explain me why and how to solve it?
Thank you so much.

btw, my OS is Windows 10 and I am using Docker Desktop for Windows.

401 Unauthorized Error

I have uploaded the api on to my web server but when i send an get request to the api it gives me back 401 Unauthorized error. When i debug i can see the headers i sent from the frontend are missing in the api. This scenario works well without any issue in my local server with xampp. I have googled for a solution but none of them worked. I think this has to do something with the .htaccess file.

ERROR: Service 'api' failed to build:

failed01

I'm getting the below error, please help me to resolve this -

ERROR: Service 'api' failed to build: The command '/bin/sh -c curl -sS https://getcomposer.org/installer | php -- --filename=composer.phar --install-dir=/usr/local/bin && composer global require --optimize-autoloader "fxp/composer-asset-plugin:${VERSION_COMPOSER_ASSET_PLUGIN}" "hirak/prestissimo:${VERSION_PRESTISSIMO_PLUGIN}" && composer global dumpautoload --optimize && composer clear-cache' returned a non-zero code: 127

AuthHttp Not working in request

public login(username, password) {
let headers = new Headers();
headers.append('Content-Type', 'application/json; charset=UTF-8');

    return this._authHttp
        .post(
            this._globalService.apiHost + '/user/login',
            JSON.stringify({
                "LoginForm": {
                    "username": username,
                    "password": password
                }
            }),
            {headers: headers}
        )
        .map(response => response.json())
        .map((response) => {
            if (response.success) {
                localStorage.setItem('frontend-token', response.data.access_token);
                this.loggedIn = true;
            } else {
                localStorage.removeItem('frontend-token');
                this.loggedIn = false;
            }
            return response;
        })
        .catch(this.handleError);
}

In this code authhttp not working when i replace authhttp to http it's working fine
can you please tell what is the processor of angular-jwt ?

API Bad Request

image

{"name":"Bad Request","message":"The system could not process your request. Please check and try again.","code":0,"status":400,"type":"yii\web\BadRequestHttpException"}

current php 7.2

i need tutorial video how this project working properly on localhost

@chrisleekr please advice us,

Problem on starting frontend

When I run the npm start. Shows me this. I don't know how to fix it!
Thanks!
The "@angular/compiler-cli" package was not properly installed.
Error: The "@angular/compiler-cli" package was not properly installed.
at Object. (/Users/mateoalpuy/yii2-angular2-boilerplate/frontend/node_modules/@ngtools/webpack/src/index.js:14:11)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/Users/mateoalpuy/yii2-angular2-boilerplate/frontend/node_modules/@angular/cli/tasks/eject.js:10:19)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)

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.