Skip to content

Commit

Permalink
Merge pull request #39 from dataforgoodfr/37-feat-connexion-back-et-f…
Browse files Browse the repository at this point in the history
…ront

37 feat connexion back et front
  • Loading branch information
KyllianBeguin authored Jan 5, 2025
2 parents 7e49f60 + 8ee0349 commit 62d9e89
Show file tree
Hide file tree
Showing 650 changed files with 236,264 additions and 218 deletions.
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/demande-de-fonctionnalité.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Demande de fonctionnalité
about: Un nouveau visuel ou une fonctionnalité à ajouter ?
title: "[\U0001F6A7 FEAT]"
labels: fonctionnalité
assignees: ''

---

**Demande de fonctionnalité**

**Description de la fonctionnalité**
Une description claire et concise de la fonctionnalité demandée.

**Raison de la demande**
Expliquez pourquoi cette fonctionnalité est nécessaire ou bénéfique.

**Détails de la demande**
- Où cette fonctionnalité devrait-elle être implémentée dans l'application (par exemple, quel onglet) ?
- Comment cette fonctionnalité devrait-elle fonctionner ?
- Quels sont les résultats attendus de cette fonctionnalité ?

**Onglet associé**
Dans quel onglet de l'application cette fonctionnalité serait-elle le plus pertinente ?

**Captures d'écran**
Si vous avez des captures d'écran ou des exemples visuels pour illustrer la demande, n'hésitez pas à les ajouter.

**Contexte supplémentaire**
Ajoutez tout autre contexte ou information pertinente concernant la demande de fonctionnalité.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/signalement-de-bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Signalement de bug
about: Un bug à nous faire remonter ?
title: "[\U0001F99F BUG]"
labels: bug
assignees: ''

---

**Décrire le bug**
Une description claire et concise du bug.

**Pour reproduire**
Étapes pour reproduire le comportement :
1. Aller à '...'
2. Cliquer sur '....'
3. Faire défiler jusqu'à '....'
4. Voir l'erreur

**Comportement attendu**
Une description claire et concise de ce à quoi vous vous attendiez.

**Captures d'écran**
Si applicable, ajoutez des captures d'écran pour expliquer votre problème.

**Ordinateur de bureau (veuillez compléter les informations suivantes) :**
- OS : [par exemple iOS]
- Navigateur : [par exemple chrome, safari]
- Version : [par exemple 22]

**Smartphone (veuillez compléter les informations suivantes) :**
- Appareil : [par exemple iPhone6]
- OS : [par exemple iOS8.1]
- Navigateur : [par exemple navigateur par défaut, safari]
- Version : [par exemple 22]

**Contexte supplémentaire**
Ajoutez tout autre contexte concernant le problème ici.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ cython_debug/
# Precommit hooks: ruff cache
.ruff_cache

etl/zds/.file_versions/*
zds/backend/mage/zds/.file_versions/*

# Dossier sauvegarde Thibaut
TG_sauv
Expand All @@ -174,4 +174,5 @@ TG_sauv
dashboards/app/.credentials.yml

# For obvious reasons
/etl/.mysql_root_password
**/.mysql_root_password
**/.mysql_merterre_password
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
exclude: 'etl/zds/.*'
exclude: 'zds/backend/.*'

repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
Expand Down Expand Up @@ -27,3 +27,4 @@ repos:
hooks:
- id: python-safety-dependencies-check
args: ["--ignore=73456,71608,71956,71957,72236,71064,70612,71591,67895,72083"]
files: (?x)^(dashboards/app/requirements.txt|etl/requirements.txt)
31 changes: 21 additions & 10 deletions Exploration_visualisation/cleaning_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

PATH = "./data/"

# import du fichier d'exportations des events
# import du fichier d'exportations des events
df_events = pd.read_excel(PATH + "export_events_14032024.xlsx")

# Supprime les événements annulés
Expand All @@ -14,21 +14,32 @@
# Remplace les valeurs NaN par 0 dans le NIVEAU DE CARAC
df_events.NIVEAU_CARAC.fillna(0, inplace=True)
# change le type de NIVEAU_CARAC en int
df_events.NIVEAU_CARAC = df_events.NIVEAU_CARAC.astype('int64')
df_events.NIVEAU_CARAC = df_events.NIVEAU_CARAC.astype("int64")

# COORD GPS :
# Supprime les crochets
# split les valeurs par la virgule pour obtenir les coordonnées X et Y
# COORD GPS :
# Supprime les crochets
# split les valeurs par la virgule pour obtenir les coordonnées X et Y
# convertit en float
df_events[['COORD_GPS_X', 'COORD_GPS_Y']] = df_events.COORD_GPS_RDV.str.strip('[]').str.split(',', expand=True).astype(float)
df_events[["COORD_GPS_X", "COORD_GPS_Y"]] = (
df_events.COORD_GPS_RDV.str.strip("[]").str.split(",", expand=True).astype(float)
)

