GithubHelp home page GithubHelp logo

jorishr / catacamp Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 35.11 MB

Fullstack web app for listing campgrounds in Catalonia. Built with NodeJs, ExpressJs, NodeJS, MongoDb and Bootstrap 4.

JavaScript 4.81% CSS 90.90% SCSS 0.79% EJS 3.49% Dockerfile 0.01%

catacamp's Introduction

Catacamp

Live site

Catacamp

Description

Fullstack web app for listing campgrounds in Catalonia. Built with NodeJs, ExpressJs, NodeJS, MongoDb and Bootstrap 4.

App structure and main functionality

  • Data models: users, campgrounds and comments with user data association
  • Create, show, update, cascade delete (incl. associated data)
  • View:
    • landing page with search box
    • campground profile page with comment section
    • user profile page with access to user submitted campgrounds
    • if user does not add image, a placeholder image is used
    • view engine: Embedded JS
    • custom error page with status code and end-user friendly message
    • flash messages for user feedback (Connect-flash)
  • Authentication
    • sessions with PassportJS
    • session storage with Redis
    • password reset with email confirmation (mail server via Mailgun API)
    • various middleware functions to restrict access to certain routes
  • Other features
    • Google maps API integration for campground locations
    • IP restriction middleware (disabled by default)
    • Error handling middleware
    • Logging (Winston)
  • UI features (CSS/JS):
    • css grid layout,
    • card design,
    • jumbotron,
    • generic dark/light gradient,
    • image zoom effect,
    • image blend animation on landing page (keyframes),
    • social share button with with copy url to clipboard and tooltip,
    • toggle password visibility in forms,
    • all form submit buttons are disabled unless all required form fields have a value

Developer notes

Development Environment

Clone the repo and run npm install to install all dependencies. See Dockerfile and docker-compose.dev.yaml for dev environment setup. Overview: NodeJS v12.16.1, MongoDB v5, Redis v6.

The app runs with a new local database. When empty and in development mode, the app will seed the database with some sample data.

Two users are created by default:

  • Username: admin password: !Admin123
  • Username: camper password: !Camper123 The admin user can delete all campgrounds and comments.

NOTE: To have access to all functionality you need API keys for the mail server (Mailgun), maps (Google Maps). The docker-compose file does already set some environment variables for Session secret, Redis and MongoDB connection details but to create and edit campgrounds you need API keys.

GULP task runner for:

  • SASS compilation
  • Nodemon + BrowserSync
  • build task: includes Webpack for js bundling, minification, image optimization

Get started:

  • Clone the repo.
  • Run docker compose -f docker-compose.dev.yaml up --build

This wil run the app in development mode on port 3000. BrowserSync on port 4000. See NPM scripts and Gulpfile for more details.

Build and production environment

Use npm build to build the production code in the dist/ folder.

In production mode the app is configured to connect to a hosted MongoDB database and a hosted Redis server.

With access to the correct .env file you can run a production version of the app on a local machine with npm prod.

Deployment

Bash script available to deploy the app to a remote server. See deploy.sh for details.

catacamp's People

Contributors

jorishr avatar dependabot[bot] 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.