Coder Social home page Coder Social logo

lab-coffee-and-books's Introduction

Express | Coffee & Books

Learning Outcomes

This exercise will help you to:

  • Practice Google Maps API integration with an app
  • Add location properties in your models as GeoJSON
  • Display content from the Database in a map

cofee-book pic

Introduction

Books and coffee are two very compatible things. If you think about it, a nice cup of a hot beverage and a book are two amazing things to have together.

In this exercise, let's create an app to save both bookstores and coffee places and display them. You could even use Google Maps to display a path from one place to the other.

:::success :bulb: Hint: To accomplish this new challenge, feel free to follow the Google Maps & Express Learning Unit from the classroom :::

An up a running project

Remember you need to create a new project using express-generator. Before starting, follow the next configuration guide:

  1. Install your project and dependencies
  2. Edit your app.js file to connect to Mongoose. Set the name of your DDBB here.
  3. Create the models folder to put your models and delete routes and folders related with users (you won't be implementing users just yet).

Initial code: Coffee & Books CRUD

Begin by creating a simple CRUD. In this opportunity, you should have two different kind of places. Create a place.js file and add an attribute to set the kind of establishment.

  1. Create the model.
  2. Create routes to show the listed elements.
  3. Edit the index.js and the app.js with the routes to your model.
  4. Create the routes files and the views with the proper filesystem.
  • Add Location to Model
  • Add Location fields to form
  • Get Location & Save Places
  • Show Places in Map -figure out if you can set a difference among them
  • Get Google Maps API Key
  • Add Google Maps to index.ejs
  • The map
  • Add Markers to show places’ locations
  • The Show view

Summary

Now you know how to:

  • Add Google Maps to any application
  • Incorporate GeoJSON attributes in a Mongoose Schema
  • Display elements in a map with information from your apps Database

Extra Resources

lab-coffee-and-books's People

Contributors

lluisarevalo avatar niko7o 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.