Git Product home page Git Product logo

nodetptwitter's Introduction

Node JS - TP P2019 - Twitter

Configurer votre .json pour la database + npm i pour les dépendencies npm run db:sync pour synchroniser la BDD.

=== ROUTES USERS ===

POST /user -> models.user.create() ==> OK

GET /users -> models.user.findAll() ==> OK

GET / users/:id -> models.user.findById() ==> OK

GET /users/:id/tweets -> models.tweet.findAll({ where: { user_id: }}) ==> OK

DELETE /users/:id -> models.user.update() ==> OK

=== ROUTES TWEETS ===

POST /tweets -> models.tweet.create() ==> OK

GET / -> models.tweet.findAll() ==> OK

GET /tweets/:id -> models.tweet.findById() ==> OK

DELETE /tweets/:id -> models.tweet.del() OR models.tweet.update({ id: , state: 0 }) ==> OK

=== A FAIRE COMME TP ===

RETWEET

GET /users/{id}/following (on récup les abonnés)

POST /users/{id}/following

GET /users/{id}/followers (on récup nos abonnés)

== BONUS POINT ==

PM2 module

N'utiliser pas de throw new error en prod:

if (process.env.NODE_ENV === 'development') { throw new Error(err) } else { console.log(Error) }

Mentions, hashtags, retweets, favoris

Encryption du mot de passe (1 ligne de code askip)

Notifications

=== GLOBALEMENT ON DOIT AVOIR ===

GET / => Liste des tweets des users qu'on follow

POST /tweets => Post d'un nouveau tweet ==> OK

DELETE /tweets => Delete d'un tweet ==> OK

GET /tweets/{id} => Single view d'un tweet ==> OK

GET /users => Liste de tous les users ==> OK

POST / users => Creation d'un nouveau user ==> OK

PUT /users => Update de user ==> OK

DELETE /users => Delete un user ==> OK

GET /users/{user_id} => Single view d'un user ==> OK

GET /users/{user_id}/following => Liste des users qu'on follow

POST /users/following/{following_id} => Follow d'un nouveau user

GET /users/{user_id}/followers => Liste des users qui nous follow

=== BONUS GLOBALEMENT ===

Creation d'une API hashtag avec un model hashtag

Lors d'un nouveau tweet (hook beforeCreate), parser le contenu (regex)

Enregistrer dans la table hashtag (models.hashtag.create)

Associer le tweet au tag (dans les hooks)

=== NOTATION ===

Fonctionnalités du projet

Fonctionnement du projet

Qualité du code (indentation, commentaire, nom etc)

Optimisation du code et des requêtes

nodetptwitter's People

Contributors

guillaumerz avatar mytototo avatar stanyslasfruchard avatar

Watchers

 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.