Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Pavel Raav
7,811 PointsA couple of questions regarding server-side programming.
So, I have been given the task to create a mini-instagram style app in Javascript, using Express.js for the server-side. The user is supposed to be able to upload photos and log in using Google or Facebook. Right now I am taking the "Express Basics" Course to try and understand how I might begin to program this on the server-side.
So far I've always understood that all the server-side programming is done in the back end, but in this course we are apparently working on a "front end server". Could someone please explain the concept of a front-end server and how and if it would fit into the app that I am trying to create. Some pointers would also be great.
1 Answer
Keyur Golani
6,703 PointsBasically to get started with Express.js (Node.js presumably) I would suggest Express Application Generator. This is the easiest way to get started with a skeleton of an Express application and will give you all the basic structure for a Hello World application in Express.js.
To have the user login with Facebook or Google or Twitter or pretty much anything, use Passport.js. This is a really extensive library and provides much comprehensive options for authentication.
Now about the front-end server. It is the server usually dedicated to handling the requests from the client and responding to it. Handling bad requests and validations as such. Of course, it being named front-end, it is facing front end but not that it is on the client side. Usually this term is used when you want a scalable application and you want to use something called Message Passing Mechanism to make your application scalable. In this you divide your server into two parts. One handles the requests from the client (User) and it communicates to the message passing mechanism for any business logic or processing. The other part reads the messages from message queues and provides services to process the messages according to the intended business logic. Here, the first part, handling requests and requesting the business processing, is the front-end server. And the second part doing the business processing and communicating to the database, etc is your back-end server. To understand the message passing architecture more, checkout Wikipedia pages of AMQP and RabbitMQ or Kafka. For your application though, I would recommend RabbitMQ. Also, visit RabbitMQ official website and documentation. It is really well written.
Pavel Raav
7,811 PointsPavel Raav
7,811 PointsThank you VERY much for the in-depth answer! I now have a much clearer idea of what I should do. Password.js is exactly what I need! RabbitMQ also seems like a really great resource. I will definitely read through the docs. :)