/yelpcamp

Primary LanguageJavaScript

YelpCamp

This is an execution of the YelpCamp project, which is the final project of the Udemy course The Web Developer Bootcamp 2021 by Colt Steele. All credits for this project go to this course.

During this project have multiple technologies been used, the main once will be discussed here. Yelpcamp is build with Node.js accompanied by Express as its web framework. It makes use of MongoDB to store all data and sessions. The only exception are images, which are stored with Cloudinary. Passport is used to manage user credentials, Helmet is implemented for security purposes and Mapbox is used to visualize interactive maps.

Setup

  1. Create a Cloudinary account, MongoDB database and Mapbox account.
  2. Add details of these accounts to an .env file (see the Settings section).
  3. (Optionally) Seed the database
node seeds/index.js
  1. Start the application
node app.js

Settings

This is the list with environment variables that can be added to a .env file to make the application fully functional.

  • CLOUDINARY_CLOUD_NAME # Name of your Cloudinary cloud.
  • CLOUDINARY_KEY # API key of your Cloudinary cloud.
  • CLOUDINARY_SECRET # Secret of your Cloudinary cloud.
  • MAPBOX_TOKEN # Access token to Mapbox tools.
  • DB_URL # Link to your MongoDB database.
  • SECRET # Secret for the Mongo Store and session configuration.
  • PORT # Port to start the application on.

File Structure

 cloudinary
     ├── ...                # Cloudinary configuration
 controllers
     ├── ...                # Control all route actions
 models
     ├── ...                # Database models
 public
     ├── ...                # Served css and js files
 routes
     ├── ...                # Map all routes
 seeds
     ├── ...                # Initial db seed
 utils
     ├── ...                # Error handling
 views
     ├── campgrounds\
             ├── ...        # Campground markups
     ├── layouts\
             ├── ...        # Boilerplate markup
     ├── partials\
             ├── ...        # Partial markups
     ├── users\
             ├── ...        # User markups
     ...                    # Additional markups
 .env                       # Hold environment variables
 app.js                     # Overall setup
 middleware.js              # All middleware
 schemas.js                 # Joi schemas
 ...