Git Product home page Git Product logo

87danielbradley / ecoroute Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 22.24 MB

Eco Route is a social media app centered around creating events with friends and chatting with attendees in each event. Event venues may be optimized based on attendees' travel time or one may select their desired location.

Home Page: https://ecopool.herokuapp.com/

JavaScript 89.26% HTML 1.54% CSS 9.21%
mongodb expess react redux nodejs mapboxgl

ecoroute's Introduction

Background and Overview

Built with the MERN stack, EcoRoute addresses the age-old question of, “Where should we meet?” while also providing a tool to help people plan out a busy day of errands.

Functionality and MVP

Optimizes a list of address inputs by distance/time. Users will be able to create events where invitees can accept or decline the invitation. By providing a general meeting place, EcoRoute will be able to recommend the most equidistant location to the users attending.

Key Features

The Map feature at the sign up page allows users to enter their home address where they will likely be doing most of their travels from. This feature utilizes the MapBox API functionality and is showcased below:

home.address.mp4

The CRUD functionality for events allows users to create new events, which are then displayed on the homepage, update and delete events as needed.Users can optionally add attendees from their friends list to the event. This is showcased below:

event.CRUD.mp4

Technologies and Technical Challenges

  • React/Redux
  • Node
  • Bcrypt for salting and hashing passwords
  • MongoDB
  • Express
  • Mongoose to connect and interact with MongoDB
  • Axios
  • MapBox API

Code Snippets

Sample Frontend

renderMap(){
    const { lng, lat, zoom } = this.state;
    const map = new mapboxgl.Map({
        container: this.mapContainerLogin.current,
        style: 'mapbox://styles/mapbox/dark-v10',
        center: [lng, lat],
        zoom: zoom,
        bearing: 0
    });
    const geocoder = new MapboxGeocoder({
            accessToken: mapboxgl.accessToken,
            flyTo:{
                bearing: (Math.random() < 0.5 ? -1 : 1)*Math.floor(Math.random() * 20),
                speed: 2,
                curve: 0.75,
                pitch: 60,
                essential: true
                
            },
            mapboxgl: mapboxgl,
            className: "geocoder"
        })
        const geolocator= new mapboxgl.GeolocateControl({
            positionOptions: {
                enableHighAccuracy: false
            },
            trackUserLocation: true,
            className: "geolocator"
        })
    map.addControl(
        geocoder, 'top-left'
        )
    map.addControl(
        geolocator
    )
    let that = this;
    geocoder.on('result', function(e) {

        that.props.setParentState({location: e.result.geometry.coordinates})
   
    })
    geolocator.on('geolocate', function(e){

        that.props.setParentState({location: [e.coords.latitude, e.coords.longitude]}
    })
   
}

Sample Backend


router.post('/', 
    passport.authenticate('jwt', { session: false }),
    (req, res) => {
        const { errors, isValid } = validateEventInput(req.body);
        if (!isValid) {
            return res.status(400).json(errors)
        }
        
        const newEvent = new Event({
            user: req.user.id,
            title: req.body.title,
            category: req.body.category,
            date: req.body.date,
            attendees: req.body.attendees,
            hidden: req.body.hidden
        });

        newEvent.save().then(event => res.json(event));
    }
)

router.get('/user/:user_id', (req, res) => {
    
    Event.find({user: req.params.user_id})
        .sort({ date: -1 })
        .then( events => res.json(events))
        .catch( err => {
            res.status(404).json({ eventsnotfound: 'This user has not created an event'})
        })

});

Group Members and Work Breakdown

  • Sydney Parsons - Backend/Flex
  • Daniel Bradley - Backend/Flex
  • Tyler Koh - Frontend/Flex
  • Mickey Addai - Frontend/Flex

ecoroute's People

Contributors

87danielbradley avatar mickeysaddai avatar sparsons808 avatar tkoh13 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

ecoroute's Issues

Project Proposal Feedback

Background and Overview

  • Make it a separate wiki page
  • Needs more substance. What are the issues that come with the question "Where should we meet up?" In what way does your app address these issues?

Functionality and MVPs

  • Looks good!

Technologies and Technical Challenges

  • Needs more detail/more info on what each technology is for (e.g. frontend/backend? which aspect of frontend/backend?)

Group Members and Work Breakdown

  • Looks great!
  • No panicking allowed though

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.