2023-02-07 04:44:07 +00:00
2023-02-08 18:33:44 +00:00
2023-02-09 18:58:53 +00:00
2023-02-09 18:58:16 +00:00
2023-02-07 04:44:07 +00:00
2023-02-07 04:44:07 +00:00
2023-02-07 04:45:05 +00:00
2023-02-09 19:13:06 +00:00
2023-02-08 17:44:58 +00:00

DeeSee Comics Superhero Distribution Platform

Distribution platform to keep track of employed superheroes as a web service.

Introduction

This project is a solution to the AOE Backend Challenge. It is a simple REST API that allows to only retrieve superheroes.

Features

  • Web service that allows to retrieve superheroes.
  • Superheroes can be filtered by their powers and their true identity can be encrypted to further provide protection for the ones enrolled in the platform.
  • Encryption is done using a proprietary encryption called the “DeeSee Chiffre”.
  • The superheroes are stored in a json file.
  • The application can be configured via environment variables.

Prerequisites

  • Golang 1.19
  • Make 4.3
  • Bash 5.1

Configuration

The application can be configured via environment variables:

  • PORT - the port the application will listen on (default: 8080)
  • KEY - the key used for the encryption (default: 5)
  • DATA_FILE - the path to the json file containing the superheroes (default: data/superheroes.json)

How to run

  • make run to run the application
  • make build to build the application
  • make clean to clean the application
  • make test to run the tests

API Documentation

Get a list of superheroes

GET /superheroes

Parameters

  • (optional) superpowers - a comma separated list of superpowers to filter the superheroes by.
  • (optional) encrypted - if set to true, the identity will be encrypted.

Example

GET /superheroes?superpowers=strength,flight&encrypted=true

Result

[
  {
    "name": "superman",
    "identity": {
      "firstName": "hqfwp",
      "lastName": "kent"
    },
    "birthday": "1977-04-18",
    "superpowers": [
      "flight",
      "strength",
      "invulnerability"
    ]
  },
  {
    "name": "batman",
    "identity": {
      "firstName": "hqfwp",
      "lastName": "kent"
    },
    "birthday": "1977-04-18",
    "superpowers": [
      "flight",
      "strength",
      "invulnerability"
    ]
  }
]

Store superhero data

PUT /superheroes

{"name":"supermans","identity":{"firstName":"Kent","lastName":"Clark"},"superpowers":["flight","strength","invulnerability"],"birthday":"1977-04-18"}

Result

{
  "message": "Superhero stored successfully.",
  "status": "success"
}
Description
No description provided
Readme 66 KiB
Languages
Go 96.6%
Makefile 3.4%