open event database revived
Find a file
2025-10-07 14:12:50 +02:00
.idea ajout de reality check dans les évènements traffic qui complète une propriété de l'évènement 2025-09-21 23:59:01 +02:00
.vscode scrapping agendadulibre 2025-10-04 19:26:00 +02:00
data add demo page 2025-09-16 00:04:53 +02:00
datasources@4f1410e69c custom bison fute getter 2025-09-17 23:52:49 +02:00
doc up pages 2025-09-26 17:38:30 +02:00
examples Update other.json 2016-05-16 18:35:44 +02:00
extractors scrapping mobilizon 2025-10-07 14:10:08 +02:00
frontend routes doc, future, express mode thematique 2025-10-07 14:12:50 +02:00
oedb add frontend angular 2025-10-02 22:53:50 +02:00
server_config up demo 2025-09-18 23:43:06 +02:00
static add frontend angular 2025-10-02 22:53:50 +02:00
.env.example up redirect oauth example 2025-09-21 13:53:56 +02:00
.gitignore custom bison fute getter 2025-09-17 23:52:49 +02:00
.gitmodules custom bison fute getter 2025-09-17 23:52:49 +02:00
backend.py QA page 2025-09-27 01:10:47 +02:00
CHANGES.md split templates 2025-09-26 15:08:33 +02:00
check_mock_events.py up stuff 2025-09-15 23:25:11 +02:00
create_mock_events.py add frontend angular 2025-10-02 22:53:50 +02:00
docker-compose.yml Deal with updates 2016-05-07 10:59:57 +02:00
Dockerfile-backend up stuff 2025-09-15 23:25:11 +02:00
Dockerfile-postgres up stuff 2025-09-15 23:25:11 +02:00
LANCER_SERVEUR.md add live page 2025-09-26 11:57:54 +02:00
LICENSE Initial commit 2016-04-14 15:58:32 +02:00
Makefile add live page 2025-09-26 11:57:54 +02:00
mobilizon_cache.json scrapping mobilizon 2025-10-07 14:10:08 +02:00
oedb.png OEDB logo ! 2016-06-03 08:58:05 +02:00
polyline.py Create polyline.py 2016-07-28 14:59:52 +02:00
README.md up demo links and map controls 2025-09-18 22:14:41 +02:00
requirements.txt scrapping agendadulibre 2025-10-04 19:26:00 +02:00
setup.sql up setup and doc 2025-09-18 19:09:25 +02:00
setup_db.sh up stuff 2025-09-15 23:25:11 +02:00
swagger.json Update swagger.json 2021-11-14 23:48:06 +01:00
test_app_init.py up static routes 2025-09-21 16:57:24 +02:00
test_env_file_check.py up extractor env getting 2025-09-18 22:30:25 +02:00
test_env_path.py up demo 2025-09-18 23:43:06 +02:00
test_marker.html change vectory tiles 2025-09-23 11:26:44 +02:00
test_osm_cal.py up demo 2025-09-18 23:43:06 +02:00
test_osm_cal_api.py add live page 2025-09-26 11:57:54 +02:00
test_osm_cal_ical.py add live page 2025-09-26 11:57:54 +02:00
test_permissions.sh up stuff 2025-09-15 23:25:11 +02:00
test_reality_check.js ajout de reality check dans les évènements traffic qui complète une propriété de l'évènement 2025-09-21 23:59:01 +02:00
test_stats_endpoint.py up extractor env getting 2025-09-18 22:30:25 +02:00
test_table_permissions.sh up stuff 2025-09-15 23:25:11 +02:00
uwsgi.ini up pages 2025-09-26 17:38:30 +02:00
uwsgi.log up static routes 2025-09-21 16:57:24 +02:00
wsgi_websocket.py add live page 2025-09-26 11:57:54 +02:00

OpenEventDatabase Backend

oedb.png

OpenEventDatabase (OEDB) is a database for events with geographic information. It is a collaborative way to share things that have no space in OpenStreetMap.

Getting Started

Prerequisites

  • Docker and Docker Compose
  • PostgreSQL (if running locally without Docker)
  • Python 3.x (if running locally without Docker)

Installation

Copiez le fichier d'environnement pour accéder à la base de données.

cp .env.example .env

installez la base de données.

py -m venv venv
source venv/bin/activate
pip install -r requirements.txt
bash setup_db.sh

vous pouvez ajouter des données d'exemple:

cd data
py import_example_from_csv.co2db.py
  1. Clone the repository:

    git clone https://github.com/yourusername/openeventdatabase.git
    cd openeventdatabase/backend
    
  2. Start the services using Docker Compose:

    docker-compose up -d
    

    This will start both the PostgreSQL database and the backend API server.

  3. Access the API at http://localhost:8080

Running Locally

  1. Install dependencies:

    pip install -r requirements.txt
    
  2. Set up the database:

    ./setup_db.sh
    
  3. Verify database tables are properly created:

    ./check_tables.sh
    
  4. Start the server with uwsgi:

    uwsgi --http :8080 --wsgi-file backend.py --callable app
    

    Or with gunicorn:

    gunicorn backend:app
    

    Note: The server will automatically check database connectivity at startup and will exit if the PostgreSQL database is not responding.

    If you encounter permission errors when accessing the API (such as "permission denied for table events"), run the setup script again to ensure proper permissions:

    ./setup_db.sh
    

    You can also test database permissions with:

    ./test_permissions.sh
    

    Or specifically test permissions on the events table:

    ./test_table_permissions.sh
    

Environment Variables

  • DB_NAME: Database name (default: "oedb")
  • DB_HOST: Database host (default: localhost)
  • DB_USER: Database user (default: postgres)
  • POSTGRES_PASSWORD: Database password
  • NEW_USER: New PostgreSQL user to create with full permissions (default: "oedb_user")
  • NEW_PASSWORD: Password for the new PostgreSQL user (default: "oedb_password")

Mock Data

The repository includes scripts to create and check mock events in the database:

  1. Create mock events:

    ./create_mock_events.py
    

    This script creates 18 mock events (3 for each category: traffic, nature, weather, sport, conference, party) with start dates slightly before the current date and end dates far in the future.

  2. Check mock events:

    ./check_mock_events.py
    

    This script checks the mock events in the database, showing counts by category and date ranges for each event.

API Documentation

The OpenEventDatabase API allows you to search for events using various query parameters. You can filter events by:

  • Event type or category (what)
  • Time period (when, start, stop)
  • Geographic location (bbox, near, polyline)
  • And more...

Query Parameters

For detailed information about the available query parameters, examples, and response format, see the API Query Parameters Documentation.

Search Endpoint

The API includes a dedicated search endpoint (/event/search) that allows you to search for events using a GeoJSON geometry in the request body. This is particularly useful for complex spatial queries. For more information, see the Search Endpoint Documentation.

Anti-Spam and Caching Measures

The API implements caching and rate limiting to improve performance and prevent abuse. For more information about these measures, see the Anti-Spam and Caching Measures Documentation.

Testing

A comprehensive test plan is available for verifying the functionality of the API, including caching, rate limiting, and search features. See the Test Plan for details.

Swagger Documentation

Have a look at the swagger file for a complete API reference: swagger.json

Démo

page de démo listant les évènements selon leur type, les afficher sur une carte. créer une page de démo qui permet de modifier un évènement, faire un lien vers cette page quand on ouvre une popup d'évènement sur la page de /demo. et afficher une icone pour les marqueurs de carte selon le type d'évènement, définis en quelques uns et utilise les icones de bulma css. vérifier le fonctionnement des endpoints de recherche avec les queryparameters, les mettre dans la page de démo.

la page /demo/by-what a une erreur, Error: Expecting value: line 1 column 1 (char 0) récupérer les évènements depuis osmcal dans osm_cal.py ✓ dans les extracteurs, vérifier qu'il n'existe pas déjà des évènements avec les mês propriétés avant de les créer. ✓

Database Schema

The following diagram shows the database schema for the OpenEventDatabase:

Database Schema

The database consists of three main tables:

  • events: Stores event data including type, what, when, geo reference, and tags
  • events_deleted: Archive of deleted events
  • geo: Stores geometry data referenced by events

The events table has a foreign key relationship with the geo table through the events_geo field, which references the hash field in the geo table.

-- il manque l'attribution openstreetmap sur les cartes maplibre. ✓ ajouter une icone pour ajouter les sources https://source.cipherbliss.com/tykayn/oedb-backend

ajouter un lien sur la page de démo qui montre comment faire une recherche vers des évènements de type music, et de type sport ✓

proposer un contrôle de maplibre pour changer de fond de carte openstreetmap vecto ou raster. ✓

License

See the LICENSE file for details.