MTES-MCT / Docurba

4 stars 5 forks source link

docurba

Overview

Docurba's mission is to facilitate the development and monitoring of urban planning documents in order to more quickly and effectively address environmental issues. This documentation will guide you through the setup, development, and deployment processes.

Tech Stack

docurba is built using a Vue2 tech stack designed for rapid development and scalability:

Build Setup

Prerequisites

Before you start, ensure you have a .env file at the root of the project with the following keys:

Important: These keys are sensitive and should never be made public. After building the project, ensure they are not included in the .nuxt folder. For making public keys available, refer to the Nuxt.js runtime config documentation.

Installation

Follow these steps to set up the project locally:

# Install dependencies
$ npm install

# Serve with hot reload at localhost:3000
$ npm run dev

# Build for production
$ npm run build

# Launch the production server
$ npm run start

deploy

app.yaml is here as an example.

$ gcloud app deploy app.yaml --project docurba

$ gcloud app deploy app_dev.yaml --project docurba

Daily Script Execution

Running the Daily Dump Script

To ensure the procedures daily updates from Sudocuh, follow these steps to run the index.mjs script located in the daily_dump folder:

  1. Download the Daily Dump:

    • Before running the script, download the latest data dump for the day from Supabase. Ensure you are using the correct credentials to access this data.
  2. Verify the Environment:

    • Confirm that the .env file contains the correct SUPABASE_ADMIN_KEY needed to authenticate and interact with the Supabase database.
  3. Running the Script:

    • Navigate to the daily_dump folder and run the script by executing:
      $ node index.mjs
    • Ensure that the script is pointing to the newly downloaded dump file. This may involve adjusting the script or settings to target the correct file path.

Important Notes:

PostgreSQL Database Structure

Procedures Hierarchy and opposability

The data within our PostgreSQL database is structured with a clear hierarchy to organize the urban planning documents efficiently:

Opposability in Procedures

Opposability is a key concept in our data model, reflecting the legal enforceability of a procedure within specific perimeters. Here’s how opposability works:

Determining Opposability in Communes

You can find exemples in this videos:

Practical Implications

This structured approach allows us to maintain a high level of detail and accuracy in managing the legal statuses of urban planning documents with very few complexity in our data model.

Documents Versioning with Git

Overview

For managing the versioning of documents related to Porté à connaissance (PAC), docurba utilizes a dedicated Git repository. This setup allows us to track changes and maintain updates efficiently across different administrative levels.

Repository Structure

Implementation Details

Goals for Repository Independence

Data Integration in Docurba

Overview

Initially, Docurba was created as a platform to provide easy access to essential data needed to produce urban planning documents. While the data requirements are nearly always consistent, the sources of this data vary by region and département.

Mission and Methodology

Integrated Data Sources

  1. Base Territorial:

    • Handled specifically by each region. Implementation examples can be found in the daturba.js plugin, which indexes and retrieves data as required by regional specifications.
  2. Geo-IDE:

    • Integrated within the daturba.js plugin. This source is managed with the geoide api located in the service middleware, facilitating the access to geographical data interfaces provided by Geo-IDE.
  3. Geo Risque:

    • Also managed through the daturba.js plugin in conjunction with the geoide api service middleware.
  4. INPN:

    • Directly implemented in the INPNTable component. This national API provides access to detailed environmental and ecological data across France.
  5. GPU:

    • Implemented in the gpu.vue page. This source uses a national API.