Coder Social home page Coder Social logo

grottocenter / grottocenter-api Goto Github PK

View Code? Open in Web Editor NEW
14.0 8.0 2.0 67.65 MB

Grottocenter API

Home Page: https://api.grottocenter.org

License: GNU Affero General Public License v3.0

JavaScript 91.71% Shell 2.37% Dockerfile 0.15% PLpgSQL 5.28% EJS 0.41% HTML 0.08%
sails express nodejs

grottocenter-api's Introduction

Grottocenter API

Grottocenter is The Wiki database made by cavers for cavers!

This GitHub project is the backend application which provide the Grottocenter API to the grottocenter front app.

For the Front-End See the grottocenter-front project

Current production version is available here

Project overview

code style: prettier

Master

Latest Deployment

Coverage Status Build

Develop

Coverage Status Build

GC flyer

Contributors

Thanks to their donations they made possible the developer of the V3 of Grottocenter:

Spéléo Club des Mémises, Frédéric Urien, Christophe Bes, Georges Messina, Philippe Henry, Bernard Thomachot, Nathan Bartas, Benjamin Soufflet, Ferdinando Didonna, Jean Marc Mattlet, Jean-Jacques Veux, Etienne Fabre, Sandy De Wilde, Sylvain Bélet, Félix Nilius, Didier Gignoux, Paul Guerin, Hervé Plaettner, Marius Carrière, Doc Carbur, Hard Gilles, Herman de Swart, Francesc Boix, Kai Getrost, Frederik Bauer, F K, Martin Andy, Suzanne Jiquel, Patrick Colinet, Association Wikicaves, Thierry Aubé, Jean Michel Faudrin, Michel Kaspruk, Yann Schneylin, Fabien Minana, Alain Gresse, Didier Borg, Ivan Herbots, Curtis Walter, Jan Matthesius, Stephane Jaillet, Thomas Cabotiau, Sylvain Pichot, Ayoub Nehili, CDS de l'Aude, Julio Serrano Banderas, Guillaume Cédille, Patrick Candéla, Léonard de Haro, Bruno Rouzeyre, Eric Madelaine, Christophe Alexandre, Pierre Mouriaux, Christophe Mergalet, Daniel Caron, Christian Feuvrier, Laurent Delbourg, Melanie Sanchez, Spéléo Club de Villeurbanne, Harold van Ingen, Jerome Fiquet, Joris Genisset, Gérald Huet AVENTURE VERTICALE, Alexandre Faucheux, Laval Subterra, Audrey Maingue, François Purson, Eric Gautier, Guillaume Cugno, Jean-François Foulche, Oskar Van Herreweghe, Guerard Marie, Christophe Evrard, Philippe Gerbier, Christopher Peeters, Speleo Club de Metz, Speleo Nederland, Erik De Groef, Christian Delaire, Flemish Caving Association, Denis Pailo, Timothée Chauviré, Claudie Serin, Eric de Valicourt, Christian Pauli, Eric Maljournal, Guilhem Navone, Laurent Blum, JM Dedieu, Estelle Grandsagne, Marie Merlin, Pierre-Antoine Mauro, Guillaume Pla, Groupe Spéléo du Club Alpin Nîmois, Sven Decharte, Dominique Lagrenee.

Installation

Software requirement:

Clone the project on your computer and install dependencies:

$ git clone [email protected]:GrottoCenter/grottocenter-api.git
$ cd grottocenter-api
$ npm install

Usage

Development setup

The development setup aims to launch locally all tools needed for the GrottoCenter API development:

  • Postgresql database containers (main + test)
  • A Elasticsearch container
  • A Logstash container

All the definition for containers is located in the docker/ folder

To launch the development setup run:

$ npm run dev:up

Then the Grottocenter API app can be launched using:

$ npm run dev

The API should now be available at http://localhost:1337/

Each time you change a file in the source code, the server is restarted automatically.

To stop the development setup you can run :

