PizzaBae - consultantjay/LTIMEARN GitHub Wiki

PizzaBae

PizzaBae gives the description of different kind of pizza restaurant in US. The user can search the details of restaurant on the basis of three criteria - city, name of restaurant and name of pizza and accordingly select one of the restaurant to view the delicious pizza provided by the restaurant along with is details.

Features that will be delivered:

  1. Clean and Simple to navigate user friendly User Interface.
  2. Applying various filters while searching (City, Name of restaurant, Name of pizza, sort according to price of pizza)
  3. Plotting restaurant location on Google Map (using Angular Google Maps Component)
  4. Login and Register
  5. User can give his reviews to us through contact form

Future Scope(features that will be included later)

  1. Take pizza orders
  2. Implementing payment gateway by which user will make online payment
  3. User profile page to change his/her credentials
  4. User who order pizza on daily or weekly basis gets extra features like more discount than others
  5. Expanding dataset and covering more regions.

About

PizzaBae is built on all the latest technologies which includes:

  1. MongoDB
  2. Node.js
  3. Express.js
  4. Angular
  5. React

MongoDB

MongoDB is a document database with the scalability and flexibility that you want with the querying and indexing that you need. MongoDB is a free and open-source cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with schemas. MongoDB is developed by MongoDB Inc., and is published under a combination of the GNU Affero General Public License and the Apache License.

Why NoSQL?

NoSQL systems are distributed, non-relational databases designed for large-scale data storage and for massively-parallel, high-performance data processing across a large number of commodity servers. They arose out of a need for agility, performance, and scale, and can support a wide set of use cases, including exploratory and predictive analytics in real-time. They arose out of a need for agility, performance, and scale, and can support a wide set of use cases, including exploratory and predictive analytics in real-time. Built by top internet companies to keep pace with the data deluge, NoSQL data base scales horizontally, and is designed to scale to hundreds of millions and even billions of users doing updates as well as reads.

Node.js

Node.js is an open-source, cross-platform JavaScript run-time environment that executes JavaScript code server-side. Historically, JavaScript was used primarily for client-side scripting, in which scripts written in JavaScript are embedded in a webpage's HTML and run client-side by a JavaScript engine in the user's web browser.

Express.js

Express.js, or simply Express, is a web application framework for Node.js, released as free and open-source software under the MIT License. It is designed for building web applications and APIs.It has been called the de facto standard server framework for Node.js.

Angular

Angular (commonly referred to as "Angular 2+" or "Angular v2 and above") is a TypeScript-based open-source front-end web application platform led by the Angular Team at Google and by a community of individuals and corporations. Angular is a complete rewrite from the same team that built AngularJS.

React

In computing, React (also known as React.js or ReactJS) is a JavaScript library for building user interfaces. It is maintained by Facebook and a community of individual developers and companies.React can be used as a base in the development of single-page or mobile applications. Complex React applications usually require the use of additional libraries for state management, routing, and interaction with an API.

Functionality

MongoDB queries are used to access list of required details from the Database.

Documents: 3510

Fields : 16

Node.js Query example. Documents are returned on the basis of city Name provided. All rest details will be returned by the following query.

      var mongojs = require('mongojs');
      var db = mongojs('pizza_res',['res']);
      db.doctor.find( {city:"Los Angeles"},
                        function(err,res){
                        console.log(res)
                        }
                      );

The Service APIs are called whenever an event is hit on the User Interface. Express APIs are written in nodejs with callback functions to avoid any blocking, and allows other code to be run in the meantime. Express APIs are routing and middle ware web framework.

var express = require('express');
var cors = require('cors');
var app = express();
var bodyParser = require('body-parser');
app.use(bodyParser.json());
app.use(cors());
var mongojs = require('mongojs');
var db = mongojs('pizza_res',['res']);
app.use(express.static(__dirname));
//service call for list users

//Fetch restaurant details by city
app.get('/search/byCity/:city',function(req,res){
	db.res.find({city:new RegExp('^'+req.params.city,'i')},function(err,docs){
		res.json(docs);
	});
});

//Fetch restaurant details by restaurant
app.get('/search/byRestaurant/:restaurant',function(req,res){
	db.res.find({name:new RegExp('^'+req.params.restaurant,'i')},function(err,docs){
		res.json(docs);
	});
});

//Fetch restaurant details by pizza
app.get('/search/byPizza/:pizza',function(req,res){
	db.res.find({"menus.name":new RegExp('^'+req.params.pizza,'i')},function(err,docs){
		res.json(docs);
	});
});

app.listen(3000);
console.log("server Running on port 3000");

Help