Skip to content

Latest commit

 

History

History
131 lines (96 loc) · 2.65 KB

README.md

File metadata and controls

131 lines (96 loc) · 2.65 KB

PostCamp

A web application where user can post, edit, delete item and comment and other user can comment on the item.

image

Technologies

  • Node.JS
  • Express.JS
  • Bootstrap
  • Passport
  • Heroku

Installation

  1. Clone the project to your local directory
git clone https://github.com/bellom/postApp
  1. Run sudo apt install nodejs

  2. Run sudo apt install npm -g

  3. Run cd postApp

  4. Run npm install

  5. Run npm start

PostApp Features

##Initial Setup

  • Add Landing Page
  • Add Item Page that lists all items

Each Item has:

  • Name
  • Image

##Layout and Basic Styling

  • Create our header and footer partials
  • Add in Bootstrap

##Creating New Item

  • Setup new item POST route
  • Add in body-parser
  • Setup route to show form
  • Add basic unstyled form

##Style the item page

  • Add a better header/title
  • Make items display in a grid

##Style the Navbar and Form

  • Add a navbar to all templates
  • Style the new item form

##Add Mongoose

  • Install and configure Mongoose
  • Setup item model
  • Use item model inside of our routes

##Show Page

  • Review the RESTful routes we've seen so far
  • Add description to our campground model
  • Show db.collection.drop()
  • Add a show route/template

##Refactor Mongoose Code

  • Create a models directory
  • Use module.exports
  • Require everything correctly!

##Add Seeds File

  • Add a seeds.js file
  • Run the seeds file every time the server starts

##Add the Comment model!

  • Make our errors go away!
  • Display comments on campground show page

##Comment New/Create

  • Discuss nested routes
  • Add the comment new and create routes
  • Add the new comment form

##Style Show Page

  • Add sidebar to show page
  • Display comments nicely

##Finish Styling Show Page

  • Add public directory
  • Add custom stylesheet

##Auth Pt. 1 - Add User Model

  • Install all packages needed for auth
  • Define User model

##Auth Pt. 2 - Register

  • Configure Passport
  • Add register routes
  • Add register template

##Auth Pt. 3 - Login

  • Add login routes
  • Add login template

##Auth Pt. 4 - Logout/Navbar

  • Add logout route
  • Prevent user from adding a comment if not signed in
  • Add links to navbar

##Auth Pt. 5 - Show/Hide Links

  • Show/hide auth links in navbar

##Refactor The Routes

  • Use Express router to reoragnize all routes

##Users + Comments

  • Associate users and comments
  • Save author's name to a comment automatically

##Users

  • Prevent an unauthenticated user from creating a campground
  • Save username+id to newly created campground

Contributor