GithubHelp home page GithubHelp logo

beor18 / alm-api-backend Goto Github PK

View Code? Open in Web Editor NEW
10.0 4.0 1.0 531 KB

Comenzo como desafio almundo.com y ahora estoy actualizando el repo con nuevos features

Home Page: https://almundo-examen.herokuapp.com/api/v1/hoteles

JavaScript 99.53% Dockerfile 0.47%
mongodb nodejs api apirest javascript graphql express express-graphql boilerplate moongose coronavirus covid-19

alm-api-backend's Introduction

Almundo Server

Build Status Conventional Commits

  • Reutilice un esquema que habia realizado para el backend lo pueden ver en jwt-login lo mismo para el frontend.

Demo:

Almundo-server Backend demo api v1

Almundo-server Backend demo api v2 - con GraphQL

Objetivo profesional y personal:

Crecer profesionalmente y seguir aprendiendo en el día a día. ¡ Nunca paro de aprender !

Commits Messages

etiqueta mensaje
feat: "Un nuevo feature importante"
fix: "fixeado bug"
refactor: "refactorización de código"
docs: "documentación"

Instalación

Tener instalado Node.js y MongoDB.

Modificar .env-example y guardar como .env

MONGODB_URL=mongodb://localhost:27017/examen-almundo
SOCKET_URL_CORONA=https://TU-API-DEPLOYADA/api/v1/coronavirus
SOCKET_URL_CORONA_ARGENTINA=http://TU-API-DEPLOYADA/api/v1/coronavirus/argentina

Instalar las dependencias e iniciar:

$ npm install

En modo desarrollo

$ npm run dev

En modo produccion

$ npm start

En modo debug:

$ npm run debug

Lanzar nueva version:

$ npm run release

Testear Api Rest:

$ npm run dev
$ npm test

Con Docker

$ docker-compose build && docker-compose up

Ejemplo de agregar hotel mediante Postman y/o similar:

Field Name: name | value: ingrese titulo del hotel
Field Name: stars | value: 1 (ahora como numero)
Field Name: image | value: 6623490_6_b.jpg
Field Name: price | value: 1267.57
Field Name: amenities | value: business-center
Field Name: amenities | value: nightclub

Rutas de la Api (utilizar postman) v1:

/api/v1/hoteles(GET)
/api/v1/hoteles/:id (GET)
/api/v1/hoteles (POST)
/api/v1/hoteles/:id (PUT)
/api/v1/hoteles/:id (DELETE)
/api/v1/hoteles/:id/habitaciones (POST)

/api/v1/coronavirus (GET)
/api/v1/coronavirus/argentina (GET) 
/api/v1/coronavirus/argentina/provincia (GET)

Rutas y query de la Api v2 con GraphQl:

/api/v2/graphql
{
  hoteles {
    id
    name
    description
  }
}

Modelo Hotel

name: { type: String },
description: { type: String },
address: { type: String },
neighborhood: { type: String },
province: { type: String },
latitude: { type: String },
longitude: { type: String },
stars: { type: Number },
image: { type: String },
price: { type: Number},
discount: { type: Number },
phone: { type: String },
amenities: { type: Array },
rooms: [{ type: Schema.Types.ObjectId, ref: 'Room' }]

Modelo Habitaciones

name: { type: String },
price: { type: Number },
description: { type: String },
availability: { type: Number },
image: { type: String },
amenities: { type: Array }

Modelo Total casos Coronavirus y noticia

date: { type: String },
titulo: { type: String },
confirmados: { type: Number },
total_mundo: { type: Number },
recuperados: { type: Number },
fallecidos: { type: Number },

Modelo Mapa Argentina Coronavirus

type: { type: String },
properties: {
  lugar: { type: String, required: true },
  municipalidad: { type: String, required: true },
  ciudad: { type: String, required: true },
  confirmados: { type: Number, require: true },
  fallecidos: { type: Number, require: true },
  recuperados: { type: Number, require: true },
},
geometry: {
  type: { type: String, enum: ['Point'] },
  coordinates: { type: [Number]}
}

Modelo Casos por Provincias

provincia: { type: String, required: true },
municipalidad: { type: String, required: true },
ciudad: { type: String, required: true },
confirmados: { type: Number, require: true },
fallecidos: { type: Number, require: true },
recuperados: { type: Number, require: true },

alm-api-backend's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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