Coder Social home page Coder Social logo

node_backend's Introduction

Mise en route

Installation

npm i

Lancement

npm start

Déploiement

Dans index.js : passer isOnline à true (ligne 15) Dans helpers/db.js (dans .gitignore donc à copier en manuel) :

  • changer le password et éventuellement le nom de la DB (lignes 6 & 7)
  • pour le https, ajouter le nom de domaine et décommenter (ligne 11)

Si pas besoin d'https, commenter les lignes 104 à 114 du fichier index.js

Liens de l'API

GET

Psychologues

3 roles différents : psy_online, psy_busy, psy_offline.

Routes :

  • /api/users/psy_on : psychologues disponibles (compteur) [psy]
  • /api/users/psy_busy : psychologues occupés (compteur) [psy]
  • /api/users/psy_off : psychologues indisponibles (compteur) [psy]

Tickets

3 statuts pour les tickets :

  • open : le collaborateur a enclenché une conversation mais aucun psychologue n'a encore répondu.
  • pending : une conversation a débuté entre un collaborateur et un psychologue et aucun des 2 n'a cloturé le ticket.
  • closed : une conversation a eu lieu et elle a été cloturée.

Routes:

  • /api/tickets?token=123 : création / relance d'un ticket [collab (entrée)]
  • /api/tickets/all : tous les tickets [psy]
  • /api/tickets/123 : tous les tickets d'un collaborateur [psy]
  • /api/tickets/123/pending : le ticket en cours (open / pending) d'un collaborateur [collab/psy]
  • /api/tickets/123/closed : tous les tickets cloturés d'un collaborateur [psy]
  • /api/tickets/closed : tous les tickets cloturés [psy]
  • /api/tickets/pending : tous les tickets non cloturés [psy]

Messages

Routes:

  • /api/messages?chid=123 : tous les messages d'un channel [psy]
  • /api/messages?cid=123 : tous les messages d'un collaborateur [psy]
  • /api/messages/pending?chid=123 : tous les messages d'un channel non cloturé [collab]

POST

Psychologues

  • /api/users/auth/admin : accès authentifié [psy]

Tickets

  • /api/tickets?token=123 : création / relance d'un ticket [collab (entrée)]

PUT

Psychologues

  • /api/users/auth/admin/123 : MAJ du statut d'un psychologue [psy]

Tickets

  • /api/tickets/state/123 : MAJ du statut d'un ticket [psy]

node_backend's People

Contributors

geraldb69 avatar charlesgourdin avatar

Stargazers

 avatar

Watchers

James Cloos avatar  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.