Skip to content

amirhnajafiz-university/S7CC01

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

S7CC01


Cloud computing first project/homework. In this project we are going to create a Ad Registration Service. We are building two Backend services for getting user information and processing the next steps.

First API (api)

In first API we are going to get all of our clients information about an Ad. This information consists of:

  • User Email
  • Ad title (description)
  • Ad image

Then we need to store User email and Ad Title in a MongoDB cluster and Ad Image in Amazon S3 database. After that we need to publish this information on a RabbitMQ Cluster.

In this API we need to return the information of each Ad. The schema is like this:

+----------+----------------------+----------------+----------------+-------------------+
| id (int) | description (string) | email (string) | state (string) | category (string) |
+----------+----------------------+----------------+----------------+-------------------+

Second API (processor)

In this API we need to process the Ad. We need to subscribe over RabbitMQ Cluster to receive events from first API. After that we are going to get Image from S3 cluster and then it will send that image to Image tagging service. It will get a response for the suggested tags and stores them inside our MongoDB. If the Ad was valid, it will send an email to client via Mailgun.

Requirements

  • Cloud based service, which we are going to use Arvan Cloud.
  • DBaaS (Database as a service), which we are going to use MongoDB Atlas.
  • Amazon S3 database for Object storage, which we are going to get from Arvan Cloud.
  • RabbitMQ service, which are going to use Cloud AMQP.
  • Image tagging service, which we are going to use Imagga.
  • Mail service, which we are going to use Mailgun.

API Information

Creating two Golang services to provide the APIs. (localhost:5050)

Routes

[
  {
    "method": "GET",
    "uri": "api/{id}",
    "response": {
      "id": "1",
      "description": "about ad",
      "email": "sender@gmail.com",
      "status": "progress/failed/successful",
      "category": "something",
      "image": "image link"
    }
  },
  {
    "method": "POST",
    "uri": "api/",
    "multipart form body": {
      "description": "about ad",
      "email": "sender@gmail.com",
      "file": "file object"
    },
    "response": {
      "id": "1"
    }
  }
]

Configs

imagga:
  api_key: ""
  api_secret: ""
mailgun:
  api_key: ""
  domain: ""
mqtt:
  queue: "ad-reg-queue"
  uri: ""
storage:
  mongodb:
    database: "ad-reg"
    uri: ""
  s3:
    accessKeyID: ""
    secretAccessKey: ""
    region: ""
    bucket: "ad-reg-bucket"
    endpoint: ""