GithubHelp home page GithubHelp logo

ct83 / surway Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 2.0 22.47 MB

SurWay is a survey/polling website for cab drivers where they can report their typical work hours and which company they work for, this data is then stored anonymously and used to generate charts and insights.

Home Page: https://sur-way.herokuapp.com

JavaScript 92.72% HTML 5.22% CSS 2.05%
react reactjs reactjs-demo node nodejs express nodeexpress docker docker-compose react-project

surway's Introduction

View Live Version! - sur-way.herokuapp.com

SurWay is a survey/polling website for cab drivers where they can report their typical work hours and which company they work for, this data is then stored anonymously and used to generate charts and insights.

Setup

  1. Database - MongoDB - Docker Compose
    • docker-compose up --build
  2. Backend - NodeJS Express
    • npm install
    • node server.js
  3. Frontend - React
    • cd react/sur-way-app && npm install
    • npm start


Below is an excerpt from the Blog I wrote about the Making of SurWay, you can find the original post here

SurWay

I completed work on my first React App a few days ago, the App is called SurWay.

This is a survey website for cab drivers where they can report their typical work hours and which company they work for, this data is then stored anonymously and used to generate charts and insights.

This took way longer than expected to complete. The general idea was to add several features like browser finger printing and SSO to ensure that a single user could be allowed to cast a vote only once. But, I decided to postpone these features for a future release.

I had been trying to make up time to learn JavaScript, specifically Node and React for the better part of the last year. I have gone through several learn in 4-hour courses and a million tutorials but, as always actually making a project with JS was something which helped me learn things even better. I even wrote about it here in - The 'I think I have got the hang of it' Moment - React

This is a general overview of how I went about building it, with some useful resources and some screenshots.

Step 1 - Set up Node and React

I used create-react-app and some other starter templates to create a boilerplate, then I used Docker and Docker-Compose to quickly spin up a local MongoDB instance for me to work on.

Step 2 - Node, React, Mongo - Making them all talk to each other.

I first got a basic submit form working

screencapture-localhost-3000-2019-10-05-19_02_13

Then I created the DB Schema in Node, added the required routes in Express, tested them with PostMan, I configured the frontend with React to ensure forms were submitted successfully.

postman

screencapture-localhost-3000-2019-10-06-10_26_48

If you want an in-depth tutorial about how I went about doing that follow this - Let’s build a full stack MongoDB, React, Node and Express (MERN) app

Step 3 - Displaying the into Charts.

screencapture-localhost-3001-thanks-2019-10-12-22_42_57

After digging around for a way to implement charts in React I stumbled across react-chartjs-2. I retrieved the data from my MongoDB using Express and Node and displayed the charts in React.

Step 4 - Making it pretty!

I decided to use material-ui to make designing things easier. After digging around for a color pallet I found this right under my nose.

My App now started to look like this.

Form Page

home

_Results Page

report

Bonus!

I built this app on one of my trips out of the city.

Here’s a special learning-coding-in-car-gif for you!

car-code

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.