Using MEAN Stack for social media app and service like fiverr - node.js

I'm planning for an application that is a social media app with service like fiverr is integrated where user can communicate with each other and ask for advise.
Problem: What should be the best technology stack, weather it should be MEAN(Mongo, Express, Angular 2.x, Node) or MEN(Mongo, Express, React, Node).
Also I want it to be a REST web app, so that I can develop mobile apps later. So should I use some NodeJS framework like KeyStone or some generator like generator-meanjs. And what should be the directory structure or architecture for this.
Thanks

Choosing the best technology stack is up to the expertise of the group who would be working together. Since you are mentioning about MEAN I assume that you are well acquainted with Javascript. The answer to your other question of having the REST web app, Mean JS does provide you with the REST APIs (courtesy ExpressJS) while using CRUD module generators, You get that out of the box if you are going with mean.
Though all these utilities will help you get started from scratch in no time it really depends on the business logic of how you would want to capture the work flows. From what I get fiverr service seems to be a kind of free lancing website where one would show case their skill set and get hired. Unfortunately fiverr doesn't seem to be having an API where you can integrate your service.
Edit1: To build a service like fiverr you have to tie in various aspects not just the technology stack. There is business logic which hsa to be defined on what you'd want your app to acheive. For example let's assume you are doing some thing similar to fiverr, You would have to account for eCommerce stuff that would be happening. You would have to have user management built in to your app.(Mean.js does provide a few aspects of this, user signin/signup social media integration). Every thing else depends on what you'd actually want your service to acheive, All the best :)

Related

How to send documents from my mongodb database to android application?

I want to connect mongodb server to android application so that i can send data( which is stored online on mongodb ,not locally) to android user. I want to do it through REST api using node.js but couldn't find a way to do it.
Please help.
First of all it's a bad idea to connect to the Database directly. It is possible, but it'a a bad idea.
It's a much better practice to create a web service backend that your app can connect to. This will allow you to implement the business logic on the server. And additionally, you will be able to use not only Android, but iOS, AngularJS and others as clients too.
Generally the most common rest backend architecture looks something like this:
REST BACKEND
I find this way of development to be modular and very well organized.
In short, the API layer only takes HTTP GET and POST methods, and calls the appropriate functions in the Service layer. The service layer holds all of your business logic and calls the DAO layer, and Dao call anb works with the DB.
There's tons of examples for how to build web services, and it's highly dependent on your language of choice for your web tier. There are also tons of examples for consuming web services on Android. You should look it up.
But whatever language you choose the API -> Service -> Dao -> Database scheme should work fine.
If you don't know where to start take a look at Python Flask or Java Spring as good candidates for developing web services. (I use Spring because there is a ton of great documentation on whatever you may need.)
Hope this helps a bit. Good luck!

What development stack to use?

I am planning to build a website and after that, to create an app with the access to the same database and the same functions as the website. So I heard, that with Ionic, I could save my time and develop a hybrid application, so I do not have to do the same work twice. The website should be a portal, which is a mix of a social network and an online shop.
What do you think, is it a good idea to use NodeJs for the Back-End for that?
So as I think my development stack would look this way:
Ionic2 with AngularJS2, NodeJS for Back-End and MySQL for storing data.
Can you say, how can I improve my development stack? Are there some things, which are bad compatible, or everything seems to be ok?
Kind regards,
Andrej
You can use web services like restful web services for accessing database from website and mobile application.

Resources/Explanations on Current Web Architecture & Technologies across the stack?

