Coder Social home page Coder Social logo

commonknowledge / crimes-of-solidarity Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 0.0 1.54 MB

A new database website documenting crimes of solidarity and humanitarianism

Home Page: https://www.crimesofsolidarity.org/

License: GNU General Public License v3.0

JavaScript 2.75% TypeScript 94.91% CSS 2.34%
nextjs react typescript

crimes-of-solidarity's Introduction

This is a new database website documenting crimes of solidarity and humanitarianism. This is a project led by Dr. Lucy Mayblin at the University of Sheffield, UK.

Around the world, a growing number of people are subjected to criminal measures for helping irregular migrants, including those who are seeking asylum. Acts as simple as leaving water in the desert, saving someone from drowning in the sea, giving someone a lift to a medical facility, or a bed for the night, lead those offering such assistance open to arrest and imprisonment. While activists keep records of arrests in different countries, and there has been a lot of research in Europe on the criminalisation of solidarity activities, we currently have little understanding of this as a global phenomenon. The Crimes of Solidarity and Humanitarianism database aims to build understanding of criminalisation across borders for research and resistance.

Do you have any information to share with us that we can add to the archive? Get in touch!

Technical documentation

Check out this early stage, highly WIP documentation for the overall system. Later we will transpose that content to this README file.

Getting started: run it on your machine

First, download the code from github (e.g. git clone).

You will need to copy .env.template to .env.local and fill out the required env variables.

To run the system locally, on your machine you will need:

  • node (recommend installing and managing this via nvm)
  • ideally also yarn, because we pin specific versions of package dependencies using yarn (see ./yarn.lock)

Install the required package dependencies:

yarn
# or
npm install

Then you can run the development server:

yarn dev
# or
npm run dev

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

Development guide

This is a Next.js project bootstrapped with create-next-app. To learn more about Next.js, take a look at the following resources:

Pages

You can start editing the page by modifying pages/index.js. The page auto-updates as you edit the file.

API routes

API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.js.

The pages/api directory is mapped to /api/*. Files in this directory are treated as API routes instead of React pages.

Typescript interfaces and parsers

In development we've been generating schemas from typescript interfaces, to help smooth out API responses. When things aren't as expected, they don't show up.

To add to the schema, add interfaces to types.ts.

To regenerate the schema (at schema.ts):

yarn generateschema

Deployment

This repository auto-deploys to Vercel.

CDN for public file hosting

AWS S3 is used as a public CDN for Airtable images. Here's how it works:

  • A hidden cdn_urls column exists on the Solidarity Actions table, which stores data about the publicly viewable URLs. This column should not be edited manually.
  • The cdn_urls column is updated through the website's API โ€” the /api/syncToCDN endpoint โ€” which will upload Airtable's private attachments to the public CDN and then store the public URLs back in Airtable for serving in the frontend.
  • Syncing is automated. Whenever an Airtable record is updated, a webhook trigger the re-sync. A Github action regularly triggers a maintenance script which establishes or refreshes the Airtable webhook which is responsible for syncing attachment updates.
  • The webhook management script requires an Airtable access token in the env (AIRTABLE_API_KEY) configured via this URL as follows:
    • The webhook:manage in particular is required for webhook management
    • Three remaining permissions are required for syncing and other data fetching for the rest of the website:
      • data.records:read
      • data.records:write
      • schema.bases:read

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.