Giter Club home page Giter Club logo

qrpyora's Introduction

image

QR-pyörä Build Deploy

QR-pyörä is a Finnish nationwide street art piece, that has large QR-code signs on sides of a bicycle. Scanning a QR-code takes a passer-by to a photo submission page, and after that it is up to them to figure out what to do. Read more about the project on its website (in Finnish) (qrpyora.fi)

This repository contains source code for QR-pyörä's background services and user interface.


Getting Started

$ git clone https://github.com/Testausserveri/qrpyora

Configuration

Copy .example.env to .env, and fill in the details. You'll mostly need just MySQL/MariaDB database credentials. The NOMINATIM_URL isn't really necessary for development, although some API methods such as adding location won't work without it.

Running Development Environment

This project is based mainly on three components:

  • back-end (backend/)
  • public front-end (frontend/public/)
  • admin front-end (frontend/admin/)

You must have backend running, but it is optional to have front-end running.

For instance, to develop front-end website, you'll want to have back-end and public front-end running simultaneously:

$ cd frontend/public/
$ npm install
$ npm start
$ cd backend/
$ npm install
$ npm start

Running in Docker

Copy .env and docker-compose.yml to your machine (no need to copy source code), and configure .env accordingly. In the docker-compose.yml, you may also want to change the frontend's exposed port (default 8080), in case you are running multiple services on your machine.

Run the following to bring the services up:

$ docker-compose up

qrpyora's People

Contributors

ahnl avatar developerfromjokela avatar esinko avatar imgbotapp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

raikasdev vantaa3

qrpyora's Issues

Map attributions

Move the Leaflet/map tile attributions into the footer, instead of displaying them in the corner of the map.

Update FAQ page

  • Add media coverage, we have at least an article in the Etelä-Saimaa.
  • Update the content. We just copied all of it from the old site, and the info isn't necessarily so relevant/up-to-date anymore.
  • Add GitHub-link somewhere.

Server-side 404 status codes

CRA SPA solution has caused that not found pages return status code 200. Not good for SEO.

We are serving the SPA app from Apache HTTP server. To fix this, we need to tell the server what routes are valid. We can't tell Apache to validate if the bikeId is correct (for example in the route /bikes/:bikeId), but I think it's going to be just fine.

We can consider something like this (stolen from https://thegray.company/blog/single-page-application-spas-404s-seo):

ErrorDocument 404 "404ohno"
RewriteEngine On
RewriteBase /

# ignore actual files and directories
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# whitelist / and /valid-page1
RewriteCond %{REQUEST_URI} !^/$
RewriteCond %{REQUEST_URI} !^/valid-page1$

# all other URLs will receive 404
RewriteRule ^ - [R=404,L]

# our whitelist URLs will get to this line;
# return our SPA code, but ignore static files
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]

Maybe this is why we shouldn't use CRA for any real projects, lol. Additionally we could also add a sitemap for the search engines, but it doesn't fix this issue.

feat: Add a combined list of all photos

Add a combined list of photos from all bikes to the /gallery route, under the bike list.

  • Backend API route to return all photos
  • Frontend implementation
    • Modify the PhotoGrid so that it can be passed a bike name and ID to it, so the user knows from what bike the photo was added. The bike name will be displayed in the corner of a photo, and it will also function as a link to the bike page.

The backend response should be something like the following:

[
    {
        "bikeId": 1,
        "bikeName": "Lappeenranta",
        "fileName": "uuid.jpg"
    },
    ...
]

GET /api/bikes returns old location

It seems like on the front page, it shows only the oldest location in the map instead of the newest. This location data comes from the back-end and it should return only the newest for each bike, but it's the wrong way around at the moment.

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.