AngularJS app - with Lumen or Laravel? - angularjs

I am about to build web application consisting of three parts:
Public data-oriented websites for unauthenticated users with geolocation search, ...
Member area (with authentication) for managing the data
Mobile app/apps with the same functionalities
The airbnb.com is a good example of the structure.
Basicaly the thing is to create a server side API which will be shared accross clients.
I definitelly want to use AngularJS for the client side, but I am not sure which of those solutions is better:
Create the API with microframework Lumen and add sessions / authentication / html serving / other services to the Lumen
Create the API with full stack framework Laravel and serve html to AngularJS
Thank you for your suggestions.

You will need a solid api, lumen has all we need to build an api. You can go ahead with option 1 as you can later on migrate to full stack laravel framework, if needed.

Related

How to use API as backend in ionic mobile app development?

I am having a web application built using JAVA spring which has API feature to read and write into database.
Now i have to develop an ionic mobile app for the same application. How to read and write data into database.
I know Firebase and other alternatives can do the job.
But i need my own API code(written for web app) to be used. Is there any way to achieve that?
I guess calling the respective API when the web application is live is achievable.
But how can i achieve that while developing(When the web app is under construction)
Well depending on how you set up the API this could become quite difficult.
You're saying/guessing that you can call the API when the webapplication is live. This makes me assume you've created a REST API? Or did you create a Spring MVC application?
If the webapplication is directly linked to your Spring application (f.e. going to localhost:8080/my-profile shows a page (not JSON) of your profile) then I'm not sure if you can achieve the above mentioned target.
If you get a JSON response, or are somehow able to retrieve it from the webpage, you can just simply call (in typescript:)
this.http.get('http://localhost:8080/my-profile').map(response => console.log(response.json() );
Else, you probably will have to create a basic REST API (check out Spring boot for a 5 minute setup) and provide it, either with hardcoded data or connect it with your database.

AngularJS 2 as Frontend and Symfony 3 as backend

I will start a new project with angularjs and symfony 2.
I just wanna know if my way, how I will realise it, is good.
The AngularJS frontend would be available over https://www.example.com and the backend of symfony would be under https://api.example.com.
So I hope that the routing of every framework would not colidate.
And I have also a available API for the mobile Devices.
Is this a best practice or is it better to use the api under https://www.example.com/api
IMO it is better to create 2 separate projects.
for the api (api.example.com)
for the front-end (example.com)
This way you avoid problems with:
routing (like you point - collisions)
sessions (api do not need sessions at all)
packages - e.g. your api could use symfony 3.1, but your front-end symfony 2.7
easier load balancing (IMO)
see:
Is it better to place a REST API on a subdomain or in a subfolder?

Angular JS and Web API Architecture

I have to prepare an architecture with following technologies:
Angular JS 1.5
MVC 5.0/Web API.
EF 6.0
Is it a good option to have a single web project which has angular JS and Web API.
We need to expose web api's to other third party vendors. So, we are thinking to create a separate web api project as a separate project. Need your inputs.
Thanks,
Dhannajay
You can have a lot of options to define the architecture, but to answer your questions, I think is better have separate projects in this case for the following reasons:
You can change the front-end without touch any in the api system (web api) and viceversa
You can scale both sites or only one, maybe, the front-end goes well, but you need more power in the web api, go ahead and scale only the api.
you can do this (like here)
API: your api front end
Core: business logic/EF
MVC: html/mvc/angularjs
DTO: classes/models

Meteor, Laravel RESTful API + AngularJS or Laravel for my next web app

I have a PHP background and I have build several web apps with Laravel (3 and 4). I have also experience of using RESTful APIs in my projects.
My current client have an ERP which is bunch of PHP files. Those files contains about 60K lines of spaghetti code. Client doesn't want to invest more money for developing that system so we decided to rewrite the whole app. I know all the risks about rewrite and I have also read Joel's article (http://www.joelonsoftware.com/articles/fog0000000069.html) so there is no need for refactor or rewrite discussion.
For the new app I have been thinking to build RESTful API with Laravel (4 or 5) and frontend with AngularJS. That was before I tested Meteor 1.0. It is very promising and it would be very nice to use it for this project. But is it suitable for this kind of product?
My client's product is something like this:
No public registration for this app (admin creates all the users)
Complex user permissions (group level permissions and user level permissions, 6 groups)
File handling (images, pdf etc.). Files are used as message attachments.
Big data tables
External API calls
App contains sections like: users, orders, offers, time tracking, sales, reporting, calendars, clients.
So is it wise to use Meteor for this kind project or do you prefer RESTful API + AngularJS combo? I'm hesitating because I'm afraid that in big projects using Meteor the code will becode mess.
I'm working on a feasibility analysis for using meteor on a similar project at Google, and I think Meteor would be great for your project.
Admin user creation - check Houston
REST API - [you don't need one for your own tools]( need to think in Meteor terms. ). Meteor has a much simpler mechanism - Meteor.call and Meteor.methods.
User permissions - see the roles package
File handling - see CollectionFS or search Atmosphere for upload.
External API calls - HTTP.get makes it trivial. See also Atmosphere for specific packages.
Big data tables - see this answer about table widgets
Don't know much about Meteor, but for the Angular variant you can take a look at this POC application using a AngularJS client and a REST Server:
https://groups.google.com/forum/#!topic/angular/Q3GrhAH39AU
http://www.civilian-framework.org/doc-samples.html#crm

one express server and two or multiple angular clients

fullstack to build my app
What I'm trying to do is having multiple angular clients with one server.
To be specific, I want a website and a mobile website.
the function of both sites is same. Thus, I want only one express server using REST API.
Since I'm using angular-fullstack, I already made a website(angular app) and REST API(express) server.
I want to add another angular app to my angular-fullstack project.
Is there any documents about those kind of structure? or any advice?
thanks!

Resources