# Majuscule sur TYPE_EVENEMENT
df_events.TYPE_EVENEMENT = df_events.TYPE_EVENEMENT.str.capitalize()

# Supprime les colonnes de contact des structures (anonymisation)
# Supprime la colonne COORD_GPS_RDV (inutile)
# Supprime la colonne ANNULE (déjà filtrée)
df_events = df_events.drop(['REFERENT_STRUCTURE', 'TELEPHONE_STRUCTURE', 'COURRIEL_STRUCTURE', 'COORD_GPS_RDV', 'ANNULE'], axis=1)


df_events.to_csv(PATH + 'export_events_cleaned.csv', index=False, encoding='utf-8-sig')
df_events = df_events.drop(
[
"REFERENT_STRUCTURE",
"TELEPHONE_STRUCTURE",
"COURRIEL_STRUCTURE",
"COORD_GPS_RDV",
"ANNULE",
],
axis=1,
)


df_events.to_csv(PATH + "export_events_cleaned.csv", index=False, encoding="utf-8-sig")
Binary file not shown.
80 changes: 27 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,27 @@
Template DataForGood
================

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

This file will become your README and also the index of your
documentation.

# Contributing


## Use a venv

python3 -m venv name-of-your-venv

source name-of-your-venv/bin/activate


## Utiliser Poetry

[Installer Poetry](https://python-poetry.org/docs/):

python3 -m pip install "poetry==1.4.0"

Installer les dépendances:

poetry install

Ajouter une dépendance:

poetry add pandas

Mettre à jour les dépendances:

poetry update

## Utiliser Jupyter Notebook

jupyter notebook

and check your browser !

## Lancer les precommit-hook localement

[Installer les precommit](https://pre-commit.com/)


pre-commit run --all-files


## Utiliser Tox pour tester votre code

tox -vv
![](./media/zds_banner.png)

# Zéro Déchet Sauvage
## À propos
[Zéro Déchet Sauvage](http://zds-app.duckdns.org/) (ZDS) est une application de visualisation de données de déchets diffus et collectés au cours d'évènements de collectes. Il s'agit d'une plateforme appartenant à l'association [MerTerre](https://mer-terre.org/) et développée par des bénévoles de l'association Data For Good.

## Démo
Une démo de l'applicaiton a été réalisée lors du Demo Day organisée à la fin de la saison 12 par Data For Good.

<a href="[URL](https://www.youtube.com/live/7Zvy2PS7Vjg?si=Z3Gduxff0EunXsF7&t=6210)">
<img src="https://i.ytimg.com/vi/7Zvy2PS7Vjg/maxresdefault.jpg?sqp=-oaymwEmCIAKENAF8quKqQMa8AEB-AH-CYAC0AWKAgwIABABGFUgTyhlMA8=&rs=AOn4CLC3vkFGSd9jcNDb0HxMvbdN8kxQyA" alt="video youtube du demo day" width="50%">
</a>

## Remerciement
Merci à l'équipe de développement :
* [Floriane](https://github.com/florianeduccini)
* [Hadrien](https://github.com/DridrM)
* [Mehdi](https://github.com/Mendi33)
* [Vincent](https://github.com/Vincentdata)
* [Thibault](https://github.com/tgazagnes)
* [Linh](https://github.com/linh-dinh-1012)
* [Joaquim](https://github.com/JoaquimDiaz)
* [Valérie](https://github.com/ValerieNevo)
* [Kyllian](https://github.com/KyllianBeguin)

## Licence
Ce projet est sous licence MIT. Plus d'information sur le fichier [LICENCE](https://github.com/dataforgoodfr/12_zero_dechet_sauvage/blob/staging/LICENSE).
Binary file added media/zds_banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file removed python_template/__init__.py
Empty file.
10 changes: 10 additions & 0 deletions zds/backend/db/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM mysql:9.1.0

ENV MYSQL_DATABASE zero_dechet_sauvage

COPY ./scripts/setup_db.sql /docker-entrypoint-initdb.d/

COPY ./.mysql_root_password /.mysql_root_password
COPY ./.mysql_merterre_password /.mysql_merterre_password
COPY ./scripts/create_merterre.sql create_merterre.sql
COPY ./create_merterre.sh /docker-entrypoint-initdb.d/
10 changes: 10 additions & 0 deletions zds/backend/db/create_merterre.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

#reading the value of weekday.txt file into the var variable
rpass=$(cat .mysql_root_password)
mpass=$(cat .mysql_merterre_password)

add_merterre_raw=$(cat create_merterre.sql)
add_merterre="${add_merterre_raw/BY /BY \'"$mpass"\'}"

mysql -h localhost --user=root --password=$rpass -se "$add_merterre"
2 changes: 2 additions & 0 deletions zds/backend/db/scripts/create_merterre.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE USER 'merterre'@'%' IDENTIFIED BY ;
GRANT INSERT, SELECT, UPDATE ON zero_dechet_sauvage.* TO 'merterre'@'%';
Loading

0 comments on commit 62d9e89

Please sign in to comment.