Git Product home page Git Product logo

live-school-map-using-js-react-leaflet-postgis's Introduction

LiveBy School Map

Getting Started

First, install the node modules necessary to run the app

npm install

Now, run the development server:

npm run dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the result.

Repository

This repository contains a template for setting up a map with a sidebar next to it.

The entry file for this project is pages/index.js. This file will render 2 other components. There is one component for rendering a leaflet map, and one for making an unordered list. The map component can be found in components/map.js. The sidebar can be found in components/schools.js.

This repository is also setup for a next.js API endpoint. That API endpoint exists in pages/api/schools.js. It currently expects to be sent a POST request with JSON data in the body.

Objectives

For LiveBy, this project is not about making sure you can do everything. This is for us to gauge where your skills best shine.

While I have screenshots to help you understand what we envision this project to be, focus on what you can do best. We want to make the best products we can, not just the products we are shown to make.

That being said, we are expecting some basic skills shown. We will be watching to make sure you DO:

  • keep your code organized and readable
  • write commit messages that describe what the commit changes

Some things we want to make sure you DO NOT DO:

  • commit login/API key information
  • expose security vulerabilities in SQL

First, make a branch from the main branch to work on. When you are at a point where you would like to stop, push that branch to origin, and create a pull request against the main branch. Please specify what you were able to accomplish, and what is still required to finish in the body of your pull request.

In this project we would like to add schools from a database to the map, and to the sidebar.

The sidebar will contain the name and address of the school. The map will have a marker for each school.

When the school is clicked on the map or on the sidebar, a popup should appear with the schools name and address. There should also be an area showing the name and address of the school that was clicked above the sidebar.

As the map is moved, the app should update the schools on the map and in the sidebar based on the map's current viewport.

The schools exist in a postgres table named public.schools. It has columns for the school's id, name, address, and coordinates. Please refer to the email from Joel for information on how to connect to this postgres server.

Column Type
ID character varying(12)
SchoolName character varying(80)
AddressStreet character varying(30)
AddressCity character varying(30)
AddressState character varying(2)
AddressZip character varying(5)
geom geometry(Point)

Resources

Here are links to documentation and resources that should help you build this.

React

Next.js

Leaflet

React Leaflet

Postgres

PostGIS

node-postgres

Examples

Here are some screenshots of the finished project

Initial Load

Initial Load

Popup Example

Popup

Changed Viewport view

Changed Viewport

Changed Viewport while a Popup is open

Changed Viewport and Popup Open

live-school-map-using-js-react-leaflet-postgis's People

Contributors

ims-studio 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.