Giter Site home page Giter Site logo

acronym-web-app's Introduction

acronym-web-app

This branch launches 3x containers: one for MongoDB, one for nginx/front end, and one for the SpringBoot API. After completing these instructions, usage is:

  • For Front-end, localhost:8081
  • For API call, localhost:8080/acronyms?bullets=<text with acronyms>
  1. Install docker (docker.io) and add your user to the docker group to add sudo rights (see https://docs.docker.com/install/linux/linux-postinstall/).

  2. Delete any containers named acronym-nginx-container, acronym-spring-app, or acronym-mongo-db.

  3. git clone this branch

  4. Move into folder with Mongo Dockerfile

cd ./acronym-web-app/MongoDocker
  1. Create docker software-defined network (SDN)
docker network create acronym-network
  1. Build MongoDB Docker image named acronym-mongo-image
docker build -t acronym-mongo-image ./
  1. Run MongoDB Docker image as a daemon, remove on exit, named acronym-mongo-db, map port 27017 on host to 27017 on container, and add to the SDN we defined.
docker run -d --rm --name acronym-mongo-db --p 27017:27017 --network acronym-network acronym-mongo-image
  1. Move to springBoot directory cd ..

  2. Build Spring Boot image & run

docker build -t acronym-spring-image
docker run -d --rm --name acronym-spring-app -p 8080:8080 --network acronym-network acronym-spring-image
  1. Build nginx image & run (uses port 8081 on localhost for nginx http port 80)
docker build -t acronym-nginx-image
docker run -d --rm --name acronym-nginx-container -p 8081:80 --network acronym-network acronym-nginx-image
  1. Access the app at localhost:8081!

acronym-web-app's People

Contributors

erob123 avatar haithamshahin333 avatar snekcode avatar

acronym-web-app's Issues

API Response Format Request

Description:

In the DB, the description field is an array of descriptions. It would make that field slightly easier to consume on the front end if it could be sent as an array, instead of as a single string, as it is currently sent.

Current Response Format:

{"acronyms": [
   {
      "name":"AA",
      "definition":"Assessment Agent,Avenue Of Approach"
   },
   {
      // more acronyms
   }
]}

Requested Response Format:

{"acronyms": [
   {
      "name":"AA",
      "definition": [ "Assessment Agent", "Avenue Of Approach"]
   },
   {
      // more acronyms
   }
]}

Example

{
   name: "GB",
   description: "Group Buffer,Sarin, A Nerve Agent"
}

Commas are not used in exactly the same way for every record.

Error: Non Unique Record in Database

Steps to recreate:

This query:
acronyms?bullets=SS

Expected:

Normal API response

Actual:

Results in the following response:

{
   "timestamp":"2019-04-28T06:24:43.373+0000",
   "status":500,
   "error":"Internal Server Error",
   "message":"Query { 
      \"$java\" : Query: { \"name\" : \"SS\" }, 
      Fields: { }, 
      Sort: { } 
   } returned non unique result.","path":"/acronyms"
}

The Issue:

Looking at the mongo inject script, these two records exist on separate lines:

{"name": "SS","definition": ["Submarine"]},
{"name": "SS","definition": ["Sea State (Number)"]},

The Fix:

I would assume these should be combined:

{"name": "SS","definition": ["Sea State (Number)", "Submarine"]},

I didn't look to see if any of the other records were repeated.

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.