Giter Site home page Giter Site logo

node-mongo-redis-shoppingcart's Introduction

node-api-rest + mongodb + redis + shopping cart

RESTful API for CRUD with Node.js, Express, MongoDB and mongoose.js Shopping cart with redis and mongodb. Time to expire. Whats hot now service with redis. Time to expire.

You need install node.js, MongoDB and redis.

You can read

To run

  • $ npm install
  • start mongo server
  • start redis server
  • $ server.js

Tecnologías

  • Node.js RESTful API with express.
  • MongoDB and mongoose
  • redis

El proyecto. Temática: Tienda de camisetas

Fase 1:

* Crear una API RESTful que responda a los casos CRUD. * La base de datos utilizadas será MongoDB. * http://speakinbytes.com/2014/03/api-rest-con-node-js-express-mongodb-y-moongose-js/

Rutas:

* GET /tshirts - muestra una lista con todas las camisetas * GET /tshirt/:id - muestra los detalles de una camiseta * POST /tshirt - crea una camiseta * -- body: model (obligatorio), colour, price, summary, images, size, style (sólo permite: Casual, Alternative, Vintage) * PUT /tshirt/:id - modifica una camiseta * -- body: model (obligatorio), colour, price, summary, images, size, style (sólo permite: Casual, Alternative, Vintage) * DELETE /tshirt/:id - elimina una camiseta

Importante: Arrancar mongoDB en un terminal.

Fase 2:

* Crear un carro de la compra con varias líneas de pedido. * El carrito y sus líneas de pedido se almacernarán en redis. * El carrito tiene un tiempo de expiración de 5 min desde que se añade el último objeto * Se crea un nuevo pedido en MongoDB * Se pueden ver todos los carritos cerrados (comprados)

Rutas:

* POST /addproduct - crea una línea de pedido * -- body: id (camiseta), amount (nº de unidades) * GET /seecart - muestra el carrito * DELETE /deleteproduct/:id - Borra una linea de pedido * --id es el id del producto que se elimina * POST /closecart - Guarda el pedido en MongoDB * GET /listofclosedcarts - Muestra los pedidos cerrados

Importante:

* tener arrancado MongoDB en un terminal. * tener arrancado redis en otro terminal.

Fase 3:

* Crear un servicio what's hot now * Se guardan en redis los artículos visitados (GET /tshirt/:id) con tiempo de expiración de 1 min. * Se crea un servicio que devuelva las camisetas "calientes" * http://speakinbytes.com/2014/03/node-js-redis-implementando-un-whats-hot-con-tiempo-de-expiracion/

Rutas:

* GET /tshirt/:id - acceder a ver los detalles de una camiseta * GET /hots - muestra las "camisetas calientes"

Importante:

* tener arrancado MongoDB en un terminal. * tener arrancado redis en otro terminal. * tener camisetas creadas a las que poder acceder

Fase 4:

* Crear un servicio "what's was hot then" * Se crea un log de artículos visitados en mongoDB * Se muestra una lista de artículos visitados en un rango de tiempo.

Rutas:

* GET /tshirt/:id - acceder a ver los detalles de una camiseta * GET /washot/:yearstart/:monthstart/:daystart/:yearend/:monthend/:dayend - muestra el log de acceso a camisetas

Importante:

* tener arrancado MongoDB en un terminal. * tener arrancado redis en otro terminal. * tener camisetas creadas a las que poder acceder

node-mongo-redis-shoppingcart's People

Contributors

pbojeda 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.