GithubHelp home page GithubHelp logo

courtneytk / restaurant-ordering-system-comp2406 Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 23 KB

Uses a database to store user profile and order information. Includes sessions/authentication so that users may log in, place orders, and view a history of their orders.

JavaScript 82.87% CSS 1.34% Pug 15.79%

restaurant-ordering-system-comp2406's Introduction

Purpose:

Created a webpage which allows users to login, see users, make restaurant orders, see their order history, as well as see the order histories of other users and purchase meals at various restaurants. To accomplish this, this application uses a database to store user profile and order information. Additionally, there exists session support to the application so that users can log in, place orders, and view a history of their orders. Users can set their profile to private or public, which will also impact who can view their order history.

Languages & Concepts:

Javascript DOM hierarchy, Node.js, Mongoose, MongoDB, PUG, HTML, Express, Sessions, Server-client interaction and seperation.

Design Choices:

In terms of functionality, I made sure to seperate (as much as possible) computations from display/layout and made sure to use modularity by making functions that generally accomplish one key task (eg. displaying user options, logging in, etc).

Additionally, I included a router sepcific to /users and /orders related requests to streamline my computations in one place and make my program more understandable.

Finally, I chose to use Mongoose rather than solely implement Mongo because of the access to Schema's which greatly organize and simplify the program itself. Also, I personally found it easier to search,update and manipulate collections using Mongoose and since those are common operations in this program, I believed Mongoose would be the best option.

Checking Requirements in the Mongo Shell:

If you check whether everything is being stored in the database, please note that for an unknown reason (for now), the session data may end up in the "test" database under the "sessions" collection rather than your "a4" (or whatever database you will use) database under "sessions". If the sessions data does come under the right folder in your database, then you can disregard this note.

Webpage Layout:

Using some flex CSS components, I made my page clean and easy to navigate. Additionally, I included percentages for width's of divs and other containers within the webpage to ensure that the layout will stay constant no matter where the webpage is opened on. Overall I opted for a clean webpage that performs all the functions required in this program without added hassle.

Do note that for the order form page, when you add items to the order, the order summary on the right hand side may drop down to the bottom of the page but has not disappeared. You can still submit the order successfully.

Notes to Launch and Run:

Launch:

  1. In your IDE terminal enter the following to install the dependencies needed: npm install

  2. Make sure to have mongoDB installed, and open a command prompt/terminal on your computer and enter the following to establish the mongo daemon: mongod --dbpath="NameOfYourDirectoryForMongoDatabase"

    i. To note: Make sure you have a folder designated for the database within the directory where all the files of this program are

To run the program:

Proceed to run "node database-initializer.js" to initialize all the databased information. Note that my initializer is modified because I wanted to make use of Mongoose. You will also notice I intialized a schema within this file as well.

Finally, write "node server.js" within your IDE terminal to run the server.

Then either click the link that appears when the server is running or type "http://localhost:3001" into your browser (ideally Google Chrome).

restaurant-ordering-system-comp2406's People

Contributors

courtneytk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.