I am building a new web app but i feel i don't have the big picture representation that I wish to have before building it so I am looking for resources to really understanding the web as whole throughout the full stack.
I've been a self-taught web developer since 2006 but I took a long break during university in 2010 and finished in 2014 and came out and the whole picture of web had changed.
I was familiar with the LAMP architecture and back then as long as you understood PHP, JavaScript, JQuery, MySQL, HTML & CSS you were fine; now MEAN is making a lot of noise and i just took a look at what Facebook is built with and it talks of HipHop which I have never heard of before and i feel quite lost with frameworks and languages popping out every other week.
I basically am looking for resources to understand the web as a whole, not just to create web pages so I can make informed decisions about building this and any other web app in the future. I want to know how all these new technologies are fitting into the picture.
Thank you
The big picture is you need a database, a data access layer that talks to that database, something to route the requests and something to display the result to the page.
There are lots of frameworks / technologies. IMO the LAMP stack is a bit old school. Not that it's not fit for purpose, it's just there are faster, better, easier stacks than that.
In terms of development languages and frameworks I would check out
Ruby-on-rails,
Spring-boot (with MVC, JPA, freemarker + mysql),
ASP.NET5
For databases mysql is always really popular because it's free. H2 is a free in memory database, I thinks it's a nice db to get up and running real fast.
Generally these days data access Is done through some sort of 'Object Relational Mapper' framework like Hibernate (if ur using Java), Linq (if ur using ASP.NET) or whatever ruby on rails uses.
For the view technology html, css is obviously standard but lately Bootstrap3 is really popular as a front end UI framework to make things a lot easier. In terms of Javascript, jQuery is basically a defacto standard these days. Something like Knockout.js or Angular.js provides nice data binding between your model and your view to make things a lot easier.
Not to mention as an extra layer these days people are also putting their apps inside Docker containers and deploying them that way for maximum portability. So that is something that is new and to you won't have seen before if you've been away from the game for a while.
Anyway, my favourite is the spring-boot stack. It has an embedded instance of the Tomcat web server and it comes all auto configured.
I believe the main changes that affected the course of current web development scenariois related to cloud based services, like Amazon AWS, Google Cloud, Microsoft Azure, and Virtual Private Servers (VPS).
Now is cheaper and possible to plan and develop a distributed environment to achieve a massive numbers of users. Servers are adapting their technologies to this new scenario and to providing easy webservices endpoints for mobile clients via REST APIs (like Google, Facebook, Soundcloud and almost every other service provider) using JSON for small data transfers between server ans clients.
This is the present and near future of web development. And we can no more close our eyes to mobile. Te mobile first era is comming.
You can use LAMP stack for webdevelopment, with or without frameworks like zend, cakephp and others, but the end product will be a REST or RESTfull service provider and a client to consume the services and integrate with many 3rdParties like Google, Yahoo, Facebook, Amazon services to build modern applications.
As for databases, there are now distributed non relacional noSQL hadoop, mongodb, mariadb bring more options to plan robust infra-structure and flexible ajustable for all needs.
To create a great web platform is necessary to know the existence of all this tools and possibilities, but specialize and deep learn only the tools you will choose to develop, because it is impossível learn everything, our brain cant handle :) and all se em to update very fast in this area.
Choose right one is difficult, there is a lot of options, but the main concept will be always the same, there will be a provider and consumer fronts, distributed or non-distributed, and a multi layered development involving UI, integration, business and data (big data) manipulation. But now on the Cloud.
You can find good official material for Php, amazon webservices, nonSQL databases, common 3rdparty APIs like Google Apps, Facebook...REST clients end framework, JSON...and there is a lot of good alternative sources too...get some open-source project example on Github (GIT is another mandatory tool to learn).
I particulary develop in Java now, Linux/MySQL/Tomcat on amazon AWS infra-structure, using Java-JSP for server and web client, and Java for Android..I just have to deal with Java environments and one language for Server (webserver and SO programs) and clients (web and mobile) development.
Well I hope I could help, I dont know if this is exactly the answer also if I made it clear cause my english is basic...
Well, have a nice weekend.
Leo

Using Node.js along with old Java Web application (Spring MVC)

I have an existing web application. It uses Spring MVC on Tomcat and MySQL at the back end with transactions (multi table updates). I am also using spring security for role based authorization. This is very typical website without any real time notification, chat etc.
Now my client wants to add real time notifications like Facebook, chat module etc. Typically on front end some action will be taken, and all or specific logged in users need to get notified. After receiving notification, I need to update some <div> content. Frequency would be high. (Currently user needs to refresh browser.)
I completed POCs using Node.js/Express and looks like it's easy to accomplish these 2 things with Node.js.
I have 3 options:
Move front end to Node.js and may be Angular.js. Manage form validations / security through Node.js/Angular.js but all database calls are still managed by my old website (in a RESTful manner) as I can reuse my existing stuff. Most of the method calls return to a tile but we can easily convert to return JSON object.
Keep existing website as it is and plug in Node.js into it just for real time notification / chat etc.
Scrap existing website and redo everything including security, transactions using Node.js. There are many posts saying as Node.js is kind of new, not preferable for enterprise application and also this might be too much.
Approach 2 would be my preferred approach as we have expertise in Spring, Node would be completely new for us but I don't know whether it's practical & doable approach, what kind of issues I might be facing. I am also not sure how to integrate Spring MVC running on Tomcat and Node.js together.
Please could anybody help me in deciding, out of the three what's the best way to go? Any other approach which might be easier?
You already have an existing Spring MVC codebase and you can reuse it. However you can go ahead with AngularJS for your front-end technology. Your front-end AngularJS code can talk to your existing Spring MVC via REST api and to NodeJS for real-time features which you plan to develop.
You need to use Socket.io within NodeJS which will provide the features you are looking for.
One major problem you might face is related to session when talking to two different backend stack.

Is this a good web application architecture?

I'm trying to build a website myself but I also want to build a native mobile application that will access the same DB in the future.
What I'm thinking now is using Node.js to build Web Services wrapper for the DB and every DB operation will be executed via web service API. And for the website framework, I'm going to use Rails.
Please let me know whether this is a good architecture or not. I'm not sure whether encapsulate data with Web Services is a good idea. Will there be any performance issue? And if it's feasible, which DB should I use? And can rails communicate with DB via web services?
Thanks a lot!
Update
Why do people down vote this question??
I think you have more technology than needed in your architecture right now.
Personally I would create a REST api on top of the DB (using either node or Rails - both are super easy to do this with and both can use pretty well any db)
Then you can write any number of "apps" for the front end process, whether they are web apps, ios apps, android apps, etc... They will all get their data from your REST api on the backend.
You might even consider writing the front end as a single page app using Angular, Knockout or Backbone, something like that. If you do that with node, your entire stack will essentially be written in javascript. It can get confusing for a newb, but it's super powerful.

Resources