$ npm run dev:stop # Stop all containers
$ npm run dev:down # Stop and destroy all containers

Development

Caver's community needs YOU!

Yon can also join us on Slack! (using the QR-code above)

For more details, read the development guide

Tests

Run all tests:

$ npm run test

Run (a) specific test(s) matching a String:

$ npm run test -- --grep "<your_partial_name_tests>"
# Example
$ npm run test -- --grep "Auth features"

Check code coverage:

$ npm run coverage

I18n / Translation

See the wiki article translation workflow

Data versioning

See the wiki article Automated data versioning

Build

Build is run by GitHub Actions on every push. See build.yaml to see what is run during the build workflow.

If the build is triggered from a push on master then a deployment of the API to Azure App Service is automatically triggered.

Deployment in production

Deployment is done with GitHub Actions on Azure App Service when a pull request is merged into the develop branch.

API release

Additionally, periodic release of the API can be done.

You first need to merge your changes to master using if possible the git flow release start vXX.X.X command. Don't forget to update the version number on the swagger file and on the package.json file. When the merge on master is completed, you should create a release for the newly pushed tag.

For more information see the wiki page Production deployment

ElasticSearch

See ElasticSearch Wiki page

Git

Workflow

This project is using the Git Flow workflow.

More info here : https://danielkummer.github.io/git-flow-cheatsheet/index.html

You install the git-flow CLI to help you properly use the Git Flow Workflow.

When running the git flow init command you should keep all the default configuration.

You should use the proper type when creating a new branch with the workflow (feature, bugfix, hotfix, ...).

Before pushing your branch always do a git rebase -i to merge unnecessary commits together.

Merging

  • Merging a simple feature / bugfix should always be done using a rebase fast-forward.
  • Complex features requiring multiple commits should be merged with a regular merge commit.

Commits

This project follows the conventional commit specification. It uses commitlint to enforce conventional commit messages.

To prevent bad commits and push, we use the Git hooks Husky

Husky is used to:

Commit types

The commit linter accepts the following types:

  • feat: Adds a new feature to the application
  • tech: Adds a new technical feature to the application (ex: a new reusable component). Neither fixes a bug nor adds a feature
  • refactor: Refactor a current implementation without adding a new feature or fixing a bug
  • improvement: Improve a current implementation without adding a new feature or fixing a bug
  • fix: A bug fix
  • chore: Changes to the build process or auxiliary tools and libraries such as documentation generation
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • test: Adding missing or correcting existing tests
  • revert: Reverts a previous work

Licence

GNU Affero General Public License v3.0

grottocenter-api's People

Contributors

aliachawaf avatar axelcanton avatar bsoufflet avatar ceciledestig avatar clemrz avatar clm-roig avatar dependabot[bot] avatar didine74 avatar fabricez avatar fatimamachhouri avatar godefroiroussel avatar greenkeeper[bot] avatar igwall avatar jmvanel avatar jokergrizzly avatar julien-vendran avatar kurdty avatar lageta avatar margotgeorget avatar maximenathan avatar nyandams avatar remigestin avatar snyk-bot avatar urien avatar vmarseguerra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

kurdty jmvanel

grottocenter-api's Issues

Focus on an entry after a search

Quand on fait une recherche et qu'on clique sur le nom d'une cavité son picto change mais il n'y a pas de focus ce qui ne permet pas de la repérer.
Il faudrait qu'un focus soit fait sur la zone où se situe la cavité, le picto pourrait être le même que pour les autres mais avec une couleur plus soutenue

Mass import Wales datas

Importation des données non soumises à droit d'auteur, disponibles en ligne
La transformation des coordonnées et l'ajout des informations de localisation sont déjà faites
capture du 2017-11-01 07-52-15

Le résultat est ici
wales-LOC.xlsx

Mass import from Herbert Daniel datas

Herbert nous a donné une copie de sa base de donénes. les cavités ont été importées par Benjamin il y a deux ans, il s'agit d'importer les informations détaillées (description, historique, bibiographie)

Le job est près
image

Creation of the Group page

La page décrivant un groupe n'existe pas sur Grottocenter V2

Les champs à visualiser sont ceux de la table Grotto
country
region
city
postalCode
address
contact (adresse mel du groupe)
yearBirth
latitude
longitude
pictureFileName
customMessage (champ utilisé pour stocker l'url du site)
isOfficialPartner

Les champs suivants ne seront plus utilisés
idPresident:
idVicePresident
idTreasurer
idSecretary

Les champs suivants sont à rajouter
village
county
documentary (dispose d'un fond documentaire O/N)
URL (champ qui stockera l'URL du site internet)
Facebook

Outre ces champs la page affichera
une carte localisant l'adresse du Groupe
La liste des spéléos ayant un compte sur Grottocenter associés à ce groupe
La liste des cavités sur Grottocenter qui sont associées à ce groupe

La gestion du contact par mel devra être étudiée afin d'éviter les spams

Lien sur /dashboard/map

Quand on clique sur map on arrive sur la page /ui/
screenshot-localhost 8081-2018-05-24-17-24-06
Il faudrait que le lien se fasse sur /ui/map/

Creation of the bibliography page

Actuellement les fiches détaillées des cavités comportent un champ bibliographie.

Il serait souhaitable que ce champ soit repris afin de proposer les informations normalisés que l'on trouve dans les outils de gestion d'ouvrage, sur le modèle de ce qui est utilisé pour le BBS. L'utilisation des mêmes champs que ceux qui sont déjà renseigné pour le BBS permettrait, dans une étape uléterieure de pouvoir envisager l'utilisation des informations contenues dans cette base de donnée bibliographique relative à la Spéléo.
Le formulaire de saisie du BBS ressemble à cela
capture dcran 2014-01-02 13 44 05

Avant de commencer le travail il convient d'aller tester le BBS http://www.ssslib.ch/bbs/
Patrick Deriaz est d'accord pour organiser une conférence Vidéo.
Il semble souhaitable qu'un accord soit obtenu pour pouvoir bénéficier de la base de données du BBS, avant de créer la page avec l'ensemble des champs du BBS

La page bibliographie serait une page spécifique sur Grottocenter, qui reprendrait les champs du formulaire du BBS

Il conviendra de rajouter

  • un lien vers le document s'il est archivé sur Grottocenter
  • un lien vers les fiches (sur Grottocenter) des cavités qui sont présentées dans l'ouvrage

Remove TODOs on code

Try to remove maximum of TODOs on code (target: 0 left) by adding necessary code.

Connexion

Même si ce n'est pas actif pour l'instant il faudra prévoir un bouton pour se connecter qui sera présent sur toutes les pages.

Browserify issue: compilation impossible

Error: Cannot find module './translate' from '/home/frederic/Grotto/Grottocenter3/assets/js/react/components/common'
Warning: Error running grunt-browserify. Use --force to continue.

Creation of the Montain range page

La page massif sera appelée depuis le champ de recherche en page d'accueil

Elle contiendra

  • Le nom du massif
  • Une carte localisant les entrées faisant partie du massif
  • La liste des cavités faisant partie du massif avec un lien vers la fiche de chaque cavité lorsqu'on clique sur le nom

Add Flow to the project ?

See https://flow.org

Flow is used to enhance code quality by checking JS types dynamically.

On server side, it could be very interesting.
On React side we already have a mecanism of props checking, so we have to determine if it is necessary or not.

So analyse is necessary.

Mass Import BRGM datas

Les données du BRGM sont disponibles ici
http://www.georisques.gouv.fr/dossiers/cavites-souterraines/donnees#/

Elles sont libres de droit
http://www.georisques.gouv.fr/mentions-legales

Une copie des fichiers a été placée ici
https://drive.google.com/drive/folders/0B0fxHN2AHcdvbVJ4bHFpMFdlRnM?usp=sharing

Un premier job Talend va permettre de

  • sélectionner les cavités naturelles correspondant à des grottes, dont les coordonées sont précises
  • transformer les coordonées lambert 93 en GWS84
  • compléter les 5 champs de localisation (Country, Region, County, City, Village) à partir des coordonnées GWS 84

Les données produites seront placées dans ce dossier
https://drive.google.com/drive/folders/0B0fxHN2AHcdvNnR2NjdHZEswczA?usp=sharing

Un second Job permettra de :

  • normaliser le nom : trou du chat > Chat (trou du)
  • réaliser un matching avec les cavités déjà dans la base
  • insérer les cavités qui ne sont pas dans la base dans un tableau avec 4 colonnes : id, entry, singleentry. La colonne id sera complétée ultéreurement, la colonne entry contient la requete sql permettant de compléter la table entry, idem pour la colonne singleentry pour la table correspondante. Ce dernier composant a déjà été réalisé

Les données prètes à être importées seront dans ce dossier
https://drive.google.com/drive/folders/0B0fxHN2AHcdvSkVBYnJHTXBnZWc?usp=sharing

Info-bulle à ouverture automatique

Quand on se déplace sur la carte il y a une info-bulle qui s'ouvre, de manière aléatoire semble-t-il, sans que l'on clique sur l'icone de l'entrée

To add in menu

La structure sera la même pour les entrées, les groupes et les spéléos. Il faudra sans doute donner accés aux réseaux et aux massifs avec des pages spécifiques. il faudra également prévoir un menu pour acceder au module de conversion

Advanced search

Il conviendrait de trouver une place pour le module de recherche avancé. Peut-être à la place du module actuel lorsqu'on clique sur un bouton

Center the map when you access it

Actuellement j'arrive sur le sud de l'Angleterre, il faudrait soit centrer sur la position de l'utilisateur, soit si sa position est inconnue afficher la terre entière

screenshot-localhost 8081-2018-03-21-20-17-25

Localization Entries

Réalisation d'un Job avec Talend qui complète et normalise les 5 champs de localisation a partir des coordonnées (reverse géocoding)

Add fields in database

Afin de disposer de 5 champs de localisation il conviendrait de rajouter dans les tables

  • t_entry
  • t_grotto
  • t_caver

les champs

  • Village (varchar64)
  • County (varchar64)

Localization Cavers

Réalisation d'un Job avec Talend qui complète et normalise les 5 champs de localisation a partir des coordonnées (reverse géocoding)

Link landing page to map page

To be added:

  • a link on the header of the landing
  • a dedicated landing block (text + dyn image + link)
  • a link on landing page footer

Lien depuis l'info bulle

Le lien depuis l'info bulle pointe vers une page qui n'existe pas encore
screenshot-localhost 8081-2018-05-24-16-59-08
Est ce qu'on ne ferait pas le lien vers la fiche en cliquant sur le nom de la cavité ?
Dans l'immédiat il faudrait indiquer le lien vers la fiche sur la V2

Dashboard link

screenshot-localhost 8081-2018-05-24-17-01-19
Quand on clique sur dashboard on arrive sur une page vide. Est ce qu'on ne choisi pas la page ui/map comme page par défaut ?

Add permalink on the map

On the map page, once a search is done, change the current URL to add necessary parameters to get a permalink on the search.

So if the user use the same URL later, he will be redirected on is previous search.

Move the map when a bubble is open

Actuellement lorsqu'on déplace la carte alors qu'une info-bulle est ouverte il y a un bug d'affichage (cela bouge tout seul) puis un ralentissement et un plantage

Mass inport Savoie Data

A partir des données disponibles sur internet j'ai réalisé un fichier avec les données normalisées et localisées. Il reste à

  • supprimer les cavités déjà dans Grottocenter
  • remplacer le nom des massifs par leur identifiants
  • écrire la requete permettant d'insérer les entrées dans les tables

SAVOIE.xlsx

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.