Giter Site home page Giter Site logo

restaurant-reservation-turma-e's Introduction

Restaurant Reservations

This is a Node.js and Express website that accepts and lists restaurant reservations.

The backend contains intentional mistakes, like weak validation on email addresses. Inconsistencies in coding style are also intentional.

Getting Started

npm install
npm start

The server runs on port 3000.

There are three routes:

The server persists using a SQLite3 database named database.sqlite in the site root.

Development

Debugging

This project uses https://www.npmjs.com/package/debug for development logging. To start nodemon and enable logging:

npm run debug

FAQ

  • Q: Why didn't you store the time submitted?
    • A: I wanted to reduce the number of fields and simplify testing.
  • Q: Wouldn't it be easier if the form submitted a datetime string instead of building and parsing one?
    • A: Yes, it would, but the form logic is simpler. Either way, someone has to do the work.
  • Q: Why did you mix a callback and a Promise in lib/reservations.js?
    • A: Joi doesn't support Promises, but it does support callbacks. I wanted to show how to test both kinds of asynchronous code.
  • Q: How'd you handle cross-platform support?
    • A: Avoided relative directories, used cross-env to transform environmental variables.

Credits

This is an adaptation of a WordPress site hosted at http://587672.youcanlearnit.net/

The conversion:

  • Archive original with wget
  • Strip out unrelated functionality
  • Reorganize JavaScript and Stylesheets into logical directories
  • Converted HTML into Jade / Pug templates using http://html2jade.org/

The front end should be mostly unchanged from the original.

restaurant-reservation-turma-e's People

Contributors

henriquemt13 avatar pedrolacerda 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.