andrewelkins / Laravel-4-Bootstrap-Starter-Site

Laravel 4 Starter Site is a basic blog application using several nice community packages.
1.77k stars 606 forks source link

Remove redirects from repositories #143

Closed andrew13 closed 11 years ago

andrew13 commented 11 years ago

Currently the user repository is tied to the admin. The redirect decision should really be the controller's responsibility. Plus this would allow us to properly use the User Repository for the frontend and backend.

https://github.com/andrew13/Laravel-4-Bootstrap-Starter-Site/blob/resource/app/repositories/user/EloquentUserRepository.php#L45

Now how we go about that, I'm not sure of the best approach.

nekwebdev commented 11 years ago

Yes it is an issue for sure and I think have found a very cool solution to this at my try at an API implementation, try this out: https://github.com/nekwebdev/scratch

Right now only the user API is halfway done, the front end UserController looks good. Now I need to make an admin UserController and it should be really nice, each one will get all of it's data from the same API controller! Which could then be queried by any kind of app ;)

What is going is that we have the api controller being internally queried by the front end user controller.

If you do curl json requests to the api in a restful way you will get the expected status codes and objects in JSON.

Only thing missing is the API auth. Right now all methods can be triggered by http requests :)

I think this is a direction to go, and would make it easy to turn into packages.

A user package that has all the need requires on packages and implements the models, routes and controllers such as \api\v1\UserController, \frontend\UserController and \admin\UserController

The initial package could require others such as the template or the home controller.

andrew13 commented 11 years ago

100% Agree with that approach. Now we just need to make auth work. Possibly move toward an oauth 2.0 approach. I'm doing that in another project, and could probably port that to this.

nekwebdev commented 11 years ago

It is very funny, so I am working to make my controllers internally query the API when it dawned on me... I could just sue the repository in all of my controllers... LOL

So yeah querying the API internally is kind of pointless, but I learned how to do it ^^

I still think It is good to have an API controller, and it is very slim and fast to implement as long as the repositories are done right as you pointed out.

Now a bit off topic but I dont feel like making a whole new issue over it, I would be stoked if we switched this project to git flow :) http://yakiloo.com/getting-started-git-flow/ I started using it and really like how it plays out. And if you have git flow installed then it makes it all so easier! :)

If you also feel it would be good to switch to that flow, I could edit the contributing.md to go into details on what the flow should be like for forks/pull requests and internally.

andrew13 commented 11 years ago

Game for that, this is basically what I've used for a couple years http://nvie.com/posts/a-successful-git-branching-model/

Add it :)

andrew13 commented 11 years ago

I'm also going to spin up a site for this project for discussions, and such.

nekwebdev commented 11 years ago

:+1:

nekwebdev commented 11 years ago

After starting from scratch to understand how API, namespaces and all that jazz would work, I am now at a point where I almost copy/paste everything from the resource branch so getting back up to that point should be ok.

I'll try to make a new branch here using git flow that would end up replacing the current resource branch.

I have changed a lot of things in the templates as well. I'll describe the new structure in the readme as well.

andrew13 commented 11 years ago

Cool, I'm also going to apply a new UI look and feel to the project. It'll make it more usable out of the box. Still 100% boostrap

On Fri, Jun 28, 2013 at 2:28 PM, OJ notifications@github.com wrote:

After starting from scratch to understand how API, namespaces and all that jazz would work, I am now at a point where I almost copy/paste everything from the resource branch so getting back up to that point should be ok.

I'll try to make a new branch here using git flow that would end up replacing the current resource branch.

I have changed a lot of things in the templates as well. I'll describe the new structure in the readme as well.

— Reply to this email directly or view it on GitHubhttps://github.com/andrew13/Laravel-4-Bootstrap-Starter-Site/issues/143#issuecomment-20215452 .

nekwebdev commented 11 years ago

Sweet, I have moved the project to git flow style as you can see. So far the admin only has users and roles, and not much is functional on the front end side in the admin. I also made the addition of Font Awesome to replace bootstrap sprites, maybe you should include it in your UI re haul?

Just trying to merge what I did on the side. But I did put the updated template style in there.

Basically each view is extending a template, which in turns extends a layout. The template loads the assets, manages the title and metadata, decides on which navbar and footer to use and in turns gets it's content from the initial view that was returned.

Looks pretty flexible and can easily use a DB based system for the template variables.

Now a quick question since I am new to git flow. Let's say I want to make a new contributing.md file for the project to layout the git flow, which would help me remember the different steps and help others that wish to contribute.

Should I make a hotfix named v1.2.2 ?

I suppose it warrants it, since we are moving from a contributing system to another.

andrew13 commented 11 years ago

Since we are changing a ton, lets get the feature branches ready, merge them one by one in to a new release branch 2.0.0-alpha.1. On Jun 28, 2013 6:52 PM, "OJ" notifications@github.com wrote:

Sweet, I have moved the project to git flow style as you can see. So far the admin only has users and roles, and not much is functional on the front end side in the admin. I also made the addition of Font Awesome to replace bootstrap sprites, maybe you should include it in your UI re haul?

Just trying to merge what I did on the side. But I did put the updated template style in there.

Basically each view is extending a template, which in turns extends a layout. The template loads the assets, manages the title and metadata, decides on which navbar and footer to use and in turns gets it's content from the initial view that was returned.

Looks pretty flexible and can easily use a DB based system for the template variables.

Now a quick question since I am new to git flow. Let's say I want to make a new contributing.md file for the project to layout the git flow, which would help me remember the different steps and help others that wish to contribute.

Should I make a hotfix named v1.2.2 ?

I suppose it warrants it, since we are moving from a contributing system to another.

— Reply to this email directly or view it on GitHubhttps://github.com/andrew13/Laravel-4-Bootstrap-Starter-Site/issues/143#issuecomment-20220490 .

andrew13 commented 11 years ago

I think we are moving this project toward becoming a extremely simple CMS, which isn't a bad thing. Let's knock these out for 2.0.0

TODO list

andrew13 commented 11 years ago

Attack plan:

If you can get the repositories and templates about 80% done, then I can finish the uploads, UI and help with the repositories.

nekwebdev commented 11 years ago

Sounds good! So I'll just do a quick contributing.md so that we are both on the same page on how we are going to manage the git flow and version numbers.

UI looks good too!

nekwebdev commented 11 years ago

redirects are out

andrew13 commented 11 years ago

:+1: