A platform to share and discuss camping grounds. All information uploaded and shared by user accounts.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
middleware
models
public
routes
views
.gitignore
README.md
app.js
cats.js
package-lock.json
package.json
seeds.js

README.md

Campground Reviews

A platform to share and discuss camping grounds. All information uploaded and shared by user accounts. Preview coming soon...

Technologies Utilized


Install and Use

Clone repo


git clone https://github.com/JacobWylie/yelpcamp.git

Install modules and run app


npm install
npm start

Routes are setup to be used as sub-directory of my porfolio and will be prepended with /camp/

Site can be accessed from localhost:3000/camp or remove /camp/ route

Remove "/camp" from routes in app.js

app.use('/camp', indexRoutes);
app.use('/camp/campgrounds/:id/comments', commentRoutes);
app.use('/camp/campgrounds', campgroundRoutes);

Remove "/camp" from redirect routes

res.redirect(`/camp/campgrounds/${newlyCreated._id}`);

Remove /camp/ prefix from view files. Routes and Links

<form class="search-form" action="/camp/campgrounds" method="GET">
<a href="/camp/campgrounds/<%= campground._id %>"

Set your server's process.env variables

OSX / Unix Terminal

Set the database URL that your app will connect to. The app will connect to a public database if you do not specify your own


$ export DATABASEURL="your-databaseURL"

Name your database to notify you in the console when app is running


$ export DATABASENAME="your-database-name"

Set your preferred port number. The Default port is set to 3000


$ export PORT="whichever-port-number-you-like"

Set the admin password for a user to sign up with admin priviledges


$ export ADMINCODE="your-secret-code"

Windows

Set the database URL that your app will connect to. The app will connect to a public database if you do not specify your own


$ SET DATABASEURL="your-databaseURL"

Name your database to notify you in the console when app is running


$ SET DATABASENAME="your-database-name"

Set your preferred port number. The Default port is set to 3000


$ SET PORT="whichever-port-number-you-like"

Set the admin password for a user to sign up with admin priviledges


$ SET ADMINCODE="your-secret-code"

Initial Setup

  • Add Landing Page
  • Add Campgrounds Page that lists all campgrounds
  • Each Campground has:
    1. Name
    2. Image

Layout and Basic Styling

  • Create our header and footer partials
  • Add in Bootstrap
  • Creating New Campgrounds

  • Setup new campground POST route
  • Add in body-parser
  • Setup route to show form
  • Add basic unstyled form
  • Style the campgrounds page

  • Add a better header/title
  • Make campgrounds display in a grid
  • Style the Navbar and Form

  • Add a navbar to all templates
  • Style the new campground form
  • Add Mongoose

  • Install and configure Mongoose
  • Setup campground model
  • Use campground 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 + Campgrounds

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

  • Add Method-Override
  • Add Edit Route for Campgrounds
  • Add Link to Edit Page
  • Add Update Route
  • Deleting Campgrounds

  • Add Destroy Route
  • Add Delete button
  • Authorization Part 1: Campgrounds

  • User can only edit his/her campgrounds
  • User can only delete his/her campgrounds
  • Hide/Show edit and delete buttons
  • Editing Comments

  • Add Edit route for comments
  • Add Edit button
  • Add Update route
  • Deleting Comments

  • Add Destroy route
  • Add Delete button
  • Authorization Part 2: Comments

  • User can only edit his/her comments
  • User can only delete his/her comments
  • Hide/Show edit and delete buttons
  • Refactor Middleware
  • Adding in Flash!

  • Demo working version
  • Install and configure connect-flash
  • Add bootstrap alerts to header
  • RESTFUL ROUTES

    name | url | verb | desc.

    INDEX | /dogs | GET | Display a list of all dogs
    NEW | /dogs/new | GET | Displays form to make a new dog
    CREATE | /dogs | POST | Add new dog to DB
    SHOW | /dogs/:id | GET | Shows info about one dog


    INDEX | /campgrounds
    NEW | /campgrounds/new
    CREATE | /campgrounds
    SHOW | /campgrounds/:id
    NEW | campgrounds/:id/comments/new
    CREATE campgrounds/:id/comments