openbenches / openbenches.org

OpenBenches.org - an open data repository for memorial benches
https://openbenches.org/
MIT License
169 stars 26 forks source link
hacktoberfest hacktoberfest2023

OpenBenches

A bench in a park, birds fly up above. In the background is a tree.

https://OpenBenches.org/ - an open data repository for memorial benches.

Supporters

You can sponsor OpenBenches on GitHub.

We'd like to thank the following sponsors for their generosity:

Contributing

All contributions are welcome. Before making a pull request, please:

  1. Raise a new issue describing the problem and how you intend to fix it.
  2. Submit a Pull Request referencing the Issue.

Open Data API

You can get all the data, or partial data, from the API. Data is returned in geoJSON format and has the following structure:

{
    "type": "FeatureCollection",
    "features": [{
        "id": 1234657,
        "type": "Feature",
        "geometry": {
            "type": "Point",
            "coordinates": [0.1234, 5.678]
        },
        "properties": {
            "created_at": "2021-06-05T12:27:36+01:00",
            "popupContent": "IN LOVING MEMORY OF\nBOB AND\nJANE",
            "media": [{
                "URL": "\/image\/3f786850e387550fdab836ed7e6dc881de23001b",
                "mediaID": 123456789,
                "licence": "CC BY-SA 4.0",
                "media_type": "inscription",
                "sha1": "3f786850e387550fdab836ed7e6dc881de23001b",
                "user": 6143,
                "username": "edent",
                "userprovider": "twitter",
                "width": 4096,
                "height": 3072
            }, {
                "URL": "\/image\/89e6c98d92887913cadf06b2adb97f26cde4849b",
                "mediaID": 43803,
                "licence": "CC BY-SA 4.0",
                "media_type": "bench",
                "sha1": "89e6c98d92887913cadf06b2adb97f26cde4849b",
                "user": 123456780,
                "username": "edent",
                "userprovider": "twitter",
                "width": 4096,
                "height": 3072
            }]
        }
    }]
}

Benches

Inscriptions

Media

Latest

Tags

Running Locally

This is a Symfony PHP and MySQL website. No need for node, complicated deploys, or spinning up containerised virtual machines in the cloud.

Requirements

For more, see CONTRIBUTING.md

Database Structure

In the /database/ folder you'll find a sample database. All text fields are utf8mb4_unicode_ci because we live in the future now.

Hopefully, the tables are self explanatory:

Benches

Users

Originally we were going to force people to sign in with Twitter / Facebook / GitHub. But that discourages use - so users are now pseudo-anonymous. Hence this weird structure!

Media

We store the original image - smaller images are rendered dynamically.

Media storage can be complicated. Storing thousands of images in a single directory can cause problems on some systems. To get around this, we calculate the SHA1 hash of each image. The image is stored in a subdirectory based on the hash. For example, if the hash is 1A2B3C, the file will be stored in /photos/1/A/1A2B3C.jpg

Media Types

At the moment, we only accept photos - of the inscription, the bench, the view from the bench, a panorama, and a VR photosphere.

Licences

Tagging

Benches can be given multiple "tags". For example "cat" if the bench commemorates a feline, or "beach" if the bench is at the seaside.

Tagging uses the Toxi structure.

Tags are hard-coded in the database and can't be added or edited by regular users.

Open Source Licenses

Everything we do builds on someone else's hard work.

And thanks to the many contributors who have improved this codebase.