I am going to build website with admin panel , it will have these features(news , pages , gallery, events, sliders , users login/registration)
i want to create api for the website and api for the admin
i will use angular to build the website and the admin
and i will use codeigniter to build the api
my questions is :
should i work with RESTfull api to build the admin or its not recommended and if yes should i use codeigniter or its not usfull in this case (restfull api)
I have worked with codeigniter for many years. But to be honest the choice of framework really depends on the app you have in mind and its functionalities.
CI in general is very easy to learn and to begin where others such as laravel tend to have a bigger learning curve. However, they do have more advanced functions compared to CI.
Using angular for the frontend seems like the way to go now a days but for a backend using a RESTful API to connect with angular really depends on how further you are willing to go with the backend. What I mean is having an API would be good if you are planning on building something more that a web interface/page like may be an app as well for the backend. Then it could be beneficial in saving time because you can reuse the same code in your API when connecting through the app. Apart from that, I'd say it really depends on how well you know the client, the backend user etc.
Related
I want to use laravel(as backend) and angular(as frontend).
As far as I know I can use 2 methods :-
1) I can integrate both frameworks by using API service or
2) I can use monolithic architecture style (using angular with blade template)
As per my requirements 2nd option is better because in it I can use laravel's default functionalities in angular like (Auth, user roles and permissions etc).
But I afraid that 2nd option makes the project complex and messy in future.
which is the better option?
I have used myself Laravel with Angular v2+, the way I did was to make two separate projects, one which creates the API's (The Laravel app) and one which consumes the API's (Angular v6 app). That is how it is meant to work and that is how you should approach it.
If you want to integrate the front with the back end, and still have a powerful SPA, then you can go with VueJS, there are vast resources when it comes to the Laravel Vue combination.
another thing to consider is what is this project about?
is it a client website? or just a web app? does it require SEO? beware.
make sure you fully understand (angular) universal and it's current limitations/problems.
UPDATE: I am currently using Angular 6 with with Server side rendering(universal) and a Laravel API as a Backend solution for a complex & highly ranked website in the UK.
You have API routes available which doesn't look for CSRF tokens. Use any JWT package for web token authentication implementation. Host your Angular app separately and send request to API routes.
Your Angular apps are standalone applications. They don't need Laravel for running on server. You just need to use API routes for working with data.
I am working in a project which will have a web, android and iOS application.I have decided using laravel 5.4 to create the web application and also there will the rest api to feed all these app. The api should also be secured so that only my app can access them.
Anyone please tell me from your previous experience what will be the correct way and the best practice to do this
You can use Node.js or Python on which you can develop rest API very easily.The framework like express in Node.js and Flask in python will let you get started with your API within 30 min.After that, you can deploy the API to Heroku to get secure access
If the web, android and IOS application relate to the same project / resources (e.g. database tables, etc.), the easiest way to do this would be a single Laravel project.
In your routes directory, you can have 3 different files (say web.php, ios.php and android.php) to define the routes. Similarly, you can place controllers in separate directories while keeping the Eloquent models/migrations, etc. the same for all three.
To use different authentication methods for all three, you can add custom guards in Laravel.
I would not build anything in larvel and run away form php as soon as possible. Go learn node.js or django. Death to php.
The best current framework to builds apis is Sanic.
Sanic 33,342 Requests/sec 2.96ms Avg Latency
https://github.com/channelcat/sanic
I also like python flask because it is very simple to understand and get something up and running quickly.
Your app currently does not need to be super optimal all you need to is getting working, But best practice wise i think the most important thing for building apis for mobile apps is backwards compatibility.
Sometimes your going to want to update the your app.
Users often don't update the apps. So if you build a new api all the people who dont update their app will get error messages. So just make sure you make a new route with the version name in the prefix in the app. There is alot of other things you can do like rate limiting,Salting your apis and ect. If you dont have that many users don't worry about this yet. Just build it and then latter learn when you need to learn in.
I'm building a series of web applications to use in a small business. We will be using laravel framework to build these applications. The first app will manage users, authentication and authorization for all future applications.
I have 2 doubts:
Is there some best pratice / model for this auth integration? How can I tell app B that the user is authenticated and has access to it? I want to build different laravel apps in order to make it easier to maintain, but (at least for now) they'll run in the same server.
Is it possible to make this integration with another php, non-laravel app? I have one legacy webapp, I'm trying to write the session data that authenticates it inside my laravel code and redirecting the user to the app, but the session data apparently isn't "persisting".
Thanks in advance.
It sounds like you are building a micro service architecture if you follow this methodology there is no reason your apps or services even have to be written in the same language as long as they and all interact using RESTful services.
More reading:
http://martinfowler.com/articles/microservices.html
I've one website built in PHPFox. The website is functioning properly. Now the mobile apps for iPhone and Android smartphone are under development which will use the same database that PHPFox website is using.
So, I want to make the existing APIs that are used for a PHPFox website available to the mobile apps (both iPhone and Android) as well. I don't want to reinvent the wheel again and want to re-use the same existing code for mobile apps.
I did a lot of research about this. I've spent almost four days on the research. I didn't get a single link which will explain me how to access the existing APIs from a PHPFox website for mobile apps (iPhone and Android).
One option I found from my research is creating new RESTful webservices using PHP or implement any such framework like Slim, apigility, etc.
But I think following any of the above two approaches will be a overhead and re-usability of code will also not be achieved. If the code which is working fine for website should also be used used on mobile apps. There should be no need to write the same code again. That's what I think.
So using the existing APIs from PHPFox website is the best solution that I think, might be I'm wrong. If you think I'm wrong please correct my approach.
If you could explain with some useful example it would be really great.
I've gone through PHPFox docs as well but couldn't get anything useful which could help me in the issue I'm facing. If you are also interested in documentation of PHPFox please go to below links:
http://unity.moxi9.com/docs
http://unity.moxi9.com/kb
If you could find anything useful related to the issue I'm facing please do let me know.
Well everything you are looking for is already there in the docs. Your mobile app would be registered as an app with PHPFox. You can then use their API. The remaining question is, if the end users need to authorize your mobile app from their "normal" web browser or if this authorization can be performed from the mobile app as well. At least that's what I read from the docs. Since you have an up and running installation at your hand: Just try it! Register an app and perform some requests to their API.
I'm currently building an application on Android that allows user to register a location-based service. I'm pretty new in both server-side programming and Android. Therefore I need some suggestions to point me to the right direction.
Concretely, my Android application will allow users to register, login, and update their profile and settings on the server side, and I'm using Apache as my server.
My idea now is using CakePHP on the server-side, and use JSON/XML format to communicate with the Android App via HTTP POST and response. I don't want to rebuild everything like authentication from scratch, however I can't find any CakePHP plugin that work for me. I've tried CakeDC and Authake. CakeDC seems incompatible with current CakePHP version. For Authake, I've followed the steps on the Authake Tutorial, however, the register and login page do not work. (I can't use admin to login as well.)
Summary
1. Is this server-client architecture feasible?
2. Can anyone point me to an CakePHP authentication/registration plugin which is compatible with current CakePHP?
Seems feasible to me. Though you might have to build a REST or
similar interface if you are letting users log in remotely through
the web interface.
I used the User Management plugin for my auth-based CakePHP programs and really like it.