Coder Social home page Coder Social logo

hw-w05d04-express-structure's Introduction

HW W05D04 Express Structure

Today we are going to be thinking about our applications and their structure. To do so, we are going to scaffold an application where a user can make color palettes. We are going to create markdown files for each of our app's files and outline what each file does.

Application Flow / Moc

Here is the spec of the application. Take a close look at it and what each of the pages show. Each of the requests are marked with the route in black, the model middleware in red and the controller middleware in blue. app spec

ASSIGNMENT

Go through every page and take detailed notes about what should be in each file. There are some examples in:

Take careful note on how we relate the palettes to the colors.

Make sure to go through every page!

Submission

Submit the homework by midnight tonight.


Below this line is other useful information about express applications. Feel free to add any general info you want.

File Tree

.
├── controllers
│   ├── colorsController.js
│   └── palettesController.js
├── db
│   ├── config.js
│   └── seeds.sql
├── index.js
├── models
│   ├── color.js
│   └── palette.js
├── node_modules
├── package-lock.json
├── package.json
├── public
│   └── styles
│       └── style.css
└── views
    ├── colors
    │   ├── edit.html
    │   ├── new.html
    │   └── show.html
    ├── index.html
    └── palettes
        ├── edit.html
        ├── index.html
        ├── new.html
        └── show.html

Set up

Steps we need to set up our application:

  • Initiate npm in our application directory
npm init
  • Install the packages we need for our application:
    • express (the base of our server, to set up routes)
    • mustache-express (to render views with data from our server)
    • body-parser (so we can get data from forms)
    • pg-promise (to make queries to our database)
    • method-override (so we can use PUT and DELETE requests)
    • morgan (to log our requests)
npm install --save express mustache-express body-parser pg-promise method-override morgan

hw-w05d04-express-structure's People

Contributors

jackiecasper avatar nawafi avatar

Watchers

James Cloos 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.