All Projects → hunwalk → yii2-basic-firestarter

hunwalk / yii2-basic-firestarter

Licence: BSD-3-Clause license
This is a pimped up basic yii2 template ❤️. It's a firestarter 🔥

Programming Languages

PHP
23972 projects - #3 most used programming language
shell
77523 projects
CSS
56736 projects
Batchfile
5799 projects

Projects that are alternatives of or similar to yii2-basic-firestarter

yii2-basic-adminlte3
Yii 2 + AdminLTE 3 (Bootstrap 4) Yii2 Basic Project Template Build on AssetBundle (No CDN/Import CSS,JS Files)
Stars: ✭ 24 (-31.43%)
Mutual labels:  yii2, yii2-basic
yii2-material-theme
Material Theme for Yii2
Stars: ✭ 15 (-57.14%)
Mutual labels:  yii2, yii2-template
yii2-docker-app-advanced
Yii 2 Advanced Project Template under docker and docker-compose
Stars: ✭ 25 (-28.57%)
Mutual labels:  yii2, yii2-template
yii2-rest-api
Yii 2 REST API Project Template
Stars: ✭ 36 (+2.86%)
Mutual labels:  yii2, yii2-template
yii2-payment
Yii2 Payment extension hổ trợ tích hợp các cổng thanh toán VnPayment, Onepay, Bảo Kim, Ngân Lượng, VTCPay, MoMo.
Stars: ✭ 20 (-42.86%)
Mutual labels:  yii2
yii2-widget-cropbox
This widget allows crop image before upload to server and send informations about crop in JSON format.
Stars: ✭ 90 (+157.14%)
Mutual labels:  yii2
query
Run SQL queries as an admin from the Craft CMS control panel.
Stars: ✭ 14 (-60%)
Mutual labels:  yii2
hisite-template
HiSite Project Template
Stars: ✭ 16 (-54.29%)
Mutual labels:  yii2
yii2-ledap
yii2 for ledap
Stars: ✭ 20 (-42.86%)
Mutual labels:  yii2
yii2-highcharts-widget
HighCharts Js Widget for Yii2
Stars: ✭ 40 (+14.29%)
Mutual labels:  yii2
yii2-yandex-market-yml
Yii2 module for automatically generation Yandex.Market YML
Stars: ✭ 14 (-60%)
Mutual labels:  yii2
yii2-laradock
Laradock pre-configured for Yii2 Framework (https://github.com/LaraDock/laradock)
Stars: ✭ 16 (-54.29%)
Mutual labels:  yii2
yii2-behaviors
Collection of useful behaviors for Yii Framework 2.0
Stars: ✭ 25 (-28.57%)
Mutual labels:  yii2
phpass-starter
A starter project for Phpass.
Stars: ✭ 24 (-31.43%)
Mutual labels:  starter
yii2-timezone
Timezone detector
Stars: ✭ 14 (-60%)
Mutual labels:  yii2
yii2-composer
Yii 2 composer extension
Stars: ✭ 76 (+117.14%)
Mutual labels:  yii2
first-pr-repo
A step by step guide to help people make their first Pull Request
Stars: ✭ 29 (-17.14%)
Mutual labels:  starter
library
企业内部图书馆管理系统
Stars: ✭ 23 (-34.29%)
Mutual labels:  yii2
database-all
Eloquent ORM for Java 【database-spring-boot-starter】
Stars: ✭ 151 (+331.43%)
Mutual labels:  starter
yii2-manual-chm
Yii 2 Guide/API/Docs compiled in various formats
Stars: ✭ 63 (+80%)
Mutual labels:  yii2

Yii 2 Basic Firestarter


This project is discontinued

Please follow this link if you want something similar to this project: https://github.com/hunwalk/yii2-app-forge

This is a somewhat modified version of the basic template with some pregonfigured features. I've created this to save time upon creating a new project.

Please leave a star if you're considering to use this template in production.

Contains:

  • that overly useful symfony VarDumper. Use the dump() method
  • dotenv configuration ( idea by @lostika86 )
  • The dektrium/yii2-user and dektrium/yii2-rbac packages with basic config
  • An api identifier solution (Authorization header => Bearer token) / code by bizley
  • An api module
  • Predefined controllerMap to the console config (added migration commands)
  • A conventional commits helper

Check out the packages

Get started

Use the latest release

$ composer create-project hunwalk/yii2-basic-firestarter <projectName> --prefer-dist

Or use the current master branch, if you're in a hurry for features if there is any

$ git clone https://github.com/HunWalk/yii2-basic-firestarter <projectName>
$ cd <projectName>
$ composer install
$ composer run-script post-create-project-cmd

post-create-project-cmd script sets up the permissions for some folders and generates the cookieValidationKey for you

Instructions

1st step

Create a .env file from the .env.example

OSX / LINUX

$ cp .env.example .env

Windows

$ copy .env.example .env

2nd step

  • Fill in the .env file. Add or remove things, it's your choice entirely
  • Run the following commands
    $ php yii migrate-user
    $ php yii migrate-rbac
    $ php yii migrate
    

3rd step

  • Run the server and be happy :)
    $ php yii serve
    

About the API

You can reach the api at api/v1 There is an example controller you can test. That is purely for demonstration, and can be better.

Update user profile using the api (This is purely for testing purposes)

Read this carefully, if you've never done something like this.

  1. Start the server
  2. Pop up your favourite api client
  3. Set the url to api/v1/user/settings/profile
  4. Set up a header with the key Authorization
  5. The Authorization header value should be your token.
  6. Keep in mind, that the token will expire within 60 seconds
  7. Do a get request with these settings.
  8. You should get back the users profile
  9. Now do a post request. The body should be x-www-form-urlencoded
  10. The key value pairs should be Profile[name] = {yourname}
  11. Send. 😄

If you did everything right, you should get back the updated profile.

Some additional information

The token looks like this:

1:1574952622:d1da75dd83fc643384c728ed7ecfb266574d6533

It has 3 parts. The user_id, the current timestamp, and the users api_key sha1 hashed together with the current timestamp.

You can find more information about generating that token inside the v1 modules DefaultController Also, you should delete that before going to production.

You can obtain the users api_key from the user table in the api_key column.

Use Conventional Commits

Thanks to the conventional commits project and this guy: https://github.com/damianopetrungaro/

It seems like, something broke after i released this update, and the fire/commit command does not really work. Requires some tweaking, but definitely going to fix this sometime. However feel free to use the idea of the conventional commits. It's really great 😄

Todo

  • Correct testing
  • Mention every 3rd party package here (i hope i did, open an issue if something is missing)
  • Test the API key functionality (tested, now it should work)
  • Make a v1 api module with contentNegotiation HttpBearerAuth and verbFilter by default

Sites or projects ignited by this

Send a PR if you have one :)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].