GithubHelp home page GithubHelp logo

practice5610 / fullstack_geolocation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from masonchinkin/myphotojourney

0.0 0.0 0.0 63.5 MB

mern stack full stack with geolocation for photo saving

Home Page: https://myphotojourney.herokuapp.com/#/

JavaScript 82.26% CSS 16.57% HTML 1.17%

fullstack_geolocation's Introduction

MyPhotoJourney

Live Demo

Hello! Thanks for checking out our MERN stack project.

MyPhotoJourney is a MERN full stack app that lets you upload photos from a trip, visualize them on a map, and share it for all to see!

Index

The Team

Mason Chinkin, a.k.a. "The visualizer"

  • d3.js map, mongoose.js backend, express.js map api

Nick Howlett, a.k.a. "The authorizer"

  • Photo Metadata, End to end user auth, profile page, Heroku

Louis Leon, a.k.a. "The validator"

  • Photo uploading/validation, gps api

Drew Engelstein, a.k.a. "The uploader"

  • AWS, photo uploading, upload forms

Technologies

  • MERN stack: MongoDB, Express.js, React/Redux, Node.js
  • d3.js for mapping the journey
  • AWS with multer.js for uploading and storing users' photos
  • node-geocoder.js + OpenStreetMap to fetch gps locations based on user input
  • End to end user auth with BCrypt and passport
  • mongoose.js backend schema

Highlights

Storing uploaded photos on AWS

Storing uploaded photos on AWS was the biggest challenge faced by the team. Louis and Drew worked for over two days with multer.js to build a bug free, reliable backend framework to validate and upload photos to AWS before saving the photo URL to our MongoDB database.

Below is a code snippet of our backend route that first uploads the image to AWS, validates the user inputs, and then fetches the geo-location for the provided city and country before saving the photo to our DB:

router.post("/", upload.single("image"), passport.authenticate("jwt", { session: false }),
  async (req, res) => {
  ...
  ...
  const { errors, isValid } = await validatePhotoInput(photo);
  ...
  ...
  let options = { city: photo.city, country: photo.country };
  let data = await geocoder.geocode(options);

  if (data.length === 0) {
    errors.location = "Enter a valid city/country location";
    return res.status(400).json(errors);
  }

Making a journey

After photos are validated, uploaded to AWS, and saved to MongoDB with their associated journey, the user is taken to the journey page, where we used params to fetch those photo URLs for the journey.

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.