GithubHelp home page GithubHelp logo

iam-benyamin / gone.bike Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gone-bike/gone.bike

0.0 0.0 0.0 2.71 MB

Stolen bike search & report

License: GNU General Public License v3.0

JavaScript 2.31% Python 11.49% TypeScript 19.51% Makefile 2.30% Dockerfile 0.09% Astro 37.89% Vue 26.41%

gone.bike's Introduction

Gone.Bike

OpenSource, OpenData stolen bikes database, search engine and reporting tool.

Data is publicly accessible at gone.bike/exports/

Project Goals

Create a global database of stolen bikes that can easily be accessed and searched, in order to provide a fast, efficient and effective way to identify suspicious bikes (from second hand markets, online ads, etc), using image search features and dynamic filters for a quick match.

Features

  • Receive direct reports via a detailed form (done)
  • Collect and index reports from various public, local websites (WIP)
  • Image search (WIP)
  • Filtering search (WIP)
  • Threaded discussions (TODO)
  • Theft Heatmap (ROADMAP)

Use cases

  • You want to buy a second hand bike (flea market, online): you can search the db to check if the bike has been reported.
  • You spot a suspicious bike and you match it in the datbase: you can report it
  • Police force find stolen bikes and they can use the db to identify the owner

Motivations

Whether you're a seasoned cyclist, a daily traveler, or an aspiring rider, you should know this feeling about bikes: they are not just things, they are objects, yes, but we create a relationship with them. They carry us, they share sweat and tears with us and they are loyal companions that contribute to make the world a better place, reducing both noise and pollution, improving our health and mood.

Having your bike stolen is not just a monetary blow, but a personal hit to a "member" of your life, almost a friend. The feeling of powerlessness afterwards, knowing how little you can do to recover it, thinking that your wheeled buddy is somewhere out there is frustrating.

Supported by technology, the frustation can be funneled into a good activity, beign a vigilant watcher, on the lookout to fight thieves back.

Tech Stack

Dev requirements

You need to have npm and docker-compose commands available.

Development Setup

This guide provides all necessary steps to have a fully functional local setup.

Clone this repository and access the repository root directory:

git clone [email protected]:gone-bike/gone.bike.git && \
cd gone.bike

Frontend setup

Create development env file in astro/ directory and install dependencies:

cd astro && \
cp .env.example .env && \
npm i

For pages that do not require db connection, this is enough to have the dev environment up and running, otherwise you need to have the backend setup.

Generate multilanguage pages: npx astro-i18next generate

Start the local server with: npm run dev


Database setup

In repository root directory, use template env files:

touch .env && \
cp .worker.env.example .worker.env && \
cp .directus.env.example .directus.env && \
cp .astro.env.example .astro.env

Create local data and config folders:

mkdir -p .config .data/{directus,postgresql} && \
chmod 0777 .data/directus

Create local config folder and files:

touch .config/redis.conf

Startup postgresql, redis and directus services:

docker-compose up -d postgresql redis directus

Ensure server is running with:

docker-compose logs --tail 10 directus

that should show something smilar to this:

gone.bike.directus  | [12:35:20.420] INFO: Adding first admin user...
gone.bike.directus  | [12:35:20.483] INFO: Done
gone.bike.directus  | [12:35:23.050] INFO: Server started at http://0.0.0.0:8055

Reflect DIRECTUS_TOKEN in database (for website to access it):

export $(cat astro/.env | grep DIRECTUS_TOKEN | tr -d '"') && \
 docker-compose exec postgresql psql -U postgres -c "UPDATE directus_users SET token = '$DIRECTUS_TOKEN'"

Copy database schema inside directus container and apply it:

docker-compose cp database/directus-schema.yml directus:/directus/ && \
docker-compose exec directus npx directus schema apply -y directus-schema.yml

Verify successful schema install by accessing directus at http://localhost:8055 using default user and password (configurable in .directus.env file before first startup):

username: [email protected]
password: dev

NOTE: It might be a directus bug, but in order to fully apply the schema and see it in the CMS, you need to perform a "Make collection invisible / Make collection visible" operation on any of the available collections. Operation can be applied twice in order to keep the state. After that, access the /admin/settings/data-model/bike_brand address to enforce Directus metadata reload.

You should now be able to see a empty but schemed database.


Database import

SQL database

wget https://gone.bike/exports/gone.bike.db-dump.latest.sql.gz && \
gunzip -c gone.bike.db-dump.latest.sql.gz | docker-compose exec -T postgresql psql -U postgres

Images

wget https://gone.bike/exports/gone.bike.images.latest.tgz  && \
tar zxvf gone.bike.images.latest.tgz --directory .data/directus/

Image search setup

@TODO

gone.bike's People

Contributors

abdelrahmanabouelkheir avatar ajaythewizard avatar darioguarascio avatar fede03billy avatar iam-benyamin avatar prostoleo